Document Python dependency and make integration tests conditional

- Update README.md to mention Python 3 requirement for integration tests
- Make rate limiting test skip gracefully if Python 3 is not available
- Move and rename test helper script to tests/gemini_test_client.py
- Update test to use new script path
- Improve test documentation and error handling
This commit is contained in:
Jeena 2026-01-16 22:55:34 +00:00
parent 1ef0f97ebf
commit ad84bf187d
3 changed files with 211 additions and 2 deletions

View file

@ -2,6 +2,10 @@ use std::process::Command;
#[test]
fn test_rate_limiting_with_concurrent_requests() {
if !python_available() {
println!("Skipping rate limiting test: Python 3 not available");
return;
}
// Create temp config with max_concurrent_requests = 1
let temp_dir = std::env::temp_dir();
let config_path = temp_dir.join("pollux_test_config.toml");
@ -35,7 +39,7 @@ fn test_rate_limiting_with_concurrent_requests() {
for _ in 0..5 {
let handle = std::thread::spawn(|| {
Command::new("python3")
.arg("tmp/test_rate_limit_python.py")
.arg("tests/gemini_test_client.py")
.arg("--limit")
.arg("1")
.arg("--host")
@ -76,4 +80,12 @@ fn test_rate_limiting_with_concurrent_requests() {
// Verify: 1 success, 4 rate limited
assert_eq!(success_count, 1);
assert_eq!(rate_limited_count, 4);
}
fn python_available() -> bool {
std::process::Command::new("python3")
.arg("--version")
.output()
.map(|output| output.status.success())
.unwrap_or(false)
}