diff --git a/Makefile b/Makefile index 28372fc..1773654 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ #!/usr/bin/make -f -.PHONY: test-build test build build-static docker-test docker-build-static +.PHONY: test-build test build build-static docker-test docker-build-static acceptance test-build: test build @@ -19,3 +19,5 @@ docker-test: docker-build-static: docker run -t -v $$PWD:/go/src/github.com/yannh/kubeconform -w /go/src/github.com/yannh/kubeconform golang:1.14 make build-static +acceptance: + bats acceptance.bats diff --git a/acceptance.bats b/acceptance.bats new file mode 100644 index 0000000..b1db5d2 --- /dev/null +++ b/acceptance.bats @@ -0,0 +1,7 @@ +#!/usr/bin/env bats + +@test "Pass when parsing a valid Kubernetes config YAML file" { + run bin/kubeconform -file fixtures/valid.yaml -summary + [ "$status" -eq 0 ] + [ "$output" = "Run summary - Valid: 1, Invalid: 0, Errors: 0 Skipped: 0" ] +} \ No newline at end of file diff --git a/fixtures/valid.yaml b/fixtures/valid.yaml new file mode 100755 index 0000000..07c350e --- /dev/null +++ b/fixtures/valid.yaml @@ -0,0 +1,19 @@ +apiVersion: v1 +kind: ReplicationController +metadata: + name: "bob" +spec: + replicas: 2 + selector: + app: nginx + template: + metadata: + name: nginx + labels: + app: nginx + spec: + containers: + - name: nginx + image: nginx + ports: + - containerPort: 80