Repository navigation
90 lines (77 loc) · 3.14 KB
/
Copy pathintegration-tests.yml
File metadata and controls
90 lines (77 loc) · 3.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
name: Integration Tests
# Docker-based CDA integration tests (integration-tests/). The `cda_stack`
# fixture in integration-tests/conftest.py brings up db + data-api with
# docker compose and seeds them with cda-etl, so this job only has to run the
# Gradle task. It is slow (Oracle image pull, ~12 min ETL reseed, calculations),
# so it runs on demand and on pull requests that touch the code or seed data
# it exercises, not on every push.
on:
workflow_dispatch:
pull_request:
paths:
- "integration-tests/**"
- "regi-headless/**"
- "gradle/**"
- "build.gradle"
- "settings.gradle"
- "buildSrc/**"
- ".github/workflows/integration-tests.yml"
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
integration-tests:
name: CDA integration tests
runs-on: ubuntu-latest
# Image pull + db start (compose healthcheck allows up to 40 min on a cold
# start) + ETL reseed + the calculation tests.
timeout-minutes: 120
env:
JUNIT_XML: ${{ github.workspace }}/integration-tests/build/integration-junit.xml
# conftest.py writes the db/data-api/etl container logs here just before
# it tears the stack down (afterwards there is nothing left to collect).
CDA_COMPOSE_LOG: ${{ github.workspace }}/integration-tests/build/docker-compose.log
steps:
- name: Checkout repository
uses: actions/checkout@v7
with:
# The git-version plugin derives the wheel version from tags/history.
fetch-depth: 0
# The Oracle "database-ready" image is large; free space on the runner
# before docker pulls it.
- name: Free disk space
run: |
sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc /opt/hostedtoolcache/CodeQL
docker image prune --all --force
df -h /
- name: Set up Java
uses: actions/setup-java@v6
with:
distribution: temurin
java-version: 21
- name: Set up Gradle
uses: gradle/actions/setup-gradle@v6
- name: Make Gradle wrapper executable
run: chmod +x ./gradlew
# integrationTest builds and installs the regi_python wheel and the
# test dependencies into its own venv, then runs `pytest -m integration`.
# A missing prerequisite or a failed docker bring-up is a test error (not a
# skip), so pytest, and therefore this step, fails. PYTEST_ADDOPTS is picked
# up by that pytest and writes the JUnit report that is uploaded below.
- name: Run integration tests
env:
PYTEST_ADDOPTS: "-rs --junitxml=${{ env.JUNIT_XML }}"
run: ./gradlew :integration-tests:integrationTest --stacktrace
- name: Upload test reports and logs
if: always()
uses: actions/upload-artifact@v7
with:
name: integration-test-reports
path: |
integration-tests/build/integration-junit.xml
integration-tests/build/docker-compose.log
integration-tests/regi-projects/regi-python/regi-python.log
if-no-files-found: warn
retention-days: 14