From 3f5153efdb7369d35d72cb720d3302581525d9af Mon Sep 17 00:00:00 2001 From: Chen Bainian Date: Tue, 16 Jun 2020 16:40:59 +0800 Subject: [PATCH] Use coveragerc for files ignore Signed-off-by: Chen Bainian --- industrial_ci/src/tests/source_tests.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/industrial_ci/src/tests/source_tests.sh b/industrial_ci/src/tests/source_tests.sh index ffd2edb29..588619a04 100644 --- a/industrial_ci/src/tests/source_tests.sh +++ b/industrial_ci/src/tests/source_tests.sh @@ -143,8 +143,9 @@ function ici_combine_python_reports { # Combine coverage files python3 -m coverage combine # Generate report - python3 -m coverage report --omit=*/test/*,*/setup.py,*/__init__.py - python3 -m coverage xml --omit=*/test/*,*/setup.py,*/__init__.py + printf "[report]\nomit = \n\t*/test/*\n\t*/setup.py\n\t*/__init__.py" > .default.coveragerc + python3 -m coverage report --rcfile=.default.coveragerc + python3 -m coverage xml --rcfile=.default.coveragerc } function upload_coverage_report { @@ -176,10 +177,10 @@ function upload_coverage_report { cp "$python_report" ./ || echo "No python coverage report" ici_install_pkgs_for_command pip python3-pip python3-dev python3-wheel ici_install_pkgs_for_command gem ruby - python3 -m pip install coveralls coveralls-merge + python3 -m pip install coveralls gem install coveralls-lcov coveralls-lcov -v -n "$target_ws/coverage.info" > coverage.c.json - coveralls-merge coverage.c.json + coveralls --merge=coverage.c.json --rcfile="$target_ws"/.default.coveragerc esac cd "$target_ws" || return 1 }