Skip to content

test: comprehensive CLI tests and GitHub Actions CI workflow#9

Merged
Abishek9342 merged 2 commits into
devfrom
pr/tests-cli-and-ci-workflow
Mar 25, 2026
Merged

test: comprehensive CLI tests and GitHub Actions CI workflow#9
Abishek9342 merged 2 commits into
devfrom
pr/tests-cli-and-ci-workflow

Conversation

@sairaamv

@sairaamv sairaamv commented Mar 25, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Rewrites tests/test_main_cli.py from 2 tests to 35, covering:
    • Happy path (exit zero, output messages, report ID, total findings, time taken)
    • Zero findings and nonexistent directory cases
    • --version, --help, scan --help flags
    • All report formats: txt, md, json, all (3 files created), auto-increment filenames
    • AI provider flags: missing credentials errors, ollama no-models error, successful scans
    • AI findings → _llm report file created; no findings → message shown
    • --with-ai, --ai-mode, --personal-only flag behaviour
    • Upload flow: prompt N skips upload, prompt Y calls upload, success URL shown, failure doesn't crash
  • Adds .github/workflows/test.yml to run pytest tests/ -v automatically on every PR to dev/main across Python 3.9, 3.11, and 3.12 using uv

Test plan

  • uv run --with pytest pytest tests/test_main_cli.py -v — all 35 pass
  • Open a test PR and confirm the Actions workflow triggers

Merge order: Can be merged independently; CI workflow will only be useful once PR #7 (refactor) is merged.

🤖 Generated with Claude Code


Open with Devin

- Rewrites test_main_cli.py from 2 tests to 35 covering happy path,
  report formats, AI provider flags, upload flow, and edge cases
- Adds .github/workflows/test.yml to run pytest on every PR to dev/main
  across Python 3.9, 3.11, and 3.12 using uv

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@sairaamv sairaamv requested a review from Abishek9342 March 25, 2026 05:47
devin-ai-integration[bot]

This comment was marked as resolved.

Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@Abishek9342 Abishek9342 merged commit bd409c4 into dev Mar 25, 2026
3 of 4 checks passed
@Abishek9342 Abishek9342 deleted the pr/tests-cli-and-ci-workflow branch March 25, 2026 06:14
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