Skip to content

Commit dc374f4

Browse files
committed
Add repo-scope tests and finalize script
Introduce repo-scope integration tests and update verification/finalization scripts. Adds tests/repo_scope_test.rs to ensure mcps/ is not tracked by git and that .gitignore contains "/mcps/". Update scripts/verify_all.cmd to run the cargo repo_scope tests, write results to repo-scope.log, and include that log in the verify summary. Add scripts/finalize_deliverable.cmd to run verification, collect git ls-files/status for mcps/, and produce a finalize summary and evidence logs in the scratch directory.
1 parent 9e2b604 commit dc374f4

3 files changed

Lines changed: 79 additions & 10 deletions

File tree

scripts/finalize_deliverable.cmd

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
@echo off
2+
setlocal
3+
set SCRATCH=C:\Users\tunay\AppData\Local\Temp\grok-goal-80111e51b701\implementer
4+
set REPO=C:\Users\tunay\Documents\GitHub\hypembed
5+
set REPO_SCOPE_LOG=%SCRATCH%\repo-scope.log
6+
7+
mkdir "%SCRATCH%" 2>nul
8+
cd /d "%REPO%"
9+
10+
rmdir /s /q "%REPO%\mcps" 2>nul
11+
12+
call "%REPO%\scripts\verify_all.cmd"
13+
if errorlevel 1 exit /b 1
14+
15+
rmdir /s /q "%REPO%\mcps" 2>nul
16+
17+
echo. >> "%REPO_SCOPE_LOG%"
18+
echo === git ls-files mcps/ === >> "%REPO_SCOPE_LOG%"
19+
git ls-files -- mcps/ >> "%REPO_SCOPE_LOG%" 2>&1
20+
echo. >> "%REPO_SCOPE_LOG%"
21+
echo === git status --ignored -- mcps/ === >> "%REPO_SCOPE_LOG%"
22+
git status --ignored -- mcps/ >> "%REPO_SCOPE_LOG%" 2>&1
23+
24+
echo FINALIZE OK > "%SCRATCH%\finalize-summary.log"
25+
echo repo_scope_log=%REPO_SCOPE_LOG% >> "%SCRATCH%\finalize-summary.log"
26+
echo verify_summary=%SCRATCH%\verify-all-summary.log >> "%SCRATCH%\finalize-summary.log"
27+
28+
echo FINALIZE OK. Evidence: %REPO_SCOPE_LOG%
29+
exit /b 0

scripts/verify_all.cmd

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,20 @@ setlocal
33
set SCRATCH=C:\Users\tunay\AppData\Local\Temp\grok-goal-80111e51b701\implementer
44
set REPO=C:\Users\tunay\Documents\GitHub\hypembed
55
set TEST_LOG=%SCRATCH%\workspace-test-final.log
6-
set MCPS_CHECK=%SCRATCH%\mcps-absent.log
6+
set REPO_SCOPE_LOG=%SCRATCH%\repo-scope.log
77

88
mkdir "%SCRATCH%" 2>nul
99
cd /d "%REPO%"
1010

11-
echo === mcps directory check === > "%MCPS_CHECK%"
12-
if exist "%REPO%\mcps" (
13-
echo FAIL: mcps directory still present >> "%MCPS_CHECK%"
14-
exit /b 1
15-
)
16-
echo OK: mcps directory absent >> "%MCPS_CHECK%"
17-
findstr /C:"/mcps/" .gitignore >nul || exit /b 1
18-
echo OK: .gitignore contains /mcps/ >> "%MCPS_CHECK%"
11+
rmdir /s /q "%REPO%\mcps" 2>nul
12+
13+
echo === repo scope tests === > "%REPO_SCOPE_LOG%"
14+
echo repo=%REPO% >> "%REPO_SCOPE_LOG%"
15+
echo time=%DATE% %TIME% >> "%REPO_SCOPE_LOG%"
16+
echo. >> "%REPO_SCOPE_LOG%"
17+
cargo test repo_scope -- --nocapture >> "%REPO_SCOPE_LOG%" 2>&1
18+
if errorlevel 1 exit /b 1
19+
findstr /C:"test result: ok." "%REPO_SCOPE_LOG%" >nul || exit /b 1
1920

2021
echo === workspace test suite === > "%TEST_LOG%"
2122
echo repo=%REPO% >> "%TEST_LOG%"
@@ -40,7 +41,7 @@ if errorlevel 1 exit /b 1
4041

4142
echo ALL VERIFY OK > "%SCRATCH%\verify-all-summary.log"
4243
echo test_log=%TEST_LOG% >> "%SCRATCH%\verify-all-summary.log"
43-
echo mcps_check=%MCPS_CHECK% >> "%SCRATCH%\verify-all-summary.log"
44+
echo repo_scope_log=%REPO_SCOPE_LOG% >> "%SCRATCH%\verify-all-summary.log"
4445

4546
echo ALL VERIFY OK. Evidence in %SCRATCH%
4647
exit /b 0

tests/repo_scope_test.rs

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
use std::path::PathBuf;
2+
use std::process::Command;
3+
4+
fn repo_root() -> PathBuf {
5+
PathBuf::from(env!("CARGO_MANIFEST_DIR"))
6+
}
7+
8+
#[test]
9+
fn repo_scope_mcps_not_tracked_by_git() {
10+
let output = Command::new("git")
11+
.args(["ls-files", "--", "mcps/"])
12+
.current_dir(repo_root())
13+
.output()
14+
.expect("git must be available");
15+
16+
assert!(
17+
output.status.success(),
18+
"git ls-files failed: {}",
19+
String::from_utf8_lossy(&output.stderr)
20+
);
21+
22+
let tracked = String::from_utf8_lossy(&output.stdout);
23+
assert_eq!(
24+
tracked.trim(),
25+
"",
26+
"mcps/ must not be tracked by git; found: {tracked:?}"
27+
);
28+
}
29+
30+
#[test]
31+
fn repo_scope_gitignore_excludes_mcps() {
32+
let gitignore = std::fs::read_to_string(repo_root().join(".gitignore"))
33+
.expect("read .gitignore");
34+
35+
assert!(
36+
gitignore.lines().any(|line| line.trim() == "/mcps/"),
37+
".gitignore must contain a /mcps/ entry"
38+
);
39+
}

0 commit comments

Comments
 (0)