Skip to content

Commit

Permalink
[ci] Add code coverage report generation to CI workflow (#4010)
Browse files Browse the repository at this point in the history
- To get an idea of initial unfiltered numbers and see the flow for coverage and pytest and what format it supports both on local setup and Github Action.
- Then we can plan the next steps to refine the numbers and improve code coverage reporting in Hue.
  • Loading branch information
Harshg999 authored Feb 21, 2025
1 parent 761e139 commit e59265a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
9 changes: 8 additions & 1 deletion .github/workflows/commitflow-py3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,20 @@ jobs:
- name: run tests
run: |
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
mkdir -p code-coverage-reports # Ensure the directory exists
./build/env/bin/pytest --cov=about --cov=beeswax --cov=filebrowser --cov=hbase --cov=help --cov=hive --cov=impala --cov=jobbrowser --cov=jobsub --cov=metastore --cov=oozie --cov=pig --cov=proxy --cov=rdbms --cov=search --cov=security --cov=spark --cov=sqoop --cov=useradmin --cov=zookeeper --cov=desktop --cov=aws --cov=azure --cov=dashboard --cov=hadoop --cov=indexer --cov=kafka --cov=libanalyze --cov=liboauth --cov=liboozie --cov=librdbms --cov=libsaml --cov=libsentry --cov=libsolr --cov=libzookeeper --cov=metadata --cov=notebook --cov-report=html:code-coverage-report --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: upload code coverage report
uses: actions/upload-artifact@v4
with:
name: code-coverage-report-${{ matrix.python-version }}
path: code-coverage-report

- name: Check and comment if no unit test files are modified
if: matrix.python-version == '3.11'
Expand Down
4 changes: 3 additions & 1 deletion desktop/core/test_requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
pytest==8.1.1
pytest-django==4.8.0
pytest-html==4.1.1
pytest-html==4.1.1
coverage==7.5.4
pytest-cov==5.0.0

0 comments on commit e59265a

Please sign in to comment.