Skip to content

Commit

Permalink
chore(CI): MacOSX-friendly scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
vonrabbe committed Apr 19, 2018
1 parent 934ee4d commit 3d2dbe8
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,16 @@ dep:
test: unit-test whitebox-integration-test

unit-test:
@find \
@find . \
-mindepth 2 -type f ! -path "./vendor/*" ! -path "./api/*" -name "*_test.go" \
| xargs -i dirname {} \
| xargs -i sh -c "pushd {}; go test -v -cover || exit 1; popd"
| xargs -I {} dirname {} \
| xargs -I {} sh -c "pushd {}; go test -v -cover || exit 1; popd"

whitebox-integration-test:
@find \
@find . \
-mindepth 2 -type f -path "./api/*" -name "*_test.go" \
| xargs -i dirname {} \
| xargs -i sh -c "pushd {}; go test -v -cover || exit 1; popd"
| xargs -I {} dirname {} \
| xargs -I {} sh -c "pushd {}; go test -v -cover || exit 1; popd"

This comment has been minimized.

Copy link
@glensc

glensc Oct 3, 2018

Collaborator

push/popd is bashism, so you should bash -c here

This comment has been minimized.

Copy link
@glensc

glensc Oct 3, 2018

Collaborator

altho, in this context. it makes no sense to push pop, the cwd is not inherited, so just du:

sh -c "cd {} && go test -v -cover"

|| exit 1 is also not needed, exit code of last command is propagated. unless you want to change all non-zero exit codes to 1


coverage: PROJECT:=github.com/ivanilves/lstags
coverage: SERVICE:=travis-ci
Expand All @@ -57,10 +57,10 @@ shell-test-docker-tcp: DOCKER_HOST:=tcp://127.0.0.1:2375
shell-test-docker-tcp:
./lstags nginx~/stable/

lint: ERRORS=$(shell find . -name "*.go" ! -path "./vendor/*" | xargs -i golint {} | tr '`' '|')
lint: ERRORS=$(shell find . -name "*.go" ! -path "./vendor/*" | xargs -I {} golint {} | tr '`' '|')
lint: fail-on-errors

vet: ERRORS=$(shell find . -name "*.go" ! -path "./vendor/*" | xargs -i go tool vet {} | tr '`' '|')
vet: ERRORS=$(shell find . -name "*.go" ! -path "./vendor/*" | xargs -I {} go tool vet {} | tr '`' '|')
vet: fail-on-errors

fail-on-errors:
Expand Down

0 comments on commit 3d2dbe8

Please sign in to comment.