From 5ff603e4641dcf91ea7e95837a6f4a51d789726a Mon Sep 17 00:00:00 2001 From: Andrei Zhlobich Date: Tue, 11 May 2021 11:12:50 +0200 Subject: [PATCH] Github actions - Publish pytest html report, annotate fails --- .github/workflows/python-app.yml | 12 +++++++++--- pyproject.toml | 2 +- requirements.txt | 8 ++++++-- 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index fcc2fdfd..2573abac 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -11,7 +11,6 @@ on: jobs: build: - runs-on: ubuntu-latest steps: @@ -20,6 +19,7 @@ jobs: uses: actions/setup-python@v2 with: python-version: 3.7 + - name: Setup github username run: | git config --global user.email "fake@example.com" @@ -38,6 +38,12 @@ jobs: run: | pip install -r requirements.txt - - name: Tests + - name: Run unit tests run: | - pytest + pytest --html=build/test-report.html --self-contained-html + + - name: Upload test report + uses: actions/upload-artifact@v2 + with: + name: test-report + path: build/test-report.html diff --git a/pyproject.toml b/pyproject.toml index 194fa38b..994bb1b0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.pytest.ini_options] minversion = "6.0" -#addopts = "-ra -q" testpaths = [ "test", + "bigflow", ] diff --git a/requirements.txt b/requirements.txt index f37e2824..04e00434 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,9 +4,13 @@ -r requirements/log_extras.txt -r requirements/dataproc_extras.txt -r requirements/dataflow_extras.txt -pytest twine freezegun pexpect responses -bs4 \ No newline at end of file +bs4 + +pytest +pytest-html +pytest-cov +pytest-github-actions-annotate-failures \ No newline at end of file