Skip to content

[plan] Add test coverage for expires field validation #7201

@github-actions

Description

@github-actions

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

  1. Identify existing test files for config_helpers.go (likely pkg/workflow/config_helpers_test.go)
  2. 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
  3. Consider adding schema validation tests if not already covered
  4. 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.go or similar

Acceptance Criteria

AI generated by Plan Command for discussion #7174

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions