-
Notifications
You must be signed in to change notification settings - Fork 153
[CRDB-53973] e2e/operator: advanced e2e tests for bare-metal infrastructure(kind). #577
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
NishanthNalluri
wants to merge
1
commit into
master
Choose a base branch
from
nishanth/operator-advanced-tests
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,139 @@ | ||
| name: advanced-features-tests | ||
|
|
||
| on: | ||
| schedule: | ||
| - cron: "15 6 * * 1" # Run at 6:15 AM on every Monday UTC to avoid peak times | ||
| # Allow manual trigger on any branch | ||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
| integration-tests-advanced-features: | ||
| runs-on: ubuntu-latest-4-core | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| provider: [k3d, kind] | ||
| timeout-minutes: 120 | ||
| permissions: | ||
| contents: read | ||
| id-token: write | ||
| env: | ||
| GCP_PROJECT_ID: ${{ secrets.GCP_PROJECT_ID }} | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Setup Go | ||
| uses: actions/setup-go@v5 | ||
| with: | ||
| go-version: 1.23 | ||
| - name: Authenticate to Google Cloud | ||
| uses: 'google-github-actions/auth@v2' | ||
| id: auth | ||
| with: | ||
| token_format: access_token | ||
| project_id: 'cockroach-helm-testing' | ||
| workload_identity_provider: ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }} | ||
| service_account: ${{ secrets.GCP_SERVICE_ACCOUNT }} | ||
| - name: Set up gcloud CLI | ||
| uses: google-github-actions/setup-gcloud@v2 | ||
| - name: Install gke-gcloud-auth-plugin | ||
| run: | | ||
| gcloud components install gke-gcloud-auth-plugin | ||
| - name: Run tests (advanced features) | ||
| env: | ||
| PROVIDER: ${{ matrix.provider }} | ||
| TEST_ADVANCED_FEATURES: true | ||
| USE_GKE_GCLOUD_AUTH_PLUGIN: True | ||
| run: | | ||
| set -euo pipefail | ||
| make test/nightly-e2e/advanced | tee test_output.log | ||
| - name: Run multi-region tests (advanced features) | ||
| env: | ||
| PROVIDER: ${{ matrix.provider }} | ||
| TEST_ADVANCED_FEATURES: true | ||
| USE_GKE_GCLOUD_AUTH_PLUGIN: True | ||
| run: | | ||
| set -euo pipefail | ||
| make test/nightly-e2e/advanced/multi-region | tee -a test_output.log | ||
| - name: Archive test results | ||
| if: ${{ always() }} | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: advanced-features-test-results-${{ matrix.provider }} | ||
| path: | | ||
| test_output.log | ||
| test_output.json | ||
| - name: Slack notification (advanced features) | ||
| if: ${{ always() && github.ref_name == 'master' }} | ||
| run: | | ||
| echo "Preparing Slack message for advanced features tests..." | ||
|
|
||
| if [ ! -f test_output.json ]; then | ||
| echo "Generating test_output.json from log..." | ||
| grep -E "=== RUN|--- PASS:|--- FAIL:" test_output.log | awk ' | ||
| /=== RUN/ { | ||
| test_name = $3 | ||
| tests[test_name] = "running" | ||
| } | ||
| /--- PASS:/ { | ||
| test_name = $3 | ||
| if (test_name in tests) { | ||
| print "{\"Action\":\"pass\",\"Test\":\"" test_name "\"}" | ||
| } | ||
| } | ||
| /--- FAIL:/ { | ||
| test_name = $3 | ||
| if (test_name in tests) { | ||
| print "{\"Action\":\"fail\",\"Test\":\"" test_name "\"}" | ||
| } | ||
| }' > test_output.json | ||
| fi | ||
|
|
||
| PASSED_TESTS=$(jq -r 'select(.Action=="pass") | .Test' test_output.json | sed 's|.*/||' | grep '^Test' | grep -v '^TestOperatorIn' | sort | uniq | head -n 20 | paste -sd ", " -) | ||
| FAILED_TESTS=$(jq -r 'select(.Action=="fail") | .Test' test_output.json | sed 's|.*/||' | grep '^Test' | grep -v '^TestOperatorIn' | sort | uniq | head -n 20 | paste -sd ", " -) | ||
| PASSED_COUNT=$(jq -r 'select(.Action=="pass") | .Test' test_output.json | sed 's|.*/||' | grep '^Test' | grep -v '^TestOperatorIn' | sort | uniq | wc -l) | ||
| FAILED_COUNT=$(jq -r 'select(.Action=="fail") | .Test' test_output.json | sed 's|.*/||' | grep '^Test' | grep -v '^TestOperatorIn' | sort | uniq | wc -l) | ||
|
|
||
| if [ "$FAILED_COUNT" -gt 0 ]; then | ||
| STATUS="❌ *Advanced features integration tests failed!*" | ||
| COLOR="#ff0000" | ||
| else | ||
| STATUS="✅ *Advanced features integration tests passed!*" | ||
| COLOR="#36a64f" | ||
| fi | ||
|
|
||
| REPO_NAME="helm-charts" | ||
|
|
||
| PAYLOAD=$(jq -n \ | ||
| --arg text "$STATUS" \ | ||
| --arg color "$COLOR" \ | ||
| --arg repo "$REPO_NAME" \ | ||
| --arg branch "${{ github.ref_name }}" \ | ||
| --arg workflow "${{ github.workflow }}" \ | ||
| --arg provider "${{ matrix.provider }}" \ | ||
| --arg url "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" \ | ||
| --arg passed "$PASSED_COUNT" \ | ||
| --arg failed "$FAILED_COUNT" \ | ||
| --arg passed_tests "$PASSED_TESTS" \ | ||
| --arg failed_tests "$FAILED_TESTS" \ | ||
| '{ | ||
| text: $text, | ||
| attachments: [ | ||
| { | ||
| color: $color, | ||
| fields: [ | ||
| {"title": "Repository", "value": $repo, "short": true}, | ||
| {"title": "Branch", "value": $branch, "short": true}, | ||
| {"title": "Provider", "value": $provider, "short": true}, | ||
| {"title": "✅ Passed", "value": $passed, "short": true}, | ||
| {"title": "❌ Failed", "value": $failed, "short": true}, | ||
| {"title": "❌ Failed Tests", "value": (if $failed_tests == "" then "None" else $failed_tests end), "short": false}, | ||
| {"title": "✅ Passed Tests", "value": (if $passed_tests == "" then "None" else $passed_tests end), "short": false}, | ||
| {"title": "Run URL", "value": $url, "short": false} | ||
| ] | ||
| } | ||
| ] | ||
| }') | ||
|
|
||
| curl -X POST -H 'Content-type: application/json' \ | ||
| --data "$PAYLOAD" \ | ||
| "${{ secrets.SLACK_WEBHOOK_URL }}" | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.