Skip to content

Commit

Permalink
Run unit tests for copier and chroot without -cover
Browse files Browse the repository at this point in the history
The chrooting causes testing with coverage counting enabled to output a
warning message which interferes with how they communicate with child
processes.  Disable -cover for those modules by testing them separately
without it.

Signed-off-by: Nalin Dahyabhai <[email protected]>
Signed-off-by: Daniel J Walsh <[email protected]>
  • Loading branch information
nalind authored and rhatdan committed Jun 29, 2023
1 parent af91012 commit 7be9168
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,8 @@ tests/testreport/testreport: tests/testreport/testreport.go

.PHONY: test-unit
test-unit: tests/testreport/testreport
$(GO_TEST) -v -tags "$(STORAGETAGS) $(SECURITYTAGS)" -cover $(RACEFLAGS) $(shell $(GO) list ./... | grep -v vendor | grep -v tests | grep -v cmd) -timeout 45m
$(GO_TEST) -v -tags "$(STORAGETAGS) $(SECURITYTAGS)" -cover $(RACEFLAGS) $(shell $(GO) list ./... | grep -v vendor | grep -v tests | grep -v cmd | grep -v chroot | grep -v copier) -timeout 45m
$(GO_TEST) -v -tags "$(STORAGETAGS) $(SECURITYTAGS)" $(RACEFLAGS) ./chroot ./copier
tmp=$(shell mktemp -d) ; \
mkdir -p $$tmp/root $$tmp/runroot; \
$(GO_TEST) -v -tags "$(STORAGETAGS) $(SECURITYTAGS)" -cover $(RACEFLAGS) ./cmd/buildah -args --root $$tmp/root --runroot $$tmp/runroot --storage-driver vfs --signature-policy $(shell pwd)/tests/policy.json --registries-conf $(shell pwd)/tests/registries.conf
Expand Down

0 comments on commit 7be9168

Please sign in to comment.