Skip to content

Conversation

@komer3
Copy link
Contributor

@komer3 komer3 commented Feb 11, 2026

Summary

This PR improves the reliability and debuggability of our e2e test suite by:

  1. Standardizing bash error handling across all 47 e2e chainsaw tests by changing set -e to set -euo pipefail
  2. Adding CCM log collection on test failure to help debug issues

Changes

Bash Error Handling Standardization

  • Replaced set -e with set -euo pipefail in all script blocks
  • set -euo pipefail provides:
    • -e: Exit on any command failure
    • -u: Treat unset variables as errors
    • -o pipefail: Exit if any command in a pipeline fails

CCM Log Collection on Failure

  • Added catch blocks to all 47 e2e tests
  • On test failure, automatically fetches the last 100 lines of CCM logs filtered by test namespace
  • Uses kubectl logs -n kube-system daemonsets/ccm-linode | grep "<test-namespace>" | tail -100

Impact

  • Better error detection: Tests will fail more reliably on subtle issues like unset variables or pipeline failures
  • Improved debugging: Test failures now automatically include relevant CCM logs for faster troubleshooting
  • Consistent behavior: All e2e tests now use the same robust bash error handling

Files Changed

  • 47 e2e chainsaw test files across e2e/test/, e2e/bgp-test/, and e2e/subnet-test/

Testing

  • Changes are purely infrastructure improvements to the test framework
  • No functional changes to the CCM itself
  • All existing e2e tests should continue to pass with improved error detection

…tests by using 'set -euo pipefail'

Replace 'set -e' with 'set -euo pipefail' across all e2e chainsaw test scripts to enable stricter error handling. Add 'set -euo pipefail' to catch blocks that were missing it. This ensures scripts fail on undefined variables and pipeline errors in addition to command failures.
@github-actions github-actions bot added improvement for improvements in existing functionality in the changelog. testing for updates to the testing suite in the changelog. labels Feb 11, 2026
@codecov
Copy link

codecov bot commented Feb 11, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 73.39%. Comparing base (39b5474) to head (c02c91d).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #523   +/-   ##
=======================================
  Coverage   73.39%   73.39%           
=======================================
  Files          19       19           
  Lines        2902     2902           
=======================================
  Hits         2130     2130           
  Misses        523      523           
  Partials      249      249           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@komer3 komer3 merged commit bc72420 into main Feb 12, 2026
12 checks passed
@komer3 komer3 deleted the e2e-tests-ccm-log-debugging branch February 12, 2026 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

improvement for improvements in existing functionality in the changelog. testing for updates to the testing suite in the changelog.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants