Skip to content

Commit 5ae4abd

Browse files
authored
ci: build the binary's tests, which nothing did (#67)
`cargo test` did not compile on main. The `sync ls --json` schema test in `src/main.rs` builds a `SyncEntryStatus` literally, and #61 added a `sweep` field to that struct without updating it, so the bin test target failed with E0063. CI stayed green through all of it, because the workflow runs `--lib` and three named integration targets and never builds the binary's own tests. So the gap is not the missing field. The gap is that a test could stop COMPILING and every check still passed. FIXING THE COMPILE ERROR THEN EXPOSED A REAL FAILURE, which is the point. `sync_ls_json_schema_exposes_counts_and_drift` pins the exact JSON of `fabric sync ls --json`. #61 added `sweep` to that output. The test that exists to catch a wire-schema change did not catch it, because it had not run since before the change. I WATCHED THE NEW CHECK FAIL. `cargo test --bins` failed on the compile error, then failed again on the schema assertion with `sweep` present on the left and absent on the right, then passed once the expectation carried the field. That is the positive control, in this order, on this machine. Two changes, and they belong together because either alone leaves the hole open: the expectation now carries `sweep`, and the workflow now runs `cargo test --locked --bins`. Verified on macOS 15 arm64. 12 bin tests pass. Linux is CI's to confirm. Agent: Silber.fabric
1 parent 216bc9d commit 5ae4abd

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

.github/workflows/test.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@ jobs:
2424
- name: Library and model tests
2525
run: timeout 10m cargo test --locked --lib
2626

27+
# The binary's own tests were never built here, so a test in src/main.rs
28+
# could stop COMPILING and this workflow stayed green. One had: the
29+
# `sync ls --json` schema test missed the `sweep` field added in #61.
30+
- name: Binary tests
31+
run: timeout 5m cargo test --locked --bins
32+
2733
- name: Deterministic fake two-machine folder sync
2834
run: >-
2935
timeout 5m cargo test --locked --lib

src/main.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1147,6 +1147,7 @@ mod sync_ls_tests {
11471147
full_scans: 17,
11481148
inbound_noop_transactions: 11,
11491149
inbound_guarded_transactions: 3,
1150+
sweep: "disabled".to_string(),
11501151
}
11511152
}
11521153

@@ -1170,7 +1171,8 @@ mod sync_ls_tests {
11701171
"mismatched": 0,
11711172
"full_scans": 17,
11721173
"inbound_noop_transactions": 11,
1173-
"inbound_guarded_transactions": 3
1174+
"inbound_guarded_transactions": 3,
1175+
"sweep": "disabled"
11741176
})
11751177
);
11761178
}

0 commit comments

Comments
 (0)