Skip to content

Conversation

@adilhusain-s
Copy link
Collaborator

Add comprehensive tests and CI workflow for Python versions and manifests

Summary

  • Purpose: Strengthen test coverage and CI to ensure Python versions, manifest models, and package compatibility remain stable across upgrades.
  • Scope: Adds extensive unit tests for manifest parsing and merging, Pydantic models, Typer and Requests API compatibility, and cross-module imports; introduces a GitHub Actions workflow to run tests on PRs.

Changes

  • Tests:
    • tests/test_models_and_manifest_tools.py: Adds comprehensive tests validating:
      • FileEntry and ManifestEntry creation, validation, model_dump, JSON schema generation, copying, and error handling.
      • manifest_fetch, manifest_merge, and update_version behaviors including unique/overlapping versions and duplicate file handling.
      • Integration flow: fetch → merge → update, ensuring expected final manifest state.
      • Edge cases in parsing version lists, sorting stable vs prerelease, handling missing/empty/invalid entries.
    • tests/test_package_compatibility.py: Verifies compatibility with minimum package versions:
      • requests >= 2.32.5: urlopen response attributes and error handling via fetch_json, get_nuget_versions.
      • typer >= 0.19.2: app creation, options, echo, exit, and command registration.
      • pydantic >= 2.11.7: BaseModel instantiation, field validation, JSON schema, serialization, optional fields, strict validation, and nested models.
    • Additional tests for get_python_version.PythonManifestParser covering latest version retrieval with prerelease filters, unmatched filters, and complex sorting scenarios.
  • CI:
    • Adds a GitHub Actions workflow to run the test suite on pushes/PRs, ensuring ongoing compatibility and preventing regressions.

Context

  • Addresses gaps in automated verification for Python version handling and manifest tools that interact with multiple external dependencies and scripts.
  • Ensures internal modules under .github/scripts and PowerShell remain importable and functionally compatible with pinned or minimum versions of third-party packages.

Commit History (branch-only)

  • fa7ad5a: Add GitHub Actions workflow for running tests
  • 4be49c6: Add comprehensive tests for Python version handling, models, and package compatibility

Impact

  • Increases confidence in manifest operations and version parsing across a wide range of edge cases.
  • Reduces risk of breakage from dependency updates to Requests, Typer, and Pydantic.
  • Provides immediate CI feedback for future changes.

Testing

  • New tests pass locally; CI workflow will run pytest on PR creation to validate across environments.

Risks

  • None identified; changes are additive (tests + workflow) and do not modify production code paths.

…age compatibility

- Implement tests for `get_python_version.py` to validate version detection, parsing, comparison, and filtering.
- Create tests for `models.py` and `manifest_tools.py` to ensure Pydantic models function correctly and handle various scenarios.
- Introduce package compatibility tests to verify that the project works with minimum required versions of requests, typer, and pydantic.
- Ensure that all tests cover edge cases and error handling for robust validation.
@adilhusain-s
Copy link
Collaborator Author

Superseded by signed commit PR #8.

@adilhusain-s
Copy link
Collaborator Author

pr8

@adilhusain-s adilhusain-s deleted the test branch December 24, 2025 15:42
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.

2 participants