Skip to content

Commit

Permalink
Run gotest
Browse files Browse the repository at this point in the history
  • Loading branch information
Mongey committed Feb 19, 2019
1 parent d894839 commit 92c4fb3
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 7 deletions.
22 changes: 15 additions & 7 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
version: 2
jobs:
build:
working_directory: /go/src/github.com/Mongey/vault-plugin-secrets-kafka
docker:
- image: circleci/golang:1.11
environment:
TEST_RESULTS: /tmp/test-results
steps:
- checkout
- run: make build
- store_artifacts:
path: /go/src/github.com/Mongey/vault-plugin-secrets-kafka/vault-plugin-secrets-kafka
destination: vault-plugin-secrets-kafka
test:
working_directory: /go/src/github.com/Mongey/vault-plugin-secrets-kafka
docker:
- image: circleci/golang:1.11
Expand All @@ -18,23 +30,19 @@ jobs:
KAFKA_LOG_SEGMENT_BYTES: 1234
steps:
- checkout
- run: go build
- store_artifacts:
path: /go/src/github.com/Mongey/vault-plugin-secrets-kafka/vault-plugin-secrets-kafka
destination: vault-plugin-secrets-kafka
- run: make test
- run: go get github.com/jstemmer/go-junit-report
- run: mkdir -p $TEST_RESULTS
- run:
name: Run Tests
command: |
trap "go-junit-report <${TEST_RESULTS}/go-test.out > ${TEST_RESULTS}/go-test-report.xml" EXIT
make testacc| tee ${TEST_RESULTS}/go-test.out
make test| tee ${TEST_RESULTS}/go-test.out
- store_test_results:
path: /tmp/test-results

workflows:
version: 2
build:
build-and-test:
jobs:
- build
- test
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
vault-plugin-secrets-kafka
12 changes: 12 additions & 0 deletions GNUmakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
TEST?=$$(go list ./... |grep -v 'vendor')
GOFMT_FILES?=$$(find . -name '*.go' |grep -v vendor)
default: build

build:
go build .

test:
go test -i $(TEST) || exit 1
echo $(TEST) | \
xargs -t -n4 go test $(TESTARGS) -timeout=30s -parallel=4

4 changes: 4 additions & 0 deletions plugin/backend_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,12 @@ func testAccStepRole(t *testing.T, role string) logicaltest.TestStep {
},
}
}

func testAccStepConfig(t *testing.T, uri string) logicaltest.TestStep {
password := os.Getenv("KAFKA_ROOT_CERTIFICATE")
if password == "" {
t.Fatal("KAFKA_ROOT_CERTIFICATE must be set in the env")
}

return logicaltest.TestStep{
Operation: logical.UpdateOperation,
Expand Down

0 comments on commit 92c4fb3

Please sign in to comment.