]> source.dussan.org Git - gitea.git/commitdiff
Prevent coverage break (#16887)
authorzeripath <art27@cantab.net>
Mon, 30 Aug 2021 23:41:08 +0000 (00:41 +0100)
committerGitHub <noreply@github.com>
Mon, 30 Aug 2021 23:41:08 +0000 (01:41 +0200)
* Prevent coverage break

There are repeated failures of our CI due to an intermittent issue with coverage.out
finishing with a spurious `0` on a single line.

This problem is very annoying and very hard to understand where it is coming from,
therefore as the problem appears random and without clear cause we should just strip
this line from our coverage.

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: 6543 <6543@obermui.de>
Makefile

index ff03e4c0bbcd7e9f1219f8d7c0fe17835c8068e5..24d47199a939adcc482a72dc1799dbc6dda737cf 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -385,7 +385,9 @@ test\#%:
 
 .PHONY: coverage
 coverage:
-       GO111MODULE=on $(GO) run -mod=vendor build/gocovmerge.go integration.coverage.out coverage.out > coverage.all
+       grep -v '^0$$' coverage.out > coverage-bodged.out
+       grep -v '^0$$' integration.coverage.out > integration.coverage-bodged.out
+       GO111MODULE=on $(GO) run -mod=vendor build/gocovmerge.go integration.coverage-bodged.out coverage-bodged.out > coverage.all || (echo "gocovmerge failed"; echo "integration.coverage.out"; cat integration.coverage.out; echo "coverage.out"; cat coverage.out; exit 1)
 
 .PHONY: unit-test-coverage
 unit-test-coverage: