From 95bcd9efe6131b6ed60ca33c96fb257bea276fe3 Mon Sep 17 00:00:00 2001 From: Aniq <2aniqqjavedd4493@gmail.com> Date: Tue, 5 Sep 2023 11:43:29 +0200 Subject: [PATCH 1/4] Exclude directories from coverage --- .github/workflows/root-ci-config/build_root.py | 3 +-- .github/workflows/test-coverage.yml | 13 ++++--------- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/.github/workflows/root-ci-config/build_root.py b/.github/workflows/root-ci-config/build_root.py index e5a49eeef9453..a97107b1c6000 100755 --- a/.github/workflows/root-ci-config/build_root.py +++ b/.github/workflows/root-ci-config/build_root.py @@ -372,12 +372,11 @@ def rebase(base_ref, head_ref) -> None: def create_coverage_xml() -> None: result = subprocess_with_log(f""" cd '{WORKDIR}/build' - gcovr --cobertura-pretty --gcov-ignore-errors=no_working_dir_found --merge-mode-functions=merge-use-line-min -r ../src ../build -o cobertura-cov.xml + gcovr --output=cobertura-cov.xml --cobertura-pretty --gcov-ignore-errors=no_working_dir_found --merge-mode-functions=merge-use-line-min --exclude-unreachable-branches --exclude-directories="roottest|runtutorials|interpreter" --exclude='.*/G__.*' --exclude='.*/(roottest|runtutorials|externals|ginclude|googletest-prefix|macosx|winnt|geombuilder|cocoa|quartz|win32gdk|x11|x11ttf|eve|fitpanel|ged|gui|guibuilder|guihtml|qtgsi|qtroot|recorder|sessionviewer|tmvagui|treeviewer|geocad|fitsio|gviz|qt|gviz3d|x3d|spectrum|spectrumpainter|dcache|hdfs|foam|genetic|mlp|quadp|splot|memstat|rpdutils|proof|odbc|llvm|test|interpreter)/.*' --gcov-exclude='.*_ACLiC_dict[.].*' '--exclude=.*_ACLiC_dict[.].*' -v -r ../src ../build """) if result != 0: die(result, "Failed to create test coverage") - if __name__ == "__main__": main() diff --git a/.github/workflows/test-coverage.yml b/.github/workflows/test-coverage.yml index 2b63dadefc983..a27be5d093800 100644 --- a/.github/workflows/test-coverage.yml +++ b/.github/workflows/test-coverage.yml @@ -6,13 +6,6 @@ on: - cron: '0 1 * * *' # https://github.com/root-project/root/pull/12112#issuecomment-1411004278 - # DISABLED: takes 4 hours! Might clang-coverage be a solution? - #pull_request: - # branches: - # - 'master' - # paths-ignore: - # - 'doc/**' - # - 'documentation/**' workflow_call: inputs: @@ -43,7 +36,7 @@ env: PYTHONUNBUFFERED: true jobs: - + build-linux: if: github.repository_owner == 'root-project' || github.event_name == 'pull_request' @@ -84,7 +77,6 @@ jobs: ls -la ' - - name: Apply option override from matrix for this job env: OVERRIDE: "coverage=On" @@ -123,6 +115,8 @@ jobs: --repository ${{ github.server_url }}/${{ github.repository }} " + + - name: Nightly build if: github.event_name == 'schedule' run: ".github/workflows/root-ci-config/build_root.py @@ -144,3 +138,4 @@ jobs: flags: unittests name: codecov-umbrella verbose: true + \ No newline at end of file From f676a0401dc50c315e3f50fd2e0ef3de9b5db18d Mon Sep 17 00:00:00 2001 From: Aniq <2aniqqjavedd4493@gmail.com> Date: Tue, 5 Sep 2023 22:25:55 +0200 Subject: [PATCH 2/4] Make proposed changes to PR --- .github/workflows/test-coverage.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/test-coverage.yml b/.github/workflows/test-coverage.yml index a27be5d093800..2fc9ea3cc520c 100644 --- a/.github/workflows/test-coverage.yml +++ b/.github/workflows/test-coverage.yml @@ -76,7 +76,7 @@ jobs: run: 'printf "%s@%s\\n" "$(whoami)" "$(hostname)"; ls -la ' - + - name: Apply option override from matrix for this job env: OVERRIDE: "coverage=On" @@ -115,8 +115,6 @@ jobs: --repository ${{ github.server_url }}/${{ github.repository }} " - - - name: Nightly build if: github.event_name == 'schedule' run: ".github/workflows/root-ci-config/build_root.py @@ -138,4 +136,3 @@ jobs: flags: unittests name: codecov-umbrella verbose: true - \ No newline at end of file From de56c64b4f43b91230d1881288d27d52ccfd2334 Mon Sep 17 00:00:00 2001 From: Aniq <2aniqqjavedd4493@gmail.com> Date: Tue, 5 Sep 2023 22:35:05 +0200 Subject: [PATCH 3/4] Make proposed changes to PR --- .github/workflows/root-ci-config/build_root.py | 3 ++- .github/workflows/test-coverage.yml | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/root-ci-config/build_root.py b/.github/workflows/root-ci-config/build_root.py index a97107b1c6000..39d0f10165c7c 100755 --- a/.github/workflows/root-ci-config/build_root.py +++ b/.github/workflows/root-ci-config/build_root.py @@ -378,5 +378,6 @@ def create_coverage_xml() -> None: if result != 0: die(result, "Failed to create test coverage") + if __name__ == "__main__": - main() + main() \ No newline at end of file diff --git a/.github/workflows/test-coverage.yml b/.github/workflows/test-coverage.yml index 2fc9ea3cc520c..4b34be7fa950e 100644 --- a/.github/workflows/test-coverage.yml +++ b/.github/workflows/test-coverage.yml @@ -6,6 +6,13 @@ on: - cron: '0 1 * * *' # https://github.com/root-project/root/pull/12112#issuecomment-1411004278 + # DISABLED: takes 4 hours! Might clang-coverage be a solution? + #pull_request: + # branches: + # - 'master' + # paths-ignore: + # - 'doc/**' + # - 'documentation/**' workflow_call: inputs: From 6bd3909fdd6441e386e18ee745c02f55855af861 Mon Sep 17 00:00:00 2001 From: Aniq <2aniqqjavedd4493@gmail.com> Date: Wed, 6 Sep 2023 10:56:07 +0200 Subject: [PATCH 4/4] Make proposed changes to PR --- .github/workflows/root-ci-config/build_root.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/root-ci-config/build_root.py b/.github/workflows/root-ci-config/build_root.py index 39d0f10165c7c..4725b5a77134a 100755 --- a/.github/workflows/root-ci-config/build_root.py +++ b/.github/workflows/root-ci-config/build_root.py @@ -380,4 +380,4 @@ def create_coverage_xml() -> None: if __name__ == "__main__": - main() \ No newline at end of file + main()