Skip to content

Commit

Permalink
Chore: run e2e in parallel by cases (pingcap#164)
Browse files Browse the repository at this point in the history
Co-authored-by: Cody (Xuecheng) Zhang <csuzhangxc@gmail.com>
  • Loading branch information
fgksgf and csuzhangxc authored Nov 29, 2024
1 parent 5e89ff1 commit c82a1ac
Show file tree
Hide file tree
Showing 3 changed files with 534 additions and 517 deletions.
19 changes: 17 additions & 2 deletions .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,16 @@ concurrency:
jobs:
e2e:
runs-on: self-hosted
strategy:
fail-fast: false
max-parallel: 3 # Avoid docker rate limit
matrix:
spec:
- "Basic"
- "Rolling Update"
- "Version Upgrade"
- "TLS"
- "TiDB Feature"
steps:
- uses: actions/checkout@v4
- name: setup go
Expand All @@ -39,16 +49,21 @@ jobs:
- name: E2E test
env:
CI: "true"
GINKGO_OPTS: "--focus=${{ matrix.spec }}"
run: |
make e2e
make e2e/prepare
make e2e/run
- name: Collect logs of Operator
if: always()
run: |
./_output/bin/kubectl logs -n tidb-admin deployment/tidb-operator > tidb-operator.log
- name: Upload logs
if: always()
uses: actions/upload-artifact@v4
with:
name: tidb-operator-log
retention-days: 7
name: tidb-operator-log-${{ github.run_id }}-${{ github.job }}
path: tidb-operator.log
overwrite: 'true'
4 changes: 2 additions & 2 deletions hack/lib/e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ function e2e::install_generate_jwt() {

function e2e::run() {
if [[ "$CI" == "true" ]]; then
echo "running e2e tests in CI mode..."
$GINKGO -v -r --timeout=2h --procs=1 --compilers=1 --randomize-all --randomize-suites --fail-on-empty --keep-going --race --trace --github-output "$ROOT/tests/e2e/..."
echo "running e2e tests in CI mode with options: $*"
$GINKGO -v -r --timeout=2h --procs=1 --compilers=1 --randomize-all --randomize-suites --fail-on-empty --keep-going --race --trace --github-output "$*" "$ROOT/tests/e2e/..."
else
echo "running e2e tests locally..."
$GINKGO -r -v "$@" "$ROOT/tests/e2e/..."
Expand Down
Loading

0 comments on commit c82a1ac

Please sign in to comment.