Skip to content

Latest commit

 

History

History
35 lines (27 loc) · 1.45 KB

File metadata and controls

35 lines (27 loc) · 1.45 KB

Rust Test Conversion Summary

Successfully converted shell script to Rust test!

Key Features:

  • Cross-platform compatibility: Works on Windows, macOS, Linux
  • Environment variable configuration: Same flexibility as shell script
  • Better error handling: Distinguishes infrastructure failures from validation failures
  • Rich output: Colored terminal output with emojis and statistics
  • CI-friendly: Integrates with Cargo test framework

Usage:

# Test with default configuration
cargo test test_repositories -- --nocapture

# Test with custom repository list
REPOS_FILE=tests/repo_test/test_repos_small.txt cargo test test_repositories -- --nocapture

# Test with custom timeout and directory
TEST_TIMEOUT=60 TEST_DIR=/tmp/repo_tests cargo test test_repositories -- --nocapture

Test Logic:

  1. Infrastructure Failures: Test fails if all repos fail due to clone/build/command issues
  2. Validation Failures: Test passes even if vipyrdocs finds violations (that's the point!)
  3. Mixed Results: Test passes if some repos process successfully, regardless of validation results

Environment Variables:

  • REPOS_FILE: Path to repository list file
  • TEST_TIMEOUT: Timeout per repository (seconds)
  • TEST_DIR: Directory to download repos
  • SKIP_BUILD: Set to "1" to skip building vipyrdocs

The Rust version provides all the functionality of the original shell script while being more reliable and maintainable!