Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Pytest] Generate HTML report for test results and disable warnings #3874

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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