https://cerbos.dev logo
#help
Title
# help
j

Jesum Yip

01/30/2023, 8:15 AM
test suites don't support
version
for resource policies?
i have a resource policy with
version: 'production'
how do i write a test suite against it? under:
Copy code
resources:
  attack_patterns_resource:
    id: sample_id_123
    kind: attack_patterns
  automatecatalog_resource:
    id: sample_id_456
    kind: automatecatalog
i am not allowed to specify
version: "production"
as i will get an error of i do so:
failed to load test suite: failed to unmarshal JSON: proto: (line 1:462): unknown field "version"
if i leave
version: "production"
in my resource policy, then all my test suites will fail. but if i change it to
version: "default"
then my test suites will pass successfully
c

Charith (Cerbos)

01/30/2023, 9:03 AM
The field is called
policyVersion
.
j

Jesum Yip

01/30/2023, 9:04 AM
Aaah ok. Thank you
c

Charith (Cerbos)

01/30/2023, 9:05 AM
Thanks for raising it. I think we've forgotten to document that.
j

Jesum Yip

01/31/2023, 12:58 AM
Can policyVersion take a wildcard?
This means I can have a set of test suites for any version of my policies.
Or is it better practice to have a set of test suites for each set of policies?
From the way this is designed it looks like there's one set of test suites for one set of policies.