Principle: Test output should be clean and focused on test results, not cluttered with user-facing messages.
User-facing progress messages (emojis, status indicators, formatting) should never appear in test output as they:
- Make test output noisy and difficult to read
- Obscure actual test failures and important information
- Create inconsistent output between test runs
- Interfere with CI/CD log parsing and analysis
The project enforces clean test output through:
- Silent Verbosity by Default:
TestContextusesVerbosityLevel::Silentto suppress all user-facing messages - Test-Specific Output Utilities: Use
TestUserOutput::wrapped_silent()for clean test output - No User Messages in Tests: Tests should focus on verifying behavior, not producing user output
// ✅ Good: Uses silent verbosity by default
let context = TestContext::new();
// ✅ Good: Explicit silent output for API tests
let output = TestUserOutput::wrapped_silent();// ❌ Bad: Allows user-facing progress messages
let output = TestUserOutput::wrapped(VerbosityLevel::Normal);
// ❌ Bad: User output appears in test stderr
user_output.progress("⏳ Processing..."); // This will show in test output!When testing user output functionality itself:
#[test]
fn it_should_format_progress_message_correctly() {
// Capture output in test buffers, don't let it reach stderr
let test_output = TestUserOutput::new(VerbosityLevel::Normal);
test_output.output.progress("⏳ Processing...");
// Verify the message format in buffers
let stderr = test_output.stderr();
assert!(stderr.contains("⏳ Processing..."));
}Clean test output ensures:
- Readable Results: Developers can quickly identify failing tests
- Reliable CI/CD: Automated systems can parse test output correctly
- Professional Appearance: Test output looks polished and focused
- Debugging Efficiency: Important error messages aren't buried in noise
Remember: If you see user-facing messages (emojis, progress indicators) in test output, it indicates a testing infrastructure issue that should be fixed.