diff --git a/.github/workflows/.coveragerc_db b/.github/workflows/.coveragerc_db new file mode 100644 index 000000000..410ae2191 --- /dev/null +++ b/.github/workflows/.coveragerc_db @@ -0,0 +1,8 @@ +[run] +omit = feathr_project/feathr/registry/_feature_registry_purview.py + feathr_project/feathr/spark_provider/_synapse_submission.py + feathr_project/feathr/spark_provider/_localspark_submission.py +[report] +exclude_lines = + pragma: no cover + @abstract \ No newline at end of file diff --git a/.github/workflows/.coveragerc_local b/.github/workflows/.coveragerc_local new file mode 100644 index 000000000..0f517b928 --- /dev/null +++ b/.github/workflows/.coveragerc_local @@ -0,0 +1,8 @@ +[run] +omit = feathr_project/feathr/registry/_feature_registry_purview.py + feathr_project/feathr/spark_provider/_databricks_submission.py + feathr_project/feathr/spark_provider/_synapse_submission.py +[report] +exclude_lines = + pragma: no cover + @abstract \ No newline at end of file diff --git a/.github/workflows/.coveragerc_sy b/.github/workflows/.coveragerc_sy new file mode 100644 index 000000000..f44e27cef --- /dev/null +++ b/.github/workflows/.coveragerc_sy @@ -0,0 +1,8 @@ +[run] +omit = feathr_project/feathr/registry/_feature_registry_purview.py + feathr_project/feathr/spark_provider/_databricks_submission.py + feathr_project/feathr/spark_provider/_localspark_submission.py +[report] +exclude_lines = + pragma: no cover + @abstract \ No newline at end of file diff --git a/.github/workflows/pull_request_push_test.yml b/.github/workflows/pull_request_push_test.yml index 0eb0e059b..77667815e 100644 --- a/.github/workflows/pull_request_push_test.yml +++ b/.github/workflows/pull_request_push_test.yml @@ -128,8 +128,7 @@ jobs: SQL1_PASSWORD: ${{secrets.SQL1_PASSWORD}} run: | # run only test with databricks. run in 4 parallel jobs - pytest -n 6 feathr_project/test/ - + pytest -n 6 --cov-report term-missing --cov=feathr_project/feathr feathr_project/test --cov-config=.github/workflows/.coveragerc_db azure_synapse_test: # might be a bit duplication to setup both the azure_synapse test and databricks test, but for now we will keep those to accelerate the test speed runs-on: ubuntu-latest @@ -197,7 +196,7 @@ jobs: run: | # skip databricks related test as we just ran the test; also seperate databricks and synapse test to make sure there's no write conflict # run in 4 parallel jobs to make the time shorter - pytest -n 6 feathr_project/test/ + pytest -n 6 --cov-report term-missing --cov=feathr_project/feathr feathr_project/test --cov-config=.github/workflows/.coveragerc_sy local_spark_test: runs-on: ubuntu-latest @@ -255,7 +254,7 @@ jobs: SQL1_PASSWORD: ${{secrets.SQL1_PASSWORD}} run: | # skip cloud related tests - pytest feathr_project/test/test_local_spark_e2e.py + pytest --cov-report term-missing --cov=feathr_project/feathr/spark_provider feathr_project/test/test_local_spark_e2e.py --cov-config=.github/workflows/.coveragerc_local failure_notification: # If any failure, warning message will be sent diff --git a/feathr_project/setup.py b/feathr_project/setup.py index 69a99351f..e11eb3b10 100644 --- a/feathr_project/setup.py +++ b/feathr_project/setup.py @@ -22,6 +22,7 @@ "black>=22.1.0", # formatter "isort", # sort import statements "pytest>=7", + "pytest-cov", "pytest-xdist", "pytest-mock>=3.8.1", ],