Skip to content

Commit 1b2b787

Browse files
hyperpolymathclaude
andcommitted
fix(regression-tests): replace malformed $REPOS_DIR literal with runtime env lookup
`Path::new("/var$REPOS_DIR/echidna")` was a Rust string literal — the `$REPOS_DIR` shell variable was never expanded, so both baseline tests always skipped with "repo not found" (already #[ignore] so not blocking, but silent false-negative). Replace with `repos_dir()` helper that reads `REPOS_DIR` env var at runtime, defaulting to `/var/mnt/eclipse/repos`. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent c0bbbd4 commit 1b2b787

1 file changed

Lines changed: 13 additions & 7 deletions

File tree

tests/regression_tests.rs

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,25 @@
33
//! Regression tests against known codebases
44
55
use panic_attack::assail;
6-
use std::path::Path;
6+
use std::path::PathBuf;
7+
8+
fn repos_dir() -> PathBuf {
9+
std::env::var("REPOS_DIR")
10+
.map(PathBuf::from)
11+
.unwrap_or_else(|_| PathBuf::from("/var/mnt/eclipse/repos"))
12+
}
713

814
#[test]
915
#[ignore] // Run with --ignored flag, requires repos
1016
fn test_echidna_baseline() {
11-
let echidna_path = Path::new("/var$REPOS_DIR/echidna");
17+
let echidna_path = repos_dir().join("echidna");
1218

1319
if !echidna_path.exists() {
14-
eprintln!("⚠️ Skipping: echidna repo not found");
20+
eprintln!("⚠️ Skipping: echidna repo not found at {:?}", echidna_path);
1521
return;
1622
}
1723

18-
let report = assail::analyze(echidna_path).expect("echidna analysis should succeed");
24+
let report = assail::analyze(&echidna_path).expect("echidna analysis should succeed");
1925

2026
// v0.2 baseline: 15 weak points (down from 271 in v0.1)
2127
assert_eq!(report.language, panic_attack::types::Language::Rust);
@@ -53,14 +59,14 @@ fn test_echidna_baseline() {
5359
#[test]
5460
#[ignore] // Run with --ignored flag, requires repos
5561
fn test_eclexia_baseline() {
56-
let eclexia_path = Path::new("/var$REPOS_DIR/eclexia");
62+
let eclexia_path = repos_dir().join("eclexia");
5763

5864
if !eclexia_path.exists() {
59-
eprintln!("⚠️ Skipping: eclexia repo not found");
65+
eprintln!("⚠️ Skipping: eclexia repo not found at {:?}", eclexia_path);
6066
return;
6167
}
6268

63-
let report = assail::analyze(eclexia_path).expect("eclexia analysis should succeed");
69+
let report = assail::analyze(&eclexia_path).expect("eclexia analysis should succeed");
6470

6571
// v0.2 baseline: 7 weak points
6672
assert_eq!(report.language, panic_attack::types::Language::Rust);

0 commit comments

Comments
 (0)