From 2b9781a807896ff7f1290bbb011403087d26c280 Mon Sep 17 00:00:00 2001 From: Petro Tiurin <93913847+ptiurin@users.noreply.github.com> Date: Sun, 23 Apr 2023 18:50:19 +0100 Subject: [PATCH 1/2] Update unit-tests.yml --- .github/workflows/unit-tests.yml | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index e65fc7fb265..1d59762ed5e 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -36,11 +36,39 @@ jobs: run: | python -m pip install --upgrade pip pip install -e ".[dev]" + pip install allure-pytest - name: Run unit tests run: | - pytest --cov=src/ tests/unit --cov-report=xml + pytest --cov=src/ tests/unit --cov-report=xml --alluredir=allure-results + - name: Get Allure history + uses: actions/checkout@v2 + if: always() + continue-on-error: true + with: + ref: gh-pages + path: gh-pages + + - name: Allure Report action from marketplace + uses: simple-elf/allure-report-action@master + if: always() + #id: allure-report + with: + allure_results: allure-results + #gh_pages: gh-pages + #allure_report: allure-report + allure_history: allure-history + keep_reports: 20 + + - name: Deploy report to Github Pages + if: always() + uses: peaceiris/actions-gh-pages@v2 + env: + PERSONAL_TOKEN: ${{ secrets.GITHUB_TOKEN }} + PUBLISH_BRANCH: gh-pages + PUBLISH_DIR: allure-history + - name: Upload coverage report uses: actions/upload-artifact@v2 with: From 16d348f03a954aaf2674c576e78e0925205ae766 Mon Sep 17 00:00:00 2001 From: Petro Tiurin <93913847+ptiurin@users.noreply.github.com> Date: Sun, 23 Apr 2023 19:03:39 +0100 Subject: [PATCH 2/2] Allure integration --- .github/workflows/integration-tests.yml | 18 ++++++++++++++++-- .github/workflows/unit-tests.yml | 20 +++----------------- setup.cfg | 1 + tests/unit/conftest.py | 2 +- 4 files changed, 21 insertions(+), 20 deletions(-) diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index b9ae7f712c7..f1d667be11a 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -58,5 +58,19 @@ jobs: API_ENDPOINT: "api.dev.firebolt.io" ACCOUNT_NAME: "firebolt" run: | - pytest -n 6 --dist loadgroup --timeout_method "signal" -o log_cli=true -o log_cli_level=INFO tests/integration - + pytest -n 6 --dist loadgroup --timeout_method "signal" -o log_cli=true -o log_cli_level=INFO tests/integration --alluredir=allure-results + + - name: Get Allure history + uses: actions/checkout@v2 + if: always() + continue-on-error: true + with: + ref: gh-pages + path: gh-pages + + - name: Allure Report + uses: firebolt-db/action-allure-report@v1 + if: always() + with: + github-key: ${{ secrets.GITHUB_TOKEN }} + test-type: integration diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index 1d59762ed5e..00868668f2f 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -36,7 +36,6 @@ jobs: run: | python -m pip install --upgrade pip pip install -e ".[dev]" - pip install allure-pytest - name: Run unit tests run: | @@ -50,25 +49,12 @@ jobs: ref: gh-pages path: gh-pages - - name: Allure Report action from marketplace - uses: simple-elf/allure-report-action@master + - name: Allure Report + uses: firebolt-db/action-allure-report@v1 if: always() - #id: allure-report with: - allure_results: allure-results - #gh_pages: gh-pages - #allure_report: allure-report - allure_history: allure-history - keep_reports: 20 + github-key: ${{ secrets.GITHUB_TOKEN }} - - name: Deploy report to Github Pages - if: always() - uses: peaceiris/actions-gh-pages@v2 - env: - PERSONAL_TOKEN: ${{ secrets.GITHUB_TOKEN }} - PUBLISH_BRANCH: gh-pages - PUBLISH_DIR: allure-history - - name: Upload coverage report uses: actions/upload-artifact@v2 with: diff --git a/setup.cfg b/setup.cfg index 44b13c7f60f..345a27b063c 100755 --- a/setup.cfg +++ b/setup.cfg @@ -45,6 +45,7 @@ where = src ciso8601 = ciso8601==2.2.0 dev = + allure-pytest==2.* devtools==0.7.0 mypy==0.910 pre-commit==2.15.0 diff --git a/tests/unit/conftest.py b/tests/unit/conftest.py index 7828e349c3c..59d81163ff5 100644 --- a/tests/unit/conftest.py +++ b/tests/unit/conftest.py @@ -48,7 +48,7 @@ def global_fake_fs(request) -> None: if "nofakefs" in request.keywords: yield else: - with Patcher(): + with Patcher(additional_skip_names=["logger", "allure-pytest"]): yield