mirror of
https://github.com/yannh/kubeconform.git
synced 2026-02-11 14:09:21 +00:00
first acceptance test
This commit is contained in:
parent
cee6971ee9
commit
0eecf37d9b
3 changed files with 29 additions and 1 deletions
4
Makefile
4
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
|
||||
|
|
|
|||
7
acceptance.bats
Normal file
7
acceptance.bats
Normal file
|
|
@ -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" ]
|
||||
}
|
||||
19
fixtures/valid.yaml
Executable file
19
fixtures/valid.yaml
Executable file
|
|
@ -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
|
||||
Loading…
Reference in a new issue