-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
555 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
scripts/ | ||
.idea | ||
codeowners-validator | ||
dist/ | ||
dist/ | ||
tmp/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
.DEFAULT_GOAL = build | ||
|
||
# enable module support across all go commands. | ||
export GO111MODULE = on | ||
# enable consistent Go 1.12/1.13 GOPROXY behavior. | ||
export GOPROXY = https://proxy.golang.org | ||
|
||
# Build | ||
|
||
build: | ||
go build -o codeowners-validator ./main.go | ||
.PHONY: build | ||
|
||
build-race: | ||
go build -race -o codeowners-validator ./main.go | ||
.PHONY: build-race | ||
|
||
# Test | ||
test-unit: | ||
./hack/ci/run-test-unit.sh | ||
.PHONY: test-unit | ||
|
||
test-integration: build | ||
env BINARY_PATH=$(PWD)/codeowners-validator ./hack/ci/run-test-integration.sh | ||
.PHONY: test-integration | ||
|
||
test-lint: | ||
./hack/ci/run-lint.sh | ||
.PHONY: test-lint | ||
|
||
test-hammer: | ||
go test -count=100 ./... | ||
.PHONY: test-hammer | ||
|
||
cover-html: | ||
go test -v -coverprofile=./tmp/coverage.out ./... | ||
go tool cover -html=./tmp/coverage.out | ||
.PHONY: cover-html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#!/usr/bin/env bash | ||
|
||
# standard bash error handling | ||
set -o nounset # treat unset variables as an error and exit immediately. | ||
set -o errexit # exit immediately when a command fails. | ||
set -E # needs to be set if we want the ERR trap | ||
|
||
# Currently we are using the newest go (1.13) with go modules | ||
export GO111MODULE=on | ||
|
||
readonly CURRENT_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) | ||
readonly ROOT_PATH=${CURRENT_DIR}/../.. | ||
|
||
source "${CURRENT_DIR}/utilities.sh" || { echo 'Cannot load CI utilities.'; exit 1; } | ||
|
||
pushd ${ROOT_PATH} > /dev/null | ||
|
||
# Exit handler. This function is called anytime an EXIT signal is received. | ||
# This function should never be explicitly called. | ||
function _trap_exit () { | ||
popd > /dev/null | ||
} | ||
trap _trap_exit EXIT | ||
|
||
echo -e "${INVERTED}" | ||
echo "USER: " + ${USER} | ||
echo "PATH: " + ${PATH} | ||
echo "GOPATH:" + ${GOPATH} | ||
echo -e "${NC}" | ||
|
||
## | ||
# GO TEST INTEGRATION | ||
## | ||
shout "? go test integration" | ||
go test ./tests/integration/... -v -tags=integration | ||
# Check if tests passed | ||
if [[ $? != 0 ]]; then | ||
echo -e "${RED}✗ go test integration\n${NC}" | ||
exit 1 | ||
else echo -e "${GREEN}√ go test integration${NC}" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.