Repository navigation
test(cli): add list command tests and validate target edge cases - #7616
Conversation
Add comprehensive test coverage for the `list` command (evals, prompts, datasets subcommands) and edge case tests for `validate target` command. Co-Authored-By: Claude Opus 4.6 <[email protected]>
There was a problem hiding this comment.
👍 All Clear
This PR adds test files for CLI list and validation commands. The changes are purely test code with mocked dependencies and no LLM-related functionality or data flows.
Minimum severity threshold: 🟡 Medium | To re-scan after changes, comment @promptfoo-scanner
Learn more
📝 WalkthroughWalkthroughTwo test files are added to the codebase. The first introduces a comprehensive test suite for the list command, covering evals, prompts, and datasets subcommands across multiple modes including ids-only, non-interactive, and interactive with pagination. Extensive mocking is configured for logging, data models, UI components, and database utilities. The second file adds edge-case tests for the validate-provider-tests command, covering scenarios where target or config is missing, config loading fails, or no providers are present. Together, these additions contribute 472 lines of new test coverage without modifying production code. Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
No actionable comments were generated in the recent review. 🎉 🧹 Recent nitpick comments
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Co-Authored-By: Claude Opus 4.6 <[email protected]>
Add afterEach cleanup, error handling tests, and clarifying comments. Simplify redundant mock factory defaults that were overridden in beforeEach. Co-Authored-By: Claude Opus 4.6 <[email protected]>
mldangelo
left a comment
There was a problem hiding this comment.
Thank you for helping improve the test coverage @bishnubista!
Summary
listcommand covering all three subcommands (evals, prompts, datasets)validate targetcommand (missing args, config load failure, empty providers)Test plan
🤖 Generated with Claude Code