Open
Description
The docs say that data in a folder "exceptions/a.json" will be exposed as "data.exceptions".
The example, which is the tested behaviour, shows that it is actually available directly under "data".
# check that the original test works
~/tmp/conftest/examples/data(master)$ conftest verify --data exclusions/services.yaml
1 test, 1 passed, 0 warnings, 0 failures, 0 exceptions
# move the data file, which should change its import path
~/tmp/conftest/examples/data(master)$ mv exclusions/services.yaml a.yaml
# yet the test still works
~/tmp/conftest/examples/data(master)$ conftest verify --data a.yaml
1 test, 1 passed, 0 warnings, 0 failures, 0 exceptions
I think the test logic is inverted - it is checking that running conftest test
gives an error, but it should be checking that it doesn't:
~/tmp/conftest(master)$ conftest test -p examples/data/policy -d examples/data/exclusions examples/data/service.yaml
FAIL - examples/data/service.yaml - main - Cannot expose one of the following ports on a LoadBalancer [22]
1 test, 0 passed, 0 warnings, 1 failure, 0 exceptions
Am I right in thinking that opa test --bundle <path>
should be equivalent to conftest verify --policy <path> --data <path>
? My tests are working using this opa command at any rate!