Skip to content

new validate command tests added; validate feature fixes and updates#41

Merged
oleks-dev merged 1 commit intomainfrom
validate_tests_and_updates
Sep 14, 2025
Merged

new validate command tests added; validate feature fixes and updates#41
oleks-dev merged 1 commit intomainfrom
validate_tests_and_updates

Conversation

@oleks-dev
Copy link
Copy Markdown
Owner

These modifications aim to improve the robustness of template validation by adding comprehensive test cases and refining error handling. Below is a structured summary of the key changes and their implications:

1. Enhancements to Template Validation Logic

  • Error Handling for Invalid Templates:
    The code now includes detailed error messages for various invalid template scenarios, such as:

    • Missing required fields (id, name, steps).
    • Unsupported schema versions.
    • YAML syntax errors.
    • Missing Python steps in venv configurations.

    These errors are explicitly checked in the test cases to ensure the validation logic produces accurate and actionable feedback.

  • Schema Version Checks:
    The validation tool now checks for the presence and correctness of the schema_version field. For example:

    • If the schema version is not set, an error like "Unsupported template schema version NOT SET" is raised.
    • If an unsupported version (e.g., 0.1) is provided, the error message clearly states the issue.
  • YAML Syntax Validation:
    The tool now correctly identifies and reports YAML syntax errors (e.g., missing colons). For instance, a malformed line like description_ Example template triggers an error about a missing colon.

2. New Test Cases for Edge Scenarios

The get_validate_template_CASES list has been expanded to cover edge cases, ensuring the validation tool behaves as expected in various scenarios

3. Refactoring and Cleanup

  • Argument Path Resolution:
    The test_validate_template function now dynamically resolves paths for template with {resources} files using os.path.dirname(__file__), ensuring tests can locate the correct resource files regardless of the environment.

  • Parameter Simplification:
    The test_step_send_to_llm function had its parameters simplified by removing the mock_paths argument, likely to streamline the test setup and reduce redundancy.

  • Validate Feature Updates:

    • Small element path fixes
    • Rename of Input tag error to Field value
    • Added normalize_path to validation of specific --file
    • Added additional note to user about no python steps in a template when venv parameter is set and venv is not found
    • Update in issues / issue message depending on number of issues

@oleks-dev oleks-dev force-pushed the validate_tests_and_updates branch from 0b048a9 to 0ff2f1b Compare September 14, 2025 19:51
@oleks-dev oleks-dev merged commit 07f67cb into main Sep 14, 2025
6 checks passed
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.

1 participant