File tree Expand file tree Collapse file tree 3 files changed +27
-3
lines changed Expand file tree Collapse file tree 3 files changed +27
-3
lines changed Original file line number Diff line number Diff line change @@ -252,7 +252,7 @@ jobs:
252252 uses : ./.github/actions/setup-go
253253
254254 - name : run itest
255- run : make itest
255+ run : make itest cover=1
256256
257257 - name : Zip log files on failure
258258 if : ${{ failure() }}
@@ -266,6 +266,15 @@ jobs:
266266 path : logs-itest.zip
267267 retention-days : 5
268268
269+ - name : Send coverage
270+ uses : shogo82148/actions-goveralls@v1
271+ if : ${{ success() }}
272+ continue-on-error : true
273+ with :
274+ path-to-profile : itest/coverage.txt
275+ flag-name : ' itest'
276+ parallel : true
277+
269278 # #######################
270279 # run integration tests with Postgres backend
271280 # #######################
@@ -280,7 +289,7 @@ jobs:
280289 uses : ./.github/actions/setup-go
281290
282291 - name : run itest
283- run : make itest dbbackend=postgres
292+ run : make itest dbbackend=postgres cover=1
284293
285294 - name : Zip log files on failure
286295 if : ${{ failure() }}
@@ -294,6 +303,15 @@ jobs:
294303 path : logs-itest-postgres.zip
295304 retention-days : 5
296305
306+ - name : Send coverage
307+ uses : shogo82148/actions-goveralls@v1
308+ if : ${{ success() }}
309+ continue-on-error : true
310+ with :
311+ path-to-profile : itest/coverage.txt
312+ flag-name : ' itest'
313+ parallel : true
314+
297315 # #######################
298316 # Run LiTd tests
299317 # #######################
Original file line number Diff line number Diff line change @@ -203,7 +203,7 @@ itest-trace: build-itest itest-only-trace
203203itest-only : aperture-dir
204204 @$(call print, "Running integration tests with ${backend} backend.")
205205 rm -rf itest/regtest; date
206- $(GOTEST ) ./itest -v -tags=" $( ITEST_TAGS) " $(TEST_FLAGS ) $(ITEST_FLAGS ) -btcdexec=./btcd-itest -logdir=regtest
206+ $(GOTEST ) ./itest -v $( ITEST_COVERAGE ) -tags=" $( ITEST_TAGS) " $(TEST_FLAGS ) $(ITEST_FLAGS ) -btcdexec=./btcd-itest -logdir=regtest
207207
208208itest-only-trace : aperture-dir
209209 @$(call print, "Running integration tests with ${backend} backend.")
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ RPC_TAGS = autopilotrpc chainrpc invoicesrpc peersrpc routerrpc signrpc verrpc w
44LOG_TAGS =
55TEST_FLAGS =
66ITEST_FLAGS = -logoutput
7+ ITEST_COVERAGE =
78COVER_PKG = $$(go list -deps -tags="$(DEV_TAGS ) " ./... | grep '$(PKG ) ' | grep -v taprpc )
89COVER_HTML = go tool cover -html=coverage.txt -o coverage.html
910POSTGRES_START_DELAY = 5
@@ -64,6 +65,11 @@ ifneq ($(tags),)
6465DEV_TAGS += ${tags}
6566endif
6667
68+ # Enable integration test coverage (requires Go >= 1.20.0).
69+ ifneq ($(cover ) ,)
70+ ITEST_COVERAGE = -coverprofile=itest/coverage.txt -coverpkg=./...
71+ endif
72+
6773# Define the log tags that will be applied only when running unit tests. If none
6874# are provided, we default to "nolog" which will be silent.
6975ifneq ($(log ) ,)
You can’t perform that action at this time.
0 commit comments