Skip to content

Commit

Permalink
scripts integration: capture exit codes from both tests (#3149)
Browse files Browse the repository at this point in the history
  • Loading branch information
dshehbaj authored Dec 20, 2024
1 parent ec4f86d commit 2a63452
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions scripts/lib/integration.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,21 +35,27 @@ function run_kops_conformance() {

# Run the focused set of tests with detailed logging
TEST_START=$SECONDS
set -o pipefail # Ensure we catch test failures
TEST_RESULT=success

/tmp/e2e.test --ginkgo.focus="Conformance" --ginkgo.timeout=120m --kubeconfig=$KUBECONFIG --ginkgo.v --ginkgo.trace --ginkgo.flake-attempts 8 \
--ginkgo.skip="(works for CRD with validation schema)|(ServiceAccountIssuerDiscovery should support OIDC discovery of service account issuer)|(should support remote command execution over websockets)|(should support retrieving logs from the container over websockets)|(Basic StatefulSet functionality [StatefulSetBasic])|\[Slow\]|\[Serial\]"
--ginkgo.skip="(works for CRD with validation schema)|(ServiceAccountIssuerDiscovery should support OIDC discovery of service account issuer)|(should support remote command execution over websockets)|(should support retrieving logs from the container over websockets)|(Basic StatefulSet functionality [StatefulSetBasic])|\[Slow\]|\[Serial\]" || TEST_RESULT=fail

/tmp/e2e.test --ginkgo.focus="\[Serial\].*Conformance" --ginkgo.timeout=120m --kubeconfig=$KUBECONFIG --ginkgo.v --ginkgo.trace --ginkgo.flake-attempts 8 \
--ginkgo.skip="(ServiceAccountIssuerDiscovery should support OIDC discovery of service account issuer)|(should support remote command execution over websockets)|(should support retrieving logs from the container over websockets)|\[Slow\]"
echo "Kops conformance tests ran successfully!"
--ginkgo.skip="(ServiceAccountIssuerDiscovery should support OIDC discovery of service account issuer)|(should support remote command execution over websockets)|(should support retrieving logs from the container over websockets)|\[Slow\]" || TEST_RESULT=fail

TEST_EXIT_CODE=$?
TEST_DURATION=$((SECONDS - TEST_START))

echo "=== Test Results ==="
echo "Test duration: $TEST_DURATION seconds"
echo "Exit code: $TEST_EXIT_CODE"
echo "Test result: $TEST_RESULT"

# If any test failed, return failure
if [[ "$TEST_RESULT" == "fail" ]]; then
echo "One or more test suites failed!"
exit 1
fi

echo "All test suites passed successfully!"

# Show cluster state after tests
echo "=== Cluster State After Tests ==="
Expand All @@ -70,7 +76,7 @@ function run_kops_conformance() {
sleep 240

# Exit with the test exit code
return $TEST_EXIT_CODE
return 0
}

function build_and_push_image() {
Expand Down

0 comments on commit 2a63452

Please sign in to comment.