Skip to content

Conversation

@t0mmylam
Copy link
Collaborator

Add Comprehensive DeploymentPolicy Validation Tests

What

Adds comprehensive unit tests for DeploymentPolicy validation and defaulting logic, covering all requirements for strategy validation, budget constraints, compartment rules, and default inheritance.

Why

  • Ensures robust validation of deployment policies before they're applied
  • Prevents configuration errors that could impact rollout safety
  • Provides comprehensive test coverage for complex policy validation logic

Changes

  • Strategy validation: Ensures exactly one strategy type (fixed/linear/exponential) is set
  • Bounds validation: Tests all numeric constraints for strategy parameters
  • Budget XOR validation: Enforces percent/count mutual exclusivity
  • Compartment validation: Unique names and non-duplicate selectors
  • Default inheritance: Compartments inherit strategy from policy default
  • Code refactoring: Eliminated duplication with helper functions

@t0mmylam t0mmylam merged commit c2e6b76 into main Oct 1, 2025
7 checks passed
@t0mmylam t0mmylam deleted the deployment-policy-validation branch October 1, 2025 16:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants