From adcacdc891aa342f8e9ecace6812c74aaed4ed9d Mon Sep 17 00:00:00 2001 From: awlx Date: Sun, 12 Feb 2023 11:20:46 +0100 Subject: [PATCH 1/5] This fixes bazel coverage There was a change in bazel 6.0 which caused this issue. --- .github/workflows/bazel.yml | 4 ---- requirements.txt | 3 ++- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/bazel.yml b/.github/workflows/bazel.yml index 8ccc140..1a2b66d 100644 --- a/.github/workflows/bazel.yml +++ b/.github/workflows/bazel.yml @@ -17,10 +17,6 @@ jobs: - name: Python coverage run: | sudo apt-get install -y lcov - mkdir "${GITHUB_WORKSPACE}/src" - cd "${GITHUB_WORKSPACE}/src" - curl -L https://github.com/ulfjack/coveragepy/archive/lcov-support.tar.gz | tar xvz - cd "${GITHUB_WORKSPACE}" bazel coverage --javabase=@bazel_tools//tools/jdk:remote_jdk11 -t- --instrument_test_targets \ --experimental_cc_coverage --test_output=errors --linkopt=--coverage --linkopt=-lc \ --test_env=PYTHON_COVERAGE=${GITHUB_WORKSPACE}/src/coveragepy-lcov-support/__main__.py \ diff --git a/requirements.txt b/requirements.txt index 6eb6ea0..2652652 100644 --- a/requirements.txt +++ b/requirements.txt @@ -6,4 +6,5 @@ Flask # Common ipaddress -mock \ No newline at end of file +mock +coverage \ No newline at end of file From 3ba23e4a1979c4934083c5483c71806b6dc10037 Mon Sep 17 00:00:00 2001 From: awlx Date: Sun, 12 Feb 2023 11:22:50 +0100 Subject: [PATCH 2/5] Cleanup even more stuff --- .github/workflows/bazel.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/bazel.yml b/.github/workflows/bazel.yml index 1a2b66d..f7e3bc2 100644 --- a/.github/workflows/bazel.yml +++ b/.github/workflows/bazel.yml @@ -19,7 +19,6 @@ jobs: sudo apt-get install -y lcov bazel coverage --javabase=@bazel_tools//tools/jdk:remote_jdk11 -t- --instrument_test_targets \ --experimental_cc_coverage --test_output=errors --linkopt=--coverage --linkopt=-lc \ - --test_env=PYTHON_COVERAGE=${GITHUB_WORKSPACE}/src/coveragepy-lcov-support/__main__.py \ --define=config_file=test ...:all # Combine all generated reports into a single merged coverage.dat lcov $(find ./bazel-wgkex/ -size +1 -name "*coverage.dat" | sed 's/^/\-a\ /g') -o combined.dat From 964da1fbc486b762222ce5b33d399345216830bd Mon Sep 17 00:00:00 2001 From: awlx Date: Sun, 12 Feb 2023 11:38:41 +0100 Subject: [PATCH 3/5] Wtf --- .github/workflows/bazel.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/bazel.yml b/.github/workflows/bazel.yml index f7e3bc2..53c4477 100644 --- a/.github/workflows/bazel.yml +++ b/.github/workflows/bazel.yml @@ -21,7 +21,7 @@ jobs: --experimental_cc_coverage --test_output=errors --linkopt=--coverage --linkopt=-lc \ --define=config_file=test ...:all # Combine all generated reports into a single merged coverage.dat - lcov $(find ./bazel-wgkex/ -size +1 -name "*coverage.dat" | sed 's/^/\-a\ /g') -o combined.dat + lcov $(find ./bazel-wgkex/ -name "*coverage.dat" | sed 's/^/\-a\ /g') -o combined.dat lcov --extract combined.dat '*/__main__/wgkex/*' | sed 's/^SF\:.*__main__\//SF\:/g' > coverage.dat - name: Coveralls uses: coverallsapp/github-action@master From 7cfb9b9b04f4de923508fbbf2280c5eb784c0c4e Mon Sep 17 00:00:00 2001 From: awlx Date: Sun, 12 Feb 2023 11:41:42 +0100 Subject: [PATCH 4/5] This is all flawed --- .github/workflows/bazel.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/bazel.yml b/.github/workflows/bazel.yml index 53c4477..a11b986 100644 --- a/.github/workflows/bazel.yml +++ b/.github/workflows/bazel.yml @@ -17,11 +17,16 @@ jobs: - name: Python coverage run: | sudo apt-get install -y lcov + mkdir "${GITHUB_WORKSPACE}/src" + cd "${GITHUB_WORKSPACE}/src" + curl -L https://files.pythonhosted.org/packages/18/a0/bfa6c6ab7a5f0aeb69dd169d956ead54133f5bca68a5945c4569ea2c40b3/coverage-7.1.0.tar.gz | tar xvz + cd "${GITHUB_WORKSPACE}" bazel coverage --javabase=@bazel_tools//tools/jdk:remote_jdk11 -t- --instrument_test_targets \ --experimental_cc_coverage --test_output=errors --linkopt=--coverage --linkopt=-lc \ + --test_env=PYTHON_COVERAGE=${GITHUB_WORKSPACE}/src/coverage-7.1.0/__main__.py \ --define=config_file=test ...:all # Combine all generated reports into a single merged coverage.dat - lcov $(find ./bazel-wgkex/ -name "*coverage.dat" | sed 's/^/\-a\ /g') -o combined.dat + lcov $(find ./bazel-wgkex/ -size +1 -name "*coverage.dat" | sed 's/^/\-a\ /g') -o combined.dat lcov --extract combined.dat '*/__main__/wgkex/*' | sed 's/^SF\:.*__main__\//SF\:/g' > coverage.dat - name: Coveralls uses: coverallsapp/github-action@master From ebb27bb0a4f99b40f990f17b7faa83cc77e8ab5b Mon Sep 17 00:00:00 2001 From: awlx Date: Sun, 12 Feb 2023 11:52:35 +0100 Subject: [PATCH 5/5] once more --- .github/workflows/bazel.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/bazel.yml b/.github/workflows/bazel.yml index a11b986..d2febf6 100644 --- a/.github/workflows/bazel.yml +++ b/.github/workflows/bazel.yml @@ -21,15 +21,12 @@ jobs: cd "${GITHUB_WORKSPACE}/src" curl -L https://files.pythonhosted.org/packages/18/a0/bfa6c6ab7a5f0aeb69dd169d956ead54133f5bca68a5945c4569ea2c40b3/coverage-7.1.0.tar.gz | tar xvz cd "${GITHUB_WORKSPACE}" - bazel coverage --javabase=@bazel_tools//tools/jdk:remote_jdk11 -t- --instrument_test_targets \ + bazel coverage --combined_report=lcov --javabase=@bazel_tools//tools/jdk:remote_jdk11 -t- --instrument_test_targets \ --experimental_cc_coverage --test_output=errors --linkopt=--coverage --linkopt=-lc \ --test_env=PYTHON_COVERAGE=${GITHUB_WORKSPACE}/src/coverage-7.1.0/__main__.py \ --define=config_file=test ...:all - # Combine all generated reports into a single merged coverage.dat - lcov $(find ./bazel-wgkex/ -size +1 -name "*coverage.dat" | sed 's/^/\-a\ /g') -o combined.dat - lcov --extract combined.dat '*/__main__/wgkex/*' | sed 's/^SF\:.*__main__\//SF\:/g' > coverage.dat - name: Coveralls uses: coverallsapp/github-action@master with: github-token: ${{ secrets.GITHUB_TOKEN }} - path-to-lcov: coverage.dat + path-to-lcov: bazel-out/_coverage/_coverage_report.dat