|
14 | 14 | limit:
|
15 | 15 | description: 'Limit to the specified engines list (local, eks, aks, gke, rke)'
|
16 | 16 | required: false
|
| 17 | + test_level: |
| 18 | + description: 'Test level (0-4)' |
| 19 | + required: false |
17 | 20 | schedule:
|
18 | 21 | - cron: '0 1 * * *'
|
19 | 22 |
|
@@ -344,6 +347,7 @@ jobs:
|
344 | 347 | event-type: cnp-trigger
|
345 | 348 | client-payload: '{"upstream_commit": "${{ github.event.pull_request.head.sha || github.sha }}"}'
|
346 | 349 |
|
| 350 | + |
347 | 351 | generate-jobs:
|
348 | 352 | name: Generate jobs for E2E tests
|
349 | 353 | needs:
|
@@ -376,18 +380,44 @@ jobs:
|
376 | 380 | -m '${{ github.event.inputs.depth || github.event_name }}' \
|
377 | 381 | -l '${{ github.event.inputs.limit }}'
|
378 | 382 |
|
| 383 | + evaluate-test-level: |
| 384 | + name: Evaluate test level |
| 385 | + needs: |
| 386 | + - generate-jobs |
| 387 | + runs-on: ubuntu-20.04 |
| 388 | + outputs: |
| 389 | + testLevel: ${{ steps.evaluate-test-level.outputs.testLevel }} |
| 390 | + steps: |
| 391 | + - name: evaluate test level |
| 392 | + id: evaluate-test-level |
| 393 | + run: | |
| 394 | + declare -A events |
| 395 | + events=([push]=0 [pull_request]=2 [main]=3 [schedule]=4) |
| 396 | + test_level_from_input="${{ github.event.inputs.test_level }}" |
| 397 | + if [ -n "${test_level_from_input}" ] |
| 398 | + then |
| 399 | + echo "::set-output name=testLevel::${test_level_from_input}" |
| 400 | + exit 0 |
| 401 | + fi |
| 402 | + test_level_generated="${{ github.event.inputs.depth || github.event_name }}" |
| 403 | + if [ -n "${test_level_generated}" ] |
| 404 | + then |
| 405 | + echo "::set-output name=testLevel::${events[${test_level_generated}]}" |
| 406 | + fi |
| 407 | +
|
379 | 408 | e2e-local:
|
380 | 409 | name: Run E2E on local executors
|
381 | 410 | if: ${{ needs.generate-jobs.outputs.localEnabled == 'true' && needs.duplicate_runs.outputs.should_skip != 'true' }}
|
382 | 411 | needs:
|
383 | 412 | - generate-jobs
|
384 | 413 | - duplicate_runs
|
| 414 | + - evaluate-test-level |
385 | 415 | strategy:
|
386 | 416 | fail-fast: false
|
387 | 417 | matrix: ${{ fromJSON(needs.generate-jobs.outputs.localMatrix) }}
|
388 | 418 | runs-on: ubuntu-20.04
|
389 | 419 | env:
|
390 |
| - TEST_DEPTH: 4 |
| 420 | + TEST_DEPTH: ${{ needs.evaluate-test-level.outputs.testLevel }} |
391 | 421 | K8S_VERSION: "${{ matrix.k8s_version }}"
|
392 | 422 | POSTGRES_IMG: "${{ matrix.postgres_img }}"
|
393 | 423 | E2E_PRE_ROLLING_UPDATE_IMG: "${{ matrix.postgres_pre_img }}"
|
@@ -466,14 +496,15 @@ jobs:
|
466 | 496 | needs:
|
467 | 497 | - generate-jobs
|
468 | 498 | - duplicate_runs
|
| 499 | + - evaluate-test-level |
469 | 500 | strategy:
|
470 | 501 | fail-fast: false
|
471 | 502 | max-parallel: 15
|
472 | 503 | matrix:
|
473 | 504 | ${{ fromJSON(needs.generate-jobs.outputs.aksMatrix) }}
|
474 | 505 | runs-on: ubuntu-20.04
|
475 | 506 | env:
|
476 |
| - TEST_DEPTH: 4 |
| 507 | + TEST_DEPTH: ${{ needs.evaluate-test-level.outputs.testLevel }} |
477 | 508 | K8S_VERSION: "${{ matrix.k8s_version }}"
|
478 | 509 | POSTGRES_IMG: "${{ matrix.postgres_img }}"
|
479 | 510 | E2E_PRE_ROLLING_UPDATE_IMG: "${{ matrix.postgres_pre_img }}"
|
@@ -613,13 +644,14 @@ jobs:
|
613 | 644 | needs:
|
614 | 645 | - generate-jobs
|
615 | 646 | - duplicate_runs
|
| 647 | + - evaluate-test-level |
616 | 648 | strategy:
|
617 | 649 | fail-fast: false
|
618 | 650 | matrix:
|
619 | 651 | ${{ fromJSON(needs.generate-jobs.outputs.eksMatrix) }}
|
620 | 652 | runs-on: ubuntu-20.04
|
621 | 653 | env:
|
622 |
| - TEST_DEPTH: 4 |
| 654 | + TEST_DEPTH: ${{ needs.evaluate-test-level.outputs.testLevel }} |
623 | 655 | K8S_VERSION: "${{ matrix.k8s_version }}"
|
624 | 656 | POSTGRES_IMG: "${{ matrix.postgres_img }}"
|
625 | 657 | E2E_PRE_ROLLING_UPDATE_IMG: "${{ matrix.postgres_pre_img }}"
|
@@ -738,14 +770,15 @@ jobs:
|
738 | 770 | needs:
|
739 | 771 | - generate-jobs
|
740 | 772 | - duplicate_runs
|
| 773 | + - evaluate-test-level |
741 | 774 | strategy:
|
742 | 775 | fail-fast: false
|
743 | 776 | max-parallel: 10
|
744 | 777 | matrix:
|
745 | 778 | ${{ fromJSON(needs.generate-jobs.outputs.gkeMatrix) }}
|
746 | 779 | runs-on: ubuntu-20.04
|
747 | 780 | env:
|
748 |
| - TEST_DEPTH: 4 |
| 781 | + TEST_DEPTH: ${{ needs.evaluate-test-level.outputs.testLevel }} |
749 | 782 | K8S_VERSION: "${{ matrix.k8s_version }}"
|
750 | 783 | POSTGRES_IMG: "${{ matrix.postgres_img }}"
|
751 | 784 | E2E_PRE_ROLLING_UPDATE_IMG: "${{ matrix.postgres_pre_img }}"
|
@@ -873,13 +906,14 @@ jobs:
|
873 | 906 | needs:
|
874 | 907 | - generate-jobs
|
875 | 908 | - duplicate_runs
|
| 909 | + - evaluate-test-level |
876 | 910 | strategy:
|
877 | 911 | fail-fast: false
|
878 | 912 | matrix:
|
879 | 913 | ${{ fromJSON(needs.generate-jobs.outputs.rkeMatrix) }}
|
880 | 914 | runs-on: ubuntu-20.04
|
881 | 915 | env:
|
882 |
| - TEST_DEPTH: 4 |
| 916 | + TEST_DEPTH: ${{ needs.evaluate-test-level.outputs.testLevel }} |
883 | 917 | POSTGRES_IMG: "${{ matrix.postgres_img }}"
|
884 | 918 | E2E_PRE_ROLLING_UPDATE_IMG: "${{ matrix.postgres_pre_img }}"
|
885 | 919 |
|
|
0 commit comments