-
Notifications
You must be signed in to change notification settings - Fork 34
Open
Labels
Description
Objective
Add comprehensive test cases to ensure the expires field correctly validates against the schema and runtime implementation.
Context
Currently there may be insufficient test coverage for the expires field validation. We need tests that verify both schema validation and runtime parsing work consistently.
Approach
- Identify existing test files for config_helpers.go (likely
pkg/workflow/config_helpers_test.go) - Add test cases for
parseRelativeTimeSpec()function:- Valid cases: "7d", "2w", "1m", "1y", "30D", "12M"
- Invalid cases: "20h", "5H" (should return 0 and log error)
- Edge cases: "0d", invalid format, empty string
- Consider adding schema validation tests if not already covered
- Verify tests pass with the updated schema
Files to Modify
pkg/workflow/config_helpers_test.go(or create if doesn't exist)- Possibly
pkg/parser/schema_test.goor similar
Acceptance Criteria
- Test cases cover all valid time units (d, w, m, y)
- Test cases verify hour units are rejected
- Test cases verify the function returns 0 for invalid input
- Tests verify logging occurs for invalid units
- All tests pass with
make test-unit
Related to [plan] Fix expires field schema-implementation mismatch #7198
AI generated by Plan Command for discussion #7174