From 035225ce7e90c4b191d34ab4a9bb3f43e52b3748 Mon Sep 17 00:00:00 2001 From: Jesse Duffield Date: Thu, 30 Nov 2023 08:25:23 +1100 Subject: [PATCH] Clean up code --- .github/workflows/ci.yml | 2 ++ scripts/run_integration_tests.sh | 15 ++------------- 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e12994eb2e6..8139f88446f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -205,6 +205,8 @@ jobs: echo "Coverage directories: $COVERAGE_DIRS" # Run the combine command with the generated list go tool covdata textfmt -i=$COVERAGE_DIRS -o coverage.out + echo "Combined coverage:" + go tool cover -func coverage.out | tail -1 | awk '{print $3}' - name: Upload to Codacy # Don't run on forks diff --git a/scripts/run_integration_tests.sh b/scripts/run_integration_tests.sh index e4e7b3fb983..d2fd94df33b 100755 --- a/scripts/run_integration_tests.sh +++ b/scripts/run_integration_tests.sh @@ -18,25 +18,14 @@ if [ -n "$LAZYGIT_GOCOVERDIR" ]; then # test runner's coverage data to /tmp/code_coverage_test_runner, then merge the two coverage files # back into /tmp/code_coverage - mkdir -p /tmp/code_coverage_test_runner mkdir -p /tmp/code_coverage_merged - go test -cover -coverpkg=github.com/jesseduffield/lazygit/pkg/... pkg/integration/clients/*.go -args -test.gocoverdir="/tmp/code_coverage_test_runner" + go test -cover -coverpkg=github.com/jesseduffield/lazygit/pkg/... pkg/integration/clients/*.go -args -test.gocoverdir="/tmp/code_coverage" - echo "contents of /tmp/code_coverage before merge:" - ls /tmp/code_coverage - - echo "contents of /tmp/code_coverage_test_runner before merge:" - ls /tmp/code_coverage_test_runner - - go tool covdata merge -i=/tmp/code_coverage,/tmp/code_coverage_test_runner -o=/tmp/code_coverage_merged + go tool covdata merge -i=/tmp/code_coverage -o=/tmp/code_coverage_merged rm -rf /tmp/code_coverage mv /tmp/code_coverage_merged /tmp/code_coverage - - echo "contents of /tmp/code_coverage after merge:" - ls /tmp/code_coverage - else go test pkg/integration/clients/*.go fi