These smoke tests verify that the core promptfoo CLI functionality works correctly through the Python wrapper.
Smoke tests are high-level integration tests that verify the most critical functionality works end-to-end. They:
- Run against the actual installed CLI via the Python wrapper (using either global promptfoo or npx)
- Test the Python wrapper integration with the Node.js CLI
- Use the
echoprovider to avoid external API dependencies - Verify command-line arguments, file I/O, and output formats
- Check exit codes and error handling
# Run all smoke tests
pytest tests/smoke/
# Run with verbose output
pytest tests/smoke/ -v
# Run a specific test class
pytest tests/smoke/test_smoke.py::TestEvalCommand
# Run a specific test
pytest tests/smoke/test_smoke.py::TestEvalCommand::test_basic_evaltest_smoke.py- Main smoke test suitefixtures/- Test configuration filesconfigs/- YAML configuration files for testing
- Version flag (
--version) - Help output (
--help,eval --help) - Unknown command handling
- Missing file error handling
- Basic evaluation with echo provider
- Output formats (JSON, YAML, CSV)
- Command-line flags (
--max-concurrency,--repeat,--verbose) - Cache control (
--no-cache)
- Exit code 0 for success
- Exit code 100 for assertion failures
- Exit code 1 for configuration errors
- Basic prompt echoing
- Variable substitution
- Multiple variable handling
containsassertionicontainsassertion (case-insensitive)- Multiple assertions per test
- Failing assertion behavior
The echo provider is perfect for smoke tests because:
- No external dependencies - Doesn't require API keys or network calls
- Deterministic - Always returns the same output for the same input
- Fast - No network latency
- Predictable - Easy to write assertions against
- Create a new test config in
fixtures/configs/if needed - Add test methods to the appropriate test class in
test_smoke.py - Use the
run_promptfoo()helper to execute CLI commands - Make assertions on stdout, stderr, exit codes, and output files
- Smoke tests run slower than unit tests (they spawn subprocesses)
- They require Node.js and promptfoo to be installed
- They test the integration between Python and Node.js
- They should be kept focused on critical functionality