File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -95,7 +95,7 @@ covunit: ## Run unit tests with coverage and the race detector
9595> rm -rf $(OPENRUN_HOME)/coverage/unit && mkdir -p $(OPENRUN_HOME)/coverage/unit
9696> packages="$(GO_PACKAGES)"
9797> cover_packages="$(GO_COVER_PACKAGES)"
98- > go test -race -coverpkg "$$cover_packages" $$packages -args -test.gocoverdir="$(OPENRUN_HOME)/coverage/unit"
98+ > go test -race -covermode=atomic - coverpkg "$$cover_packages" $$packages -args -test.gocoverdir="$(OPENRUN_HOME)/coverage/unit"
9999> go tool covdata percent -i=$(OPENRUN_HOME)/coverage/unit
100100> go tool covdata textfmt -i=$(OPENRUN_HOME)/coverage/unit -o $(OPENRUN_HOME)/coverage/profile
101101> go tool cover -func coverage/profile | grep '^total :'
Original file line number Diff line number Diff line change @@ -54,11 +54,13 @@ mv "$WORK/embed.go" internal/server/list_apps/embed.go
5454rm -rf apps
5555
5656# Distro toolchains lag behind Go patch releases; the minor version is what
57- # actually gates the language level, so drop the patch from the main module and
58- # local module dependencies before creating vendor metadata.
57+ # actually gates the language level, so relax the patch to .0 in the main
58+ # module and local module dependencies before creating vendor metadata. The
59+ # .0 form (not a bare major.minor) is required: go mod vendor rejects a go.mod
60+ # whose go directive is not in the canonical three-part form.
5961echo " ==> Relaxing go.mod patch version and vendoring modules"
6062for mod_file in go.mod pkg/binding/go.mod; do
61- sed -E ' s/^go ([0-9]+\.[0-9]+)\.[0-9]+$/go \1/' " $mod_file " > " $mod_file .new"
63+ sed -E ' s/^go ([0-9]+\.[0-9]+)\.[0-9]+$/go \1.0 /' " $mod_file " > " $mod_file .new"
6264 mv " $mod_file .new" " $mod_file "
6365done
6466GOTOOLCHAIN=local go mod vendor
Original file line number Diff line number Diff line change @@ -197,7 +197,10 @@ else
197197 fi
198198
199199 if [[ -n " $GOCOVERDIR " ]]; then
200- go build -cover ./cmd/openrun
200+ # atomic, not the default set: covtest merges this binary's coverage
201+ # data with the unit test data, which is atomic mode (covunit runs with
202+ # -race), and covdata rejects mixed counter modes
203+ go build -cover -covermode=atomic ./cmd/openrun
201204 else
202205 go build ./cmd/openrun
203206 fi
You can’t perform that action at this time.
0 commit comments