|
| 1 | +# cspell: words janitoring |
| 2 | +name: Cat Gateway integration tests |
| 3 | + |
| 4 | +on: |
| 5 | + workflow_call: |
| 6 | + |
| 7 | +env: |
| 8 | + REPORT_EXT: .junit-report.xml |
| 9 | + COVERAGE_EXT: .coverage.info |
| 10 | + |
| 11 | +jobs: |
| 12 | + tests: |
| 13 | + name: Cat-Gateway integration tests |
| 14 | + runs-on: ubuntu-latest |
| 15 | + steps: |
| 16 | + - uses: actions/checkout@v4 |
| 17 | + |
| 18 | + - name: Free Disk Space (Ubuntu) |
| 19 | + uses: jlumbroso/free-disk-space@main |
| 20 | + with: |
| 21 | + # this might remove tools that are actually needed, |
| 22 | + # if set to "true" but frees about 6 GB |
| 23 | + tool-cache: false |
| 24 | + # all of these default to true, but feel free to set to |
| 25 | + # "false" if necessary for your workflow |
| 26 | + android: true |
| 27 | + dotnet: false |
| 28 | + haskell: false |
| 29 | + large-packages: false |
| 30 | + docker-images: false |
| 31 | + swap-storage: true |
| 32 | + |
| 33 | + - name: Install Forge |
| 34 | + uses: input-output-hk/catalyst-forge/actions/install@ci/v1.10.0 |
| 35 | + with: |
| 36 | + enable_caching: "true" |
| 37 | + version: 0.21.0 |
| 38 | + - name: Setup |
| 39 | + uses: input-output-hk/catalyst-forge/actions/setup@ci/v1.10.0 |
| 40 | + - name: Prepare artifacts |
| 41 | + uses: input-output-hk/catalyst-forge/actions/run@ci/v1.10.0 |
| 42 | + with: |
| 43 | + command: run |
| 44 | + args: ./catalyst-gateway/tests/+prepare-all-images |
| 45 | + |
| 46 | + - name: Rust integration tests |
| 47 | + if: always() |
| 48 | + run: | |
| 49 | + docker compose -f catalyst-gateway/tests/docker-compose.yml up rust-tests-runner --abort-on-container-exit --exit-code-from rust-tests-runner |
| 50 | + docker compose -f catalyst-gateway/tests/docker-compose.yml down |
| 51 | +
|
| 52 | + - name: Schemathesis tests |
| 53 | + if: always() |
| 54 | + run: | |
| 55 | + docker compose -f catalyst-gateway/tests/docker-compose.yml up schemathesis-runner --abort-on-container-exit --exit-code-from schemathesis-runner |
| 56 | + docker cp schemathesis-runner:/results/junit-report.xml ./schemathesis${{ env.REPORT_EXT }} |
| 57 | +
|
| 58 | + - name: Integration API tests |
| 59 | + if: always() |
| 60 | + env: |
| 61 | + API_TEST_MARKS: "preprod_indexing or unmarked" |
| 62 | + run: | |
| 63 | + docker compose -f catalyst-gateway/tests/docker-compose.yml up api-tests-runner --abort-on-container-exit --exit-code-from api-tests-runner |
| 64 | + docker cp api-tests-runner:/poetry/junit-report.xml ./api-tests${{ env.REPORT_EXT }} |
| 65 | + docker cp api-tests-runner:/poetry/coverage.lcov ./api-tests${{ env.COVERAGE_EXT }} |
| 66 | +
|
| 67 | + - name: Integration health tests |
| 68 | + if: always() |
| 69 | + env: |
| 70 | + API_TEST_MARKS: "health_endpoint" |
| 71 | + run: | |
| 72 | + docker compose -f catalyst-gateway/tests/docker-compose.yml up api-tests-runner --abort-on-container-exit --exit-code-from api-tests-runner |
| 73 | +
|
| 74 | +# Skip until bugfix https://github.com/input-output-hk/catalyst-voices/issues/3209 |
| 75 | + - name: Integration health thru proxy tests |
| 76 | + if: false |
| 77 | + env: |
| 78 | + API_TEST_MARKS: "health_with_proxy_endpoint" |
| 79 | + EVENT_DB_URL: "haproxy:18080" |
| 80 | + INDEX_DB_URL: "haproxy:18090" |
| 81 | + run: | |
| 82 | + docker stop cat-gateway || true |
| 83 | + docker compose -f catalyst-gateway/tests/docker-compose.yml up haproxy --detach |
| 84 | + docker compose -f catalyst-gateway/tests/docker-compose.yml up api-tests-runner --abort-on-container-exit --exit-code-from api-tests-runner |
| 85 | +
|
| 86 | + - name: Collect and upload test reports |
| 87 | + uses: actions/upload-artifact@v4 |
| 88 | + if: always() |
| 89 | + with: |
| 90 | + name: test-reports-gateway |
| 91 | + path: "**/*${{ env.REPORT_EXT }}" |
| 92 | + if-no-files-found: error |
| 93 | + retention-days: 1 |
| 94 | + |
| 95 | + - name: Collect and upload test coverage |
| 96 | + uses: actions/upload-artifact@v4 |
| 97 | + if: always() |
| 98 | + with: |
| 99 | + name: coverage-reports-gateway |
| 100 | + path: "**/*${{ env.COVERAGE_EXT }}" |
| 101 | + if-no-files-found: error |
| 102 | + retention-days: 1 |
0 commit comments