Skip to content

Commit 5d865c9

Browse files
committed
moe testdata to examples, add add additional tests
1 parent d51b528 commit 5d865c9

File tree

6 files changed

+12
-7
lines changed

6 files changed

+12
-7
lines changed

acceptance.bats

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11
#!/usr/bin/env bats
22

3-
@test "Fail when testing an invalid service" {
4-
run conftest testdata/service.yaml
3+
@test "Not fail when testing a service with a warning" {
4+
run conftest -p examples/kubernetes/policy examples/kubernetes/service.yaml
5+
[ "$status" -eq 0 ]
6+
}
7+
8+
@test "Fail when testing a deployment with root containers" {
9+
run conftest -p examples/kubernetes/policy examples/kubernetes/deployment.yaml
10+
[ "$status" -eq 1 ]
11+
}
12+
13+
@test "Fail when testing a service with warnings" {
14+
run conftest --fail-on-warn -p examples/kubernetes/policy examples/kubernetes/service.yaml
515
[ "$status" -eq 1 ]
616
}
File renamed without changes.

testdata/policy/base.rego renamed to examples/kubernetes/policy/base.rego

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,3 @@ warn[msg] {
1818
input.kind = "Service"
1919
msg = "Services are not allowed"
2020
}
21-
22-
warn[msg] {
23-
input.kind = "Deployment"
24-
msg = "Deployments are not allowed"
25-
}
File renamed without changes.

0 commit comments

Comments
 (0)