Skip to content

Commit

Permalink
fix integration test script (#1998)
Browse files Browse the repository at this point in the history
  • Loading branch information
sushrk authored Jun 18, 2022
1 parent 10f3aed commit 5c6945e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
13 changes: 6 additions & 7 deletions scripts/run-cni-release-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,8 @@
set -e

SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
TEST_DIR="$SCRIPT_DIR/../test"
INTEGRATION_TEST_DIR="$TEST_DIR/integration"
CALICO_TEST_DIR="$TEST_DIR/e2e/calico"
INTEGRATION_TEST_DIR="$SCRIPT_DIR/../test/integration"
CALICO_TEST_DIR="$SCRIPT_DIR/../test/e2e/calico"

source "$SCRIPT_DIR"/lib/cluster.sh
source "$SCRIPT_DIR"/lib/integration.sh
Expand All @@ -28,19 +27,20 @@ function run_integration_test() {
TEST_RESULT=success
echo "Running cni integration tests"
START=$SECONDS
CGO_ENABLED=0 ginkgo -v $INTEGRATION_TEST_DIR/cni --timeout 60m --fail-on-pending -- --cluster-kubeconfig="$KUBE_CONFIG_PATH" --cluster-name="$CLUSTER_NAME" --aws-region="$REGION" --aws-vpc-id="$VPC_ID" --ng-name-label-key="$NG_LABEL_KEY" --ng-name-label-val="$NG_LABEL_VAL" || TEST_RESULT=fail
# skip tests for changes not released yet and are applicable in future releases only, for now skipping 1.11.3
cd $INTEGRATION_TEST_DIR/cni && CGO_ENABLED=0 ginkgo --skip="1.11.3" -v -timeout 60m --fail-on-pending -- --cluster-kubeconfig="$KUBE_CONFIG_PATH" --cluster-name="$CLUSTER_NAME" --aws-region="$REGION" --aws-vpc-id="$VPC_ID" --ng-name-label-key="$NG_LABEL_KEY" --ng-name-label-val="$NG_LABEL_VAL" || TEST_RESULT=fail
echo "cni test took $((SECONDS - START)) seconds."
echo "Running ipamd integration tests"
START=$SECONDS
CGO_ENABLED=0 ginkgo -v $INTEGRATION_TEST_DIR/ipamd --timeout 120m --fail-on-pending -- --cluster-kubeconfig="$KUBE_CONFIG_PATH" --cluster-name="$CLUSTER_NAME" --aws-region="$REGION" --aws-vpc-id="$VPC_ID" --ng-name-label-key="$NG_LABEL_KEY" --ng-name-label-val="$NG_LABEL_VAL" || TEST_RESULT=fail
cd $INTEGRATION_TEST_DIR/ipamd && CGO_ENABLED=0 ginkgo --skip="1.11.3" -v -timeout 90m --fail-on-pending -- --cluster-kubeconfig="$KUBE_CONFIG_PATH" --cluster-name="$CLUSTER_NAME" --aws-region="$REGION" --aws-vpc-id="$VPC_ID" --ng-name-label-key="$NG_LABEL_KEY" --ng-name-label-val="$NG_LABEL_VAL" || TEST_RESULT=fail
echo "ipamd test took $((SECONDS - START)) seconds."

: "${CNI_METRICS_HELPER:=602401143452.dkr.ecr.us-west-2.amazonaws.com/cni-metrics-helper:v1.7.10}"
REPO_NAME=$(echo $CNI_METRICS_HELPER | cut -d ":" -f 1)
TAG=$(echo $CNI_METRICS_HELPER | cut -d ":" -f 2)
echo "Running cni-metrics-helper image($CNI_METRICS_HELPER) tests"
START=$SECONDS
CGO_ENABLED=0 ginkgo -v $INTEGRATION_TEST_DIR/metrics-helper --timeout 120m --fail-on-pending -- --cluster-kubeconfig="$KUBE_CONFIG_PATH" --cluster-name="$CLUSTER_NAME" --aws-region="$REGION" --aws-vpc-id="$VPC_ID" --ng-name-label-key="$NG_LABEL_KEY" --ng-name-label-val="$NG_LABEL_VAL" --cni-metrics-helper-image-repo=$REPO_NAME --cni-metrics-helper-image-tag=$TAG || TEST_RESULT=fail
cd $INTEGRATION_TEST_DIR/metrics-helper && CGO_ENABLED=0 ginkgo --skip="1.11.3" -v -timeout 15m --fail-on-pending -- --cluster-kubeconfig="$KUBE_CONFIG_PATH" --cluster-name="$CLUSTER_NAME" --aws-region="$REGION" --aws-vpc-id="$VPC_ID" --ng-name-label-key="$NG_LABEL_KEY" --ng-name-label-val="$NG_LABEL_VAL" --cni-metrics-helper-image-repo=$REPO_NAME --cni-metrics-helper-image-tag=$TAG || TEST_RESULT=fail
echo "cni-metrics-helper test took $((SECONDS - START)) seconds."
if [[ "$TEST_RESULT" == fail ]]; then
echo "Integration test failed."
Expand Down Expand Up @@ -70,7 +70,6 @@ fi
echo "Running release tests on cluster: $CLUSTER_NAME in region: $REGION"
load_cluster_details
START=$SECONDS
cd $TEST_DIR
run_integration_test
run_calico_tests
echo "Completed running all tests in $((SECONDS - START)) seconds."
3 changes: 2 additions & 1 deletion test/integration/ipamd/ipamd_event_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ import (
const EKSCNIPolicyARN = "arn:aws:iam::aws:policy/AmazonEKS_CNI_Policy"
const AwsNodeLabelKey = "k8s-app"

var _ = Describe("test aws-node pod event", func() {
// Changes tested in this case is not released yet, adding future release version label to identify
var _ = Describe("[1.11.3] test aws-node pod event", func() {

// Verifies aws-node pod events works as expected
Context("when iam role is missing VPC_CNI policy", func() {
Expand Down

0 comments on commit 5c6945e

Please sign in to comment.