From 1d6ac291455948589a0c6cc571f3ed6b680574f8 Mon Sep 17 00:00:00 2001 From: Erik Sundell Date: Mon, 18 Oct 2021 19:47:48 +0200 Subject: [PATCH] ci: add notes about pytest --maxfail=2 choice --- .github/integration-test.py | 3 +++ .github/workflows/integration-test.yaml | 3 +++ .github/workflows/unit-test.yaml | 3 +++ 3 files changed, 9 insertions(+) diff --git a/.github/integration-test.py b/.github/integration-test.py index e473d97..67b8a9d 100755 --- a/.github/integration-test.py +++ b/.github/integration-test.py @@ -120,6 +120,9 @@ def run_test(image_name, test_name, bootstrap_pip_spec, test_files, upgrade, ins ) run_container_command( test_name, + # We abort pytest after two failures as a compromise between wanting to + # avoid a flood of logs while still understanding if multiple tests + # would fail. '/opt/tljh/hub/bin/python3 -m pytest --verbose --maxfail=2 --color=yes --durations=10 --capture=no {}'.format( ' '.join([os.path.join('/srv/src/integration-tests/', f) for f in test_files]) ) diff --git a/.github/workflows/integration-test.yaml b/.github/workflows/integration-test.yaml index d686221..31c6998 100644 --- a/.github/workflows/integration-test.yaml +++ b/.github/workflows/integration-test.yaml @@ -115,6 +115,9 @@ jobs: - name: Install pytest run: python3 -m pip install pytest + # We abort pytest after two failures as a compromise between wanting to + # avoid a flood of logs while still understanding if multiple tests would + # fail. - name: Run bootstrap tests run: | pytest --verbose --maxfail=2 --color=yes --durations=10 --capture=no \ diff --git a/.github/workflows/unit-test.yaml b/.github/workflows/unit-test.yaml index 31ed95c..2c44b15 100644 --- a/.github/workflows/unit-test.yaml +++ b/.github/workflows/unit-test.yaml @@ -92,6 +92,9 @@ jobs: python3 -m pip install -e . pip freeze + # We abort pytest after two failures as a compromise between wanting to + # avoid a flood of logs while still understanding if multiple tests would + # fail. - name: Run unit tests run: pytest --verbose --maxfail=2 --color=yes --durations=10 --cov=tljh tests/ timeout-minutes: 15