Skip to content

Commit e6fe1f2

Browse files
authored
Merge pull request #919 from consideRatio/pr/isolate-bootstraptests-to-a-dedicated-job
test refactor: put bootstrap tests in an isolated job, save ~3 min in each of the integration test jobs
2 parents 33643ba + 0c914af commit e6fe1f2

File tree

1 file changed

+42
-22
lines changed

1 file changed

+42
-22
lines changed

.github/workflows/integration-test.yaml

Lines changed: 42 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ jobs:
3535
include:
3636
- name: "Debian 11, Py 3.9"
3737
distro_image: "debian:11"
38-
runs_on: "ubuntu-22.04"
3938
extra_flags: ""
4039
- name: "Ubuntu 20.04, Py 3.8"
4140
distro_image: "ubuntu:20.04"
@@ -59,27 +58,6 @@ jobs:
5958
with:
6059
python-version: "3.10"
6160

62-
# FIXME: The test_bootstrap.py script has duplicated logic to run build
63-
# and start images and run things in them. This makes tests slower,
64-
# and adds code to maintain. Let's try to remove it.
65-
#
66-
# - bootstrap.py's failure detections, put in unit tests?
67-
# - bootstrap.py's --show-progress-page test, include as integration test?
68-
#
69-
- name: Install integration-tests/requirements.txt for test_bootstrap.py
70-
run: pip install -r integration-tests/requirements.txt
71-
72-
- name: Run bootstrap tests (Runs in/Builds ${{ matrix.distro_image }} derived image)
73-
run: |
74-
pytest integration-tests/test_bootstrap.py
75-
timeout-minutes: 10
76-
env:
77-
# integration-tests/test_bootstrap.py will build and start containers
78-
# based on this environment variable. This is similar to how
79-
# .github/integration-test.py build-image can take a --build-arg
80-
# setting the base image via a Dockerfile ARG.
81-
BASE_IMAGE: ${{ matrix.distro_image }}
82-
8361
- name: Build systemd image, derived from ${{ matrix.distro_image }}
8462
run: |
8563
.github/integration-test.py build-image \
@@ -122,3 +100,45 @@ jobs:
122100
if: always() && steps.integration-tests.outcome != 'skipped'
123101
run: |
124102
.github/integration-test.py show-logs integration-tests
103+
104+
integration-tests-bootstrap:
105+
# integration tests run in a container,
106+
# not in the worker, so this version is not relevant to the tests
107+
# and can be the same for all tested versions
108+
runs-on: ubuntu-22.04
109+
110+
name: ${{ matrix.name }}
111+
strategy:
112+
fail-fast: false
113+
matrix:
114+
include:
115+
- name: "Ubuntu 22.04 Py 3.10 (test_bootstrap.py)"
116+
distro_image: "ubuntu:22.04"
117+
118+
steps:
119+
- uses: actions/checkout@v3
120+
- uses: actions/setup-python@v4
121+
with:
122+
python-version: "3.10"
123+
124+
# FIXME: The test_bootstrap.py script has duplicated logic to run build
125+
# and start images and run things in them. This makes tests slower,
126+
# and adds code to maintain. Let's try to remove it.
127+
#
128+
# - bootstrap.py's failure detections, put in unit tests?
129+
# - bootstrap.py's --show-progress-page test, include as a normal
130+
# integration test?
131+
#
132+
- name: Install integration-tests/requirements.txt for test_bootstrap.py
133+
run: pip install -r integration-tests/requirements.txt
134+
135+
- name: Run bootstrap tests (Runs in/Builds ${{ matrix.distro_image }} derived image)
136+
run: |
137+
pytest integration-tests/test_bootstrap.py
138+
timeout-minutes: 10
139+
env:
140+
# integration-tests/test_bootstrap.py will build and start containers
141+
# based on this environment variable. This is similar to how
142+
# .github/integration-test.py build-image can take a --build-arg
143+
# setting the base image via a Dockerfile ARG.
144+
BASE_IMAGE: ${{ matrix.distro_image }}

0 commit comments

Comments
 (0)