From 889c15649095e5a12ce431e2cbf73b47062d4c7d Mon Sep 17 00:00:00 2001 From: Kyosuke Fujimoto Date: Fri, 4 Sep 2026 07:51:25 +0900 Subject: [PATCH] Make graph test repository dumps opt-in --- src/tests/graph.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/tests/graph.rs b/src/tests/graph.rs index d454931..e8f1b53 100644 --- a/src/tests/graph.rs +++ b/src/tests/graph.rs @@ -13,6 +13,8 @@ type TestResult = Result<(), Box>; const OUTPUT_DIR: &str = "./out/graph"; const SNAPSHOT_DIR: &str = "./tests/graph"; +// Set this environment variable when Git repository output is needed for graph test debugging. +const DUMP_GRAPH_TEST_REPOS_ENV: &str = "SERIE_TEST_DUMP_GRAPH_REPOS"; #[test] fn straight_001() -> TestResult { @@ -1506,6 +1508,10 @@ fn create_output_dirs(path: &str) { } fn copy_git_dir(path: &Path, name: &str) { + if std::env::var_os(DUMP_GRAPH_TEST_REPOS_ENV).is_none() { + return; + } + let dst_path = format!("{OUTPUT_DIR}/{name}"); // dircpy overwrite doesn't seem to work as expected, so delete explicitly if Path::new(&dst_path).is_dir() {