Skip to content

Add YAML loader validation tests for workflow contracts #543

Description

@coderabbitai

Summary

Add focused unit tests for the YAML workflow loader validation added in tests/workflow_contracts/ci_lint_test.py.

Rationale

The current change adds YAML 1.2 boolean handling and validates documents returned by _load. Existing tests do not cover these branches. Add direct coverage to prevent regressions in GitHub Actions workflow parsing and validation.

Affected area

  • tests/workflow_contracts/ci_lint_test.py
  • Its associated Python test module

Required changes

Add focused tests for _WorkflowLoader and _load.

Acceptance criteria

  • A workflow document keeps the on key as a string.
  • YAML true and false values resolve as booleans.
  • _load rejects an empty document.
  • _load rejects scalar documents.
  • _load rejects list documents.
  • _load rejects mappings that contain non-string keys.
  • The tests assert the intended error behaviour without depending on unrelated workflow contract tests.

Backlinks

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requestlowBacklog work, hygiene, or technical debt planned opportunistically, without a strict deadline.testingTest coverage, test infrastructure, and verification tooling work.

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions