From 4a8308b0db743d8e3dcae9ef6c287ac82792f92f Mon Sep 17 00:00:00 2001 From: Erik Sundell Date: Wed, 20 Oct 2021 11:20:19 +0200 Subject: [PATCH] ci: ensure all tests adjust based on matrix.ubuntu_version --- .github/workflows/integration-test.yaml | 6 ++++++ integration-tests/test_bootstrap.py | 10 ++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/.github/workflows/integration-test.yaml b/.github/workflows/integration-test.yaml index 31c6998..1ff5591 100644 --- a/.github/workflows/integration-test.yaml +++ b/.github/workflows/integration-test.yaml @@ -123,6 +123,12 @@ jobs: pytest --verbose --maxfail=2 --color=yes --durations=10 --capture=no \ integration-tests/test_bootstrap.py timeout-minutes: 15 + env: + # integration-tests/test_bootstrap.py will build and start containers + # based on this environment variable. This is similar to how + # .github/integration-test.py build-image can take a --build-arg + # setting the ubuntu_version. + UBUNTU_VERSION: ${{ matrix.ubuntu_version }} - name: Run basic tests run: | diff --git a/integration-tests/test_bootstrap.py b/integration-tests/test_bootstrap.py index 76d02a4..8af4329 100644 --- a/integration-tests/test_bootstrap.py +++ b/integration-tests/test_bootstrap.py @@ -117,7 +117,10 @@ def test_ubuntu_too_old(): def test_inside_no_systemd_docker(): - output = run_bootstrap_after_preparing_container("plain-docker-test", "ubuntu:18.04") + output = run_bootstrap_after_preparing_container( + "plain-docker-test", + f"ubuntu:{os.getenv('UBUNTU_VERSION', '20.04')}", + ) assert "Systemd is required to run TLJH" in output.stdout assert output.returncode == 1 @@ -150,7 +153,10 @@ def verify_progress_page(expected_status_code, timeout): def test_progress_page(): with concurrent.futures.ThreadPoolExecutor() as executor: installer = executor.submit( - run_bootstrap_after_preparing_container, "progress-page", "ubuntu:18.04", True + run_bootstrap_after_preparing_container, + "progress-page", + f"ubuntu:{os.getenv('UBUNTU_VERSION', '20.04')}", + True ) # Check if progress page started