Skip to content

Commit

Permalink
[Pytest] Generate HTML report for test results and disable warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
agl29 committed Oct 24, 2024
1 parent 16c940e commit 1b16e2e
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
9 changes: 8 additions & 1 deletion .github/workflows/commitflow-py3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,14 @@ jobs:
- name: run tests
run: |
PYTHONWARNINGS=always ./build/env/bin/pytest
mkdir -p test-reports # Ensure the directory exists
PYTHONWARNINGS=always ./build/env/bin/pytest --html=test-reports/report_${{ matrix.python-version }}.html --self-contained-html
- name: upload pytest report
uses: actions/upload-artifact@v4
with:
name: test-reports-${{ matrix.python-version }}
path: test-reports

- name: run python lints
run: |
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ desktop/desktop-test.db
ext/hadoop/
ext/hive/
ext/oozie/
nosetests.xml
report.html
oozie.sql
tools/jenkins/ext/
tools/jenkins/oozie.sql
Expand Down
1 change: 1 addition & 0 deletions desktop/core/base_requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ py==1.11.0
pyformance==0.3.2
pytest==8.1.1
pytest-django==4.8.0
pytest-html==4.1.1
python-dateutil==2.8.2
python-daemon==2.2.4
python-ldap==3.4.3
Expand Down
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[tool.pytest.ini_options]
DJANGO_SETTINGS_MODULE = "desktop.settings"
addopts = "-v -m 'not integration' --strict-markers --durations=10"
console_output_style = "count"
addopts = "-v -m 'not integration' --strict-markers --disable-warnings --html=report.html --self-contained-html"
norecursedirs = "desktop/core/ext-py3"
python_files = "tests.py test_*.py *_tests.py tests_* *_test.py"
markers = [
Expand Down

0 comments on commit 1b16e2e

Please sign in to comment.