Skip to content

Commit

Permalink
[chore] remove unnecessary additional tools (#7852)
Browse files Browse the repository at this point in the history
This is replicating the setup in the contrib repo that doesn't use
go-acc & gcovmerge for coverage. It uses tools built into go 1.20
instead

---------

Signed-off-by: Alex Boten <[email protected]>
  • Loading branch information
Alex Boten authored Jun 21, 2023
1 parent 71c1873 commit 0b88ff9
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 117 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: ~1.19.10
go-version: ~1.20.5
- name: Cache Go
id: go-cache
uses: actions/cache@v3
Expand Down
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,8 @@ dist/
*.DS_Store

# Coverage
coverage.out
coverage/*
coverage.txt
coverage.html

# Wix
*.wixobj
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ gobenchmark:
@$(MAKE) for-all-target TARGET="benchmark"

.PHONY: gotest-with-cover
gotest-with-cover: $(GOCOVMERGE)
gotest-with-cover:
@$(MAKE) for-all-target TARGET="test-with-cover"
$(GOCOVMERGE) $$(find . -name coverage.out) > coverage.txt
$(GOCMD) tool covdata textfmt -i=./coverage/unit -o ./coverage.txt

.PHONY: goporto
goporto: $(PORTO)
Expand Down
7 changes: 4 additions & 3 deletions Makefile.Common
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# ALL_PKGS is the list of all packages where ALL_SRC files reside.
ALL_PKGS := $(sort $(shell go list ./...))
# COVER_PKGS is the list of packages to include in the coverage
COVER_PKGS := $(shell go list ./... | tr "\n" ",")

GOTEST_OPT?= -race -timeout 120s
GOCMD?= go
Expand All @@ -19,8 +21,6 @@ CHECKDOC := $(TOOLS_BIN_DIR)/checkdoc
CHLOG := $(TOOLS_BIN_DIR)/chloggen
CROSSLINK := $(TOOLS_BIN_DIR)/crosslink
ENVSUBST := $(TOOLS_BIN_DIR)/envsubst
GO_ACC := $(TOOLS_BIN_DIR)/go-acc
GOCOVMERGE := $(TOOLS_BIN_DIR)/gocovmerge
GOIMPORTS := $(TOOLS_BIN_DIR)/goimports
GOVULNCHECK := $(TOOLS_BIN_DIR)/govulncheck
LINT := $(TOOLS_BIN_DIR)/golangci-lint
Expand Down Expand Up @@ -50,7 +50,8 @@ test:

.PHONY: test-with-cover
test-with-cover: $(GO_ACC)
$(GO_ACC) --output=coverage.out ./...
mkdir -p $(PWD)/coverage/unit
$(GOTEST) $(GOTEST_OPT) -cover ./... -covermode=atomic -coverpkg $(COVER_PKGS) -args -test.gocoverdir="$(PWD)/coverage/unit"

.PHONY: benchmark
benchmark:
Expand Down
8 changes: 0 additions & 8 deletions internal/tools/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ require (
github.com/google/addlicense v1.1.1
github.com/jcchavezs/porto v0.4.0
github.com/mikefarah/yq/v4 v4.34.1
github.com/ory/go-acc v0.2.8
github.com/pavius/impi v0.0.3
github.com/wadey/gocovmerge v0.0.0-20160331181800-b5bfa59ec0ad
go.opentelemetry.io/build-tools/checkdoc v0.8.0
go.opentelemetry.io/build-tools/chloggen v0.8.0
go.opentelemetry.io/build-tools/crosslink v0.8.0
Expand Down Expand Up @@ -53,7 +51,6 @@ require (
github.com/breml/errchkjson v0.3.1 // indirect
github.com/butuzov/ireturn v0.2.0 // indirect
github.com/butuzov/mirror v1.1.0 // indirect
github.com/cespare/xxhash v1.1.0 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/charithe/durationcheck v0.0.10 // indirect
github.com/chavacava/garif v0.0.0-20230227094218-b8c73b2037b8 // indirect
Expand All @@ -62,7 +59,6 @@ require (
github.com/daixiang0/gci v0.10.1 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/denis-tingaikin/go-header v0.4.3 // indirect
github.com/dgraph-io/ristretto v0.0.2 // indirect
github.com/dimchansky/utfbom v1.1.1 // indirect
github.com/elliotchance/orderedmap v1.5.0 // indirect
github.com/emirpasic/gods v1.18.1 // indirect
Expand Down Expand Up @@ -101,7 +97,6 @@ require (
github.com/golangci/revgrep v0.0.0-20220804021717-745bb2f7c2e6 // indirect
github.com/golangci/unconvert v0.0.0-20180507085042-28b1c447d1f4 // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/gordonklaus/ineffassign v0.0.0-20230610083614-0e73809eb601 // indirect
github.com/gostaticanalysis/analysisutil v0.7.1 // indirect
github.com/gostaticanalysis/comment v1.4.2 // indirect
Expand Down Expand Up @@ -150,9 +145,6 @@ require (
github.com/nishanths/predeclared v0.2.2 // indirect
github.com/nunnatsa/ginkgolinter v0.12.1 // indirect
github.com/olekukonko/tablewriter v0.0.5 // indirect
github.com/ory/viper v1.7.5 // indirect
github.com/pborman/uuid v1.2.0 // indirect
github.com/pelletier/go-toml v1.9.5 // indirect
github.com/pelletier/go-toml/v2 v2.0.8 // indirect
github.com/pjbgf/sha1cd v0.3.0 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
Expand Down
Loading

0 comments on commit 0b88ff9

Please sign in to comment.