Skip to content

test: Add automated test suite with pytest and GitHub Actions CI workflow #29

Description

@CodeMaverick-143

Problem Description

The repository currently has zero unit tests and no automated CI workflow. Even though detector.py checks for PYTEST_CURRENT_TEST, there are no test files in the codebase to prevent regressions when PRs are submitted.

Proposed Solution

  1. Add pytest and pytest-mock to dev dependencies.
  2. Create tests/ directory with test cases for:
    • test_cli.py: Command line flags (--version, --help, non-existent path, output folder).
    • test_analyzer.py: AST parsing, comment counting (Python docstrings, C-style comments), function and class counting.
    • test_utils.py: list_source_files(), .insightignore filtering, supported file types.
    • test_reporter.py: Markdown file creation, metric formatting, summary generation.
    • test_detector.py: Mocked Gemini API responses and score parsing.
  3. Setup .github/workflows/ci.yml running pytest across Python 3.9, 3.10, 3.11, 3.12, 3.13 on Ubuntu, macOS, and Windows.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions