aperture
aperture copied to clipboard
Rudimentary unit tests for Validation and Defaults behavior on Policy config
Why
- This test detects whether Validation or Defaults are completely broken
What
- Write tests here: https://github.com/fluxninja/aperture/blob/main/pkg/policies/controlplane/validator_test.go
- Start with a super policy with all the pieces required for following unit tests.
- The super policy should not generate an error when passed through
policyValidator.ValidateObject
- Modify the super policy for each unit test
Defaults Tests
- Check that
PromQL.evaludation_interval
defaults to10s
when unset
Validation Tests
- Remove
ConcurrencyLimiter.selector
and check that error occurs - Set
WorkloadParameters.priority
as 2000 and check that error occurs