Skip to content

Commit

Permalink
Take care of Multi-Module Repositories
Browse files Browse the repository at this point in the history
  • Loading branch information
shogo82148 committed May 23, 2020
1 parent 2378cbc commit 4130e33
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
shell: bash

- name: Test
run: go test -race -v -coverprofile=profile.cov ./...
run: make test
env:
GO111MODULE: "on"
shell: bash
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

# Test binary, built with `go test -c`
*.test
*.cov

# Output of the go coverage tool, specifically when used with LiteIDE
*.out
Expand Down
12 changes: 12 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
DEP_XRAYAWS=$(shell cat xrayaws/go.mod | grep -v module | grep github.com/shogo82148/aws-xray-yasdk-go | cut -d' ' -f2)

.PHONEY: test
test:
go test -race -v -coverprofile=profile.cov ./...

# Take care of Multi-Module Repositories
# ref. https://github.com/golang/go/wiki/Modules#faqs--multi-module-repositories
cd xrayaws && go mod edit -replace github.com/shogo82148/aws-xray-yasdk-go@${DEP_XRAYAWS}=../ && \
go test -race -v -coverprofile=profile.cov ./... && \
go mod edit -dropreplace github.com/shogo82148/aws-xray-yasdk-go@${DEP_XRAYAWS}
cat xrayaws/profile.cov >> profile.cov

0 comments on commit 4130e33

Please sign in to comment.