Skip to content

Commit

Permalink
Make pre-commit.sh work with the test framework
Browse files Browse the repository at this point in the history
Eventually we want our framework to work nicely with just `go test`. To
get there we need to
- inject KUBE_ASSETS_DIR
- make the framework work when run multiple times in parallel (port
  collitions, expose bound ports the the subject under test, ...)

We decided to make sure our tests are run in sequence (and not in
parallel to any other thing using etcd, for that matter) by making this
explicit in the `pre-commit.sh` - for now.

As soon as we are there, we can rollback the change to the
`pre-commit.sh` end have the test framework be tested the same as
everything else.

[#153248975]
  • Loading branch information
hoegaarden authored and totherme committed Nov 29, 2017
1 parent 849d4f9 commit ccb54d2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion bin/pre-commit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,12 @@ go vet -all ./...
rc=$((rc || $?))

echo "Running go test"
go test -v ./...
go list ./... | grep -vF pkg/framework/test | xargs go test -v
rc=$((rc || $?))

echo "Running test framework tests"
./pkg/framework/test/scripts/download-binaries.sh \
&& ./pkg/framework/test/scripts/run-tests.sh
rc=$((rc || $?))

exit $rc
2 changes: 1 addition & 1 deletion pkg/framework/test/democli/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func Execute() {
}
}

func init() {
func init() {
cobra.OnInitialize(initConfig)

// Here you will define your flags and configuration settings.
Expand Down

0 comments on commit ccb54d2

Please sign in to comment.