|
7 | 7 | - cron: "34 23 * * *" |
8 | 8 |
|
9 | 9 | jobs: |
10 | | - e2e-tests: |
| 10 | + nightly-tests: |
11 | 11 | runs-on: ubuntu-latest |
12 | 12 | strategy: |
13 | 13 | fail-fast: false |
|
16 | 16 | - main |
17 | 17 | - release-1.6 |
18 | 18 | - release-1.5 |
19 | | - name: 'E2E Tests on ${{ matrix.branch }}' |
| 19 | + name: 'Nightly Tests on ${{ matrix.branch }}' |
20 | 20 | concurrency: |
21 | 21 | group: '${{ github.workflow }}-${{ matrix.branch }}' |
22 | 22 | cancel-in-progress: true |
@@ -111,13 +111,53 @@ jobs: |
111 | 111 | env: |
112 | 112 | LATEST_COMMIT_SHA: ${{ github.sha }} |
113 | 113 |
|
114 | | - - name: Run SeaLights scan for e2e tests |
| 114 | + - name: Run SeaLights scan for tests |
115 | 115 | if: ${{ steps.operator-image-existence-checker.outputs.OPERATOR_IMAGE_EXISTS == 'true' }} |
116 | 116 | run: | |
117 | | - echo "[SeaLights] Running the SeaLights e2e tests scan" |
| 117 | + echo "[SeaLights] Running the SeaLights scan" |
118 | 118 | ./slcli scan --bsid buildSessionId.txt --path-to-scanner ./slgoagent --workspacepath "./" --scm git --scmBaseUrl https://github.com/redhat-developer/rhdh-operator --scmProvider github |
119 | | - env: |
120 | | - SEALIGHTS_TEST_STAGE: "E2E Tests Nightly" |
| 119 | +
|
| 120 | + # gosec needs a "build" stage so connect it to the lint step which we always do |
| 121 | + - name: Build |
| 122 | + if: ${{ steps.operator-image-existence-checker.outputs.OPERATOR_IMAGE_EXISTS == 'true' }} |
| 123 | + run: make lint |
| 124 | + |
| 125 | + - name: Run Controller |
| 126 | + if: ${{ steps.operator-image-existence-checker.outputs.OPERATOR_IMAGE_EXISTS == 'true' }} |
| 127 | + # run this stage only if there are changes that match the includes and not the excludes |
| 128 | + run: | |
| 129 | + # Need to 'make install' first, so that the necessary tool binaries (like controller-gen) can be downloaded locally. |
| 130 | + # Otherwise, we might end up with a race condition where the tool binary is not yet downloaded, |
| 131 | + # but the `make test` command tries to use it. |
| 132 | + make manifests generate fmt vet install |
| 133 | + make run & |
| 134 | +
|
| 135 | + - name: Create a Unit Tests session |
| 136 | + if: ${{ steps.operator-image-existence-checker.outputs.OPERATOR_IMAGE_EXISTS == 'true' }} |
| 137 | + run: ./slcli test start-stage --bsid=buildSessionId.txt --testStage "Unit Tests" |
| 138 | + |
| 139 | + - name: Test |
| 140 | + if: ${{ steps.operator-image-existence-checker.outputs.OPERATOR_IMAGE_EXISTS == 'true' }} |
| 141 | + # run this stage only if there are changes that match the includes and not the excludes |
| 142 | + run: make test |
| 143 | + |
| 144 | + - name: Create a Integration Tests session |
| 145 | + if: ${{ steps.operator-image-existence-checker.outputs.OPERATOR_IMAGE_EXISTS == 'true' }} |
| 146 | + run: | |
| 147 | + ./slcli test end-stage --bsid=buildSessionId.txt --executionId "Unit Tests" |
| 148 | + ./slcli test start-stage --bsid=buildSessionId.txt --testStage "Integration Tests" |
| 149 | +
|
| 150 | + - name: Generic Integration test |
| 151 | + if: ${{ steps.operator-image-existence-checker.outputs.OPERATOR_IMAGE_EXISTS == 'true' }} |
| 152 | + # run this stage only if there are changes that match the includes and not the excludes |
| 153 | + # perform it on backstage.io for speed |
| 154 | + run: make integration-test PROFILE=backstage.io USE_EXISTING_CLUSTER=true USE_EXISTING_CONTROLLER=true |
| 155 | + |
| 156 | + - name: Create a E2E Tests session |
| 157 | + if: ${{ steps.operator-image-existence-checker.outputs.OPERATOR_IMAGE_EXISTS == 'true' }} |
| 158 | + run: | |
| 159 | + ./slcli test end-stage --bsid=buildSessionId.txt --executionId "Integration Tests" |
| 160 | + ./slcli test start-stage --bsid=buildSessionId.txt --testStage "E2E Tests" |
121 | 161 |
|
122 | 162 | - name: Run E2E tests |
123 | 163 | if: ${{ steps.operator-image-existence-checker.outputs.OPERATOR_IMAGE_EXISTS == 'true' }} |
|
0 commit comments