Skip to content

Commit 41f6e9b

Browse files
e2e/operator: Advanced e2e tests for bare-metal infrastructure(kind).
This commit introduces advanced e2e tests for single and multi region for CockroachDB features like Wal-failover, EAR and PCR. These tests verifies supportibility when configured through helm-charts rather than re-validating functionality. These advanced tests are run weekly once similar to the existing weekly tests and are executed independently without mixing with basic tests.
1 parent 9aa0a94 commit 41f6e9b

File tree

8 files changed

+1777
-40
lines changed

8 files changed

+1777
-40
lines changed
Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
name: advanced-features-tests
2+
3+
on:
4+
schedule:
5+
- cron: "15 6 * * 1" # Run at 6:15 AM on every Monday UTC to avoid peak times
6+
# Allow manual trigger on any branch
7+
workflow_dispatch:
8+
9+
jobs:
10+
integration-tests-advanced-features:
11+
runs-on: ubuntu-latest-4-core
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
provider: [k3d, kind]
16+
timeout-minutes: 120
17+
permissions:
18+
contents: read
19+
id-token: write
20+
env:
21+
GCP_PROJECT_ID: ${{ secrets.GCP_PROJECT_ID }}
22+
steps:
23+
- uses: actions/checkout@v4
24+
- name: Setup Go
25+
uses: actions/setup-go@v5
26+
with:
27+
go-version: 1.23
28+
- name: Authenticate to Google Cloud
29+
uses: 'google-github-actions/auth@v2'
30+
id: auth
31+
with:
32+
token_format: access_token
33+
project_id: 'cockroach-helm-testing'
34+
workload_identity_provider: ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }}
35+
service_account: ${{ secrets.GCP_SERVICE_ACCOUNT }}
36+
- name: Set up gcloud CLI
37+
uses: google-github-actions/setup-gcloud@v2
38+
- name: Install gke-gcloud-auth-plugin
39+
run: |
40+
gcloud components install gke-gcloud-auth-plugin
41+
- name: Run tests (advanced features)
42+
env:
43+
PROVIDER: ${{ matrix.provider }}
44+
TEST_ADVANCED_FEATURES: true
45+
USE_GKE_GCLOUD_AUTH_PLUGIN: True
46+
run: |
47+
set -euo pipefail
48+
make test/nightly-e2e/advanced | tee test_output.log
49+
- name: Archive test results
50+
if: ${{ always() }}
51+
uses: actions/upload-artifact@v4
52+
with:
53+
name: advanced-features-test-results-${{ matrix.provider }}
54+
path: |
55+
test_output.log
56+
test_output.json
57+
- name: Slack notification (advanced features)
58+
if: ${{ always() }}
59+
run: |
60+
echo "Preparing Slack message for advanced features tests..."
61+
62+
if [ ! -f test_output.json ]; then
63+
echo "Generating test_output.json from log..."
64+
grep -E "=== RUN|--- PASS:|--- FAIL:" test_output.log | awk '
65+
/=== RUN/ {
66+
test_name = $3
67+
tests[test_name] = "running"
68+
}
69+
/--- PASS:/ {
70+
test_name = $3
71+
if (test_name in tests) {
72+
print "{\"Action\":\"pass\",\"Test\":\"" test_name "\"}"
73+
}
74+
}
75+
/--- FAIL:/ {
76+
test_name = $3
77+
if (test_name in tests) {
78+
print "{\"Action\":\"fail\",\"Test\":\"" test_name "\"}"
79+
}
80+
}' > test_output.json
81+
fi
82+
83+
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 ", " -)
84+
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 ", " -)
85+
PASSED_COUNT=$(jq -r 'select(.Action=="pass") | .Test' test_output.json | sed 's|.*/||' | grep '^Test' | grep -v '^TestOperatorIn' | sort | uniq | wc -l)
86+
FAILED_COUNT=$(jq -r 'select(.Action=="fail") | .Test' test_output.json | sed 's|.*/||' | grep '^Test' | grep -v '^TestOperatorIn' | sort | uniq | wc -l)
87+
88+
if [ "$FAILED_COUNT" -gt 0 ]; then
89+
STATUS="❌ *Advanced features integration tests failed!*"
90+
COLOR="#ff0000"
91+
else
92+
STATUS="✅ *Advanced features integration tests passed!*"
93+
COLOR="#36a64f"
94+
fi
95+
96+
REPO_NAME="helm-charts"
97+
98+
PAYLOAD=$(jq -n \
99+
--arg text "$STATUS" \
100+
--arg color "$COLOR" \
101+
--arg repo "$REPO_NAME" \
102+
--arg branch "${{ github.ref_name }}" \
103+
--arg workflow "${{ github.workflow }}" \
104+
--arg provider "${{ matrix.provider }}" \
105+
--arg url "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" \
106+
--arg passed "$PASSED_COUNT" \
107+
--arg failed "$FAILED_COUNT" \
108+
--arg passed_tests "$PASSED_TESTS" \
109+
--arg failed_tests "$FAILED_TESTS" \
110+
'{
111+
text: $text,
112+
attachments: [
113+
{
114+
color: $color,
115+
fields: [
116+
{"title": "Repository", "value": $repo, "short": true},
117+
{"title": "Branch", "value": $branch, "short": true},
118+
{"title": "Provider", "value": $provider, "short": true},
119+
{"title": "✅ Passed", "value": $passed, "short": true},
120+
{"title": "❌ Failed", "value": $failed, "short": true},
121+
{"title": "❌ Failed Tests", "value": (if $failed_tests == "" then "None" else $failed_tests end), "short": false},
122+
{"title": "✅ Passed Tests", "value": (if $passed_tests == "" then "None" else $passed_tests end), "short": false},
123+
{"title": "Run URL", "value": $url, "short": false}
124+
]
125+
}
126+
]
127+
}')
128+
129+
curl -X POST -H 'Content-type: application/json' \
130+
--data "$PAYLOAD" \
131+
"${{ secrets.SLACK_WEBHOOK_URL }}"

Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,10 @@ test/single-cluster/up: bin/k3d
137137
test/multi-cluster/down: bin/k3d
138138
./tests/k3d/dev-multi-cluster.sh down
139139

140+
test/nightly-e2e/advanced: bin/cockroach bin/kubectl bin/helm build/self-signer bin/k3d bin/kind
141+
@PATH="$(PWD)/bin:${PATH}" TEST_ADVANCED_FEATURES=true go test -timeout 90m -v -test.run TestOperatorInSingleRegion ./tests/e2e/operator/singleRegion/... || (echo "Advanced features tests failed with exit code $$?" && exit 1)
142+
143+
140144
test/lint: bin/helm ## lint the helm chart
141145
@build/lint.sh && \
142146
bin/helm lint cockroachdb && \

cockroachdb-parent/charts/operator/values.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ image:
1010
# pullPolicy specifies the image pull policy.
1111
pullPolicy: IfNotPresent
1212
# tag is the image tag.
13-
tag: "9975a200e1e046a067e0350b970174ef6590468a2d07d7565b34d4eff16a032f"
13+
tag: "aad6fac0d535f1758bac09e90e168deb3880adb8642747c4d77eadf4f6ba5add"
1414
# certificate defines the certificate settings for the Operator.
1515
certificate:
1616
# validForDays specifies the number of days the certificate is valid for.

0 commit comments

Comments
 (0)