Skip to content

Commit 3c312c3

Browse files
committed
test: cover recur-git checkpoint lane discovery for agent vaults
1 parent b7e3b03 commit 3c312c3

2 files changed

Lines changed: 55 additions & 0 deletions

File tree

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
"""
2+
Tests for recur-git checkpoint lane coverage
3+
===========================================
4+
5+
Verifies that `recur-git checkpoint --snapshot` surfaces active state for the
6+
agent vault lanes declared in `.recur/config.toml`.
7+
"""
8+
9+
include("runtests.setup.jl")
10+
11+
const RECUR_GIT_BIN = let
12+
repo_root = normpath(joinpath(@__DIR__, ".."))
13+
ext = Sys.iswindows() ? ".exe" : ""
14+
debug_bin = joinpath(repo_root, "target", "debug", "recur-git" * ext)
15+
release_bin = joinpath(repo_root, "target", RECUR_PROFILE, "recur-git" * ext)
16+
isfile(debug_bin) ? debug_bin : release_bin
17+
end
18+
19+
function run_recur_git(args::Vector{String})
20+
repo_root = normpath(joinpath(@__DIR__, ".."))
21+
display_cmd = join(map(arg -> contains(arg, ' ') ? "\"$arg\"" : arg, args), " ")
22+
println(" -> recur-git $display_cmd")
23+
24+
cmd = Cmd(`$RECUR_GIT_BIN $args`, dir=repo_root)
25+
out = IOBuffer()
26+
err = IOBuffer()
27+
success = true
28+
29+
try
30+
run(pipeline(cmd, stdout=out, stderr=err))
31+
catch e
32+
if isa(e, ProcessFailedException)
33+
success = false
34+
else
35+
return (false, "", "Error running command: $e")
36+
end
37+
end
38+
39+
return (success, String(take!(out)), String(take!(err)))
40+
end
41+
42+
@testset "recur-git checkpoint lane coverage" begin
43+
log_section("Testing: recur-git checkpoint lane coverage")
44+
45+
@testset "checkpoint snapshot includes active agent vault lanes" begin
46+
_, output, error_output = run_recur_git(["checkpoint", "--snapshot"])
47+
snapshot_text = output * error_output
48+
49+
@test contains(snapshot_text, "lane.state.skippy1.current:")
50+
@test contains(snapshot_text, "lane.state.skippy2.current:")
51+
@test contains(snapshot_text, "lane.state.test-monkey.current:")
52+
@test contains(snapshot_text, "lane.state.git-monkey.current:")
53+
end
54+
end

julia-tests/runtests.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ try
5959
include("main.command.reveal.test.jl") # IMPROVEMENT22 - lane-local reveal helpers
6060
include("main.command.lane.test.jl") # IMPROVEMENT21 - named lane scaffolding (recur lane)
6161
include("main.lane.coordination.trace-id.test.jl") # IMPROVEMENT21+22 - trace-id as lane handoff contract
62+
include("main.recur-git.checkpoint.lanes.test.jl") # Checkpoint snapshot lane coverage for active agent vaults
6263

6364
# TODO: Add more test modules as they are implemented
6465
include("main.command.trace-stats.test.jl") # IMPROVEMENT7 - Statistical analysis of call graphs (phase3 bootstrap)

0 commit comments

Comments
 (0)