Skip to content

Commit

Permalink
E2E tests bug fix (#944)
Browse files Browse the repository at this point in the history
* Fixed bugs in e2e eks cluster tests

* Updated e2e cluster test provisioning
  • Loading branch information
GavinBurris42 authored Jan 19, 2024
1 parent 7c71579 commit 655af64
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
7 changes: 5 additions & 2 deletions test/eks-cluster-test/cluster-spec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,18 @@ kind: ClusterConfig
metadata:
name: nth-eks-cluster-test
region: us-west-2
version: '1.22'
version: '1.27'
cloudWatch:
clusterLogging:
enableTypes: ["*"]
managedNodeGroups:
- name: linux-ng
instanceType: t3.large
instanceType: t3.medium
amiFamily: AmazonLinux2
desiredCapacity: 2
minSize: 2
maxSize: 2
spot: true
nodeGroups:
- name: windows-ng
instanceType: m5.large
Expand Down
2 changes: 1 addition & 1 deletion test/eks-cluster-test/provision-cluster
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ CLUSTER_NAME="nth-eks-cluster-test"
cluster_exists=$(eksctl get cluster --region $REGION | grep "$CLUSTER_NAME" || :)
if [[ -z $cluster_exists ]]; then
echo "🥑 Provisioning EKS cluster"
eksctl create cluster -f $CLUSTER_CONFIG_FILE --install-vpc-controllers
eksctl create cluster -f $CLUSTER_CONFIG_FILE
else
echo "🥑 $CLUSTER_NAME already exists; continuing with test run"
fi
Expand Down
7 changes: 2 additions & 5 deletions test/eks-cluster-test/run-test
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ echo "INSTANCE_METADATA_URL=${INSTANCE_METADATA_URL:=$EC2_METADATA_URL}"

# Label first linux node in cluster; nth will be deployed to this node ONLY -- NEEDED FOR LINUX RUN ONLY:
if [[ $TEST_OS = "linux" ]]; then
nth_node=$(kubectl get node --selector="kubernetes.io/os=linux" --output jsonpath='{.items[-1].metadata.name}')
nth_node=$(kubectl get node --selector="kubernetes.io/os=linux" --output jsonpath='{.items[0].metadata.name}')
export NTH_WORKER_LABEL="role=nth_worker"
kubectl label nodes $nth_node $NTH_WORKER_LABEL --overwrite
fi
Expand All @@ -171,10 +171,7 @@ if ! kubectl get svc >/dev/null 2>&1; then
exit 1
fi

TEST_NODE=$(kubectl get nodes -l kubernetes.io/os=$TEST_OS |
tail -n +2 |
tr -s "\t" " " |
cut -d" " -f1)
TEST_NODE=$(kubectl get nodes -l kubernetes.io/os=$TEST_OS --output jsonpath='{.items[0].metadata.name}')
export TEST_NODE
echo "TEST_NODE=${TEST_NODE:?"not found"}"

Expand Down

0 comments on commit 655af64

Please sign in to comment.