From e53cff101db73e056fdd2c936d1a59c786e12c30 Mon Sep 17 00:00:00 2001 From: "Li-Huai (Allan) Lin" Date: Sun, 31 Dec 2023 13:54:03 -0800 Subject: [PATCH] Rerun failing tests (#16) --- .github/workflows/CI.yml | 2 +- .github/workflows/Deploy.yml | 2 +- .github/workflows/Status.yml | 2 +- requirements_test.txt | 3 ++- setup.py | 1 + 5 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index e63f88c..65c9009 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -36,6 +36,6 @@ jobs: TEST_DEVICE_AC: ${{ secrets.TEST_DEVICE_AC }} TEST_DEVICE_DH: ${{ secrets.TEST_DEVICE_DH }} run: | - python -m pytest ./tests --cov=./JciHitachi --cov-report xml + python -m pytest ./tests --cov=./JciHitachi --cov-report xml --reruns 2 - name: Upload coverage reports to Codecov with GitHub Action uses: codecov/codecov-action@v2 \ No newline at end of file diff --git a/.github/workflows/Deploy.yml b/.github/workflows/Deploy.yml index 5485578..72f9ff7 100644 --- a/.github/workflows/Deploy.yml +++ b/.github/workflows/Deploy.yml @@ -27,7 +27,7 @@ jobs: TEST_DEVICE_AC: ${{ secrets.TEST_DEVICE_AC }} TEST_DEVICE_DH: ${{ secrets.TEST_DEVICE_DH }} run: | - python -m pytest ./tests + python -m pytest --reruns 2 ./tests deploy: needs: pytest environment: Deploy diff --git a/.github/workflows/Status.yml b/.github/workflows/Status.yml index ceba4fe..660f3ca 100644 --- a/.github/workflows/Status.yml +++ b/.github/workflows/Status.yml @@ -26,4 +26,4 @@ jobs: TEST_DEVICE_AC: ${{ secrets.TEST_DEVICE_AC }} TEST_DEVICE_DH: ${{ secrets.TEST_DEVICE_DH }} run: | - python -m pytest tests/test_integration.py::TestAWSAPILogin::test_api \ No newline at end of file + python -m pytest --reruns 2 tests/test_integration.py::TestAWSAPILogin::test_api \ No newline at end of file diff --git a/requirements_test.txt b/requirements_test.txt index 79144c0..3407ed9 100644 --- a/requirements_test.txt +++ b/requirements_test.txt @@ -1,3 +1,4 @@ pre-commit pytest>=6.2 -pytest-cov \ No newline at end of file +pytest-cov +pytest-rerunfailures \ No newline at end of file diff --git a/setup.py b/setup.py index 717e3ab..1990130 100644 --- a/setup.py +++ b/setup.py @@ -14,6 +14,7 @@ "pre-commit", "pytest>=6.2", "pytest-cov", + "pytest-rerunfailures", ]