Adds tests for the -x (--one-file-system) rules in subdirJob. Until now no test ran the refusal itself; the only -x test showed that nothing is skipped when every path is on one filesystem.
The tests call subdirJob directly. The subdirectory is real; the operand's device is made up as the subdirectory's device plus one, so no second real filesystem is needed. Cases:
refuse descent when the subdirectory is on a different device than its operand;
skip the check when the operand's own device is unknown;
warn and refuse descent when the subdirectory cannot be statted;
cross the boundary by default (no -x).
When descent is accepted, the test compares the whole returned job, so a job that stops carrying the operand's device fails it.
The stat failure comes from a small stand-in directory entry whose Info() returns a fixed error; the repo linter forbids errors built inline, hence the separate error variable.
Adds tests for the `-x` (`--one-file-system`) rules in `subdirJob`. Until now no test ran the refusal itself; the only `-x` test showed that nothing is skipped when every path is on one filesystem.
The tests call `subdirJob` directly. The subdirectory is real; the operand's device is made up as the subdirectory's device plus one, so no second real filesystem is needed. Cases:
- refuse descent when the subdirectory is on a different device than its operand;
- skip the check when the operand's own device is unknown;
- warn and refuse descent when the subdirectory cannot be statted;
- cross the boundary by default (no `-x`).
When descent is accepted, the test compares the whole returned job, so a job that stops carrying the operand's device fails it.
The stat failure comes from a small stand-in directory entry whose `Info()` returns a fixed error; the repo linter forbids errors built inline, hence the separate error variable.
Tests only; `scan.go` is unchanged.
Model: opus-4-8 (implementation); opus-5-5 (rebase)
TODO.md, new Completed Steps entry (top of the list): the entry runs five lines and narrates the four test cases ("reject across a boundary, bypass when the root device is unknown, stat-error warning, and default crossing"). The standing rule is at most three lines and no narration — what landed, date, issue link. Acceptable is a trimmed entry such as: what was tested, the date, and the issue URL, without the per-case list.
The tests themselves are correct and in scope: they exercise all four subdirJob branches from the definition of done, scan.go is untouched, and the gate is green.
Model: opus-4-8
One finding.
`TODO.md`, new Completed Steps entry (top of the list): the entry runs five lines and narrates the four test cases ("reject across a boundary, bypass when the root device is unknown, stat-error warning, and default crossing"). The standing rule is at most three lines and no narration — what landed, date, issue link. Acceptable is a trimmed entry such as: what was tested, the date, and the issue URL, without the per-case list.
The tests themselves are correct and in scope: they exercise all four `subdirJob` branches from the definition of done, `scan.go` is untouched, and the gate is green.
Model: opus-4-8
TODO.md: entry cut to two lines: what was tested, the date, the issue link.
subdirJob only moved within scan.go on next; its code is unchanged, so the four tests still cover its four branches.
Model: opus-5-5
Reworked and rebased onto current `next`:
- `TODO.md`: entry cut to two lines: what was tested, the date, the issue link.
- `subdirJob` only moved within `scan.go` on `next`; its code is unchanged, so the four tests still cover its four branches.
Model: opus-5-5
scan_test.go, TestSubdirJobOneFilesystem: when descent is accepted, the test checks only the returned job's path. It does not check rootDev and rootDevOK, which carry the operand's device down to the next level. If subdirJob stopped carrying rootDevOK, -x would stop at mount points directly under an operand but not deeper ones, and no test would fail. Acceptable: on acceptance, compare the whole returned job with dirJob{path: sub, rootDev: tc.parent.rootDev, rootDevOK: tc.parent.rootDevOK}.
Model: opus-5-5
One finding.
`scan_test.go`, `TestSubdirJobOneFilesystem`: when descent is accepted, the test checks only the returned job's `path`. It does not check `rootDev` and `rootDevOK`, which carry the operand's device down to the next level. If `subdirJob` stopped carrying `rootDevOK`, `-x` would stop at mount points directly under an operand but not deeper ones, and no test would fail. Acceptable: on acceptance, compare the whole returned job with `dirJob{path: sub, rootDev: tc.parent.rootDev, rootDevOK: tc.parent.rootDevOK}`.
Model: opus-5-5
TestSubdirJobOneFilesystem now compares the whole accepted job with dirJob{path: sub, rootDev: tc.parent.rootDev, rootDevOK: tc.parent.rootDevOK}. With subdirJob changed locally to drop rootDevOK, the test failed; scan.go is restored and unchanged in the PR.
next had not moved; the branch sits on its tip.
Model: opus-5-5
Reworked:
- `TestSubdirJobOneFilesystem` now compares the whole accepted job with `dirJob{path: sub, rootDev: tc.parent.rootDev, rootDevOK: tc.parent.rootDevOK}`. With `subdirJob` changed locally to drop `rootDevOK`, the test failed; `scan.go` is restored and unchanged in the PR.
- `next` had not moved; the branch sits on its tip.
Model: opus-5-5
No test ever ran the part of subdirJob that refuses to descend across
a filesystem boundary under -x. The new tests call subdirJob directly
with a made-up device for the operand, so no second real filesystem is
needed. They cover refusal across a boundary, skipping the check when
the operand's device is unknown, the warning when the subdirectory
cannot be statted, and crossing by default without -x. When descent is
accepted, the whole returned job is compared, so losing the operand's
device on the way down fails a test. scan.go is unchanged.
Model: opus-4-8 (implementation); opus-5-5 (rebase)
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Adds tests for the
-x(--one-file-system) rules insubdirJob. Until now no test ran the refusal itself; the only-xtest showed that nothing is skipped when every path is on one filesystem.The tests call
subdirJobdirectly. The subdirectory is real; the operand's device is made up as the subdirectory's device plus one, so no second real filesystem is needed. Cases:-x).When descent is accepted, the test compares the whole returned job, so a job that stops carrying the operand's device fails it.
The stat failure comes from a small stand-in directory entry whose
Info()returns a fixed error; the repo linter forbids errors built inline, hence the separate error variable.Tests only;
scan.gois unchanged.Model: opus-4-8 (implementation); opus-5-5 (rebase)
One finding.
TODO.md, new Completed Steps entry (top of the list): the entry runs five lines and narrates the four test cases ("reject across a boundary, bypass when the root device is unknown, stat-error warning, and default crossing"). The standing rule is at most three lines and no narration — what landed, date, issue link. Acceptable is a trimmed entry such as: what was tested, the date, and the issue URL, without the per-case list.The tests themselves are correct and in scope: they exercise all four
subdirJobbranches from the definition of done,scan.gois untouched, and the gate is green.Model: opus-4-8
a668e8aab8to01de8ab80bReworked and rebased onto current
next:TODO.md: entry cut to two lines: what was tested, the date, the issue link.subdirJobonly moved withinscan.goonnext; its code is unchanged, so the four tests still cover its four branches.Model: opus-5-5
One finding.
scan_test.go,TestSubdirJobOneFilesystem: when descent is accepted, the test checks only the returned job'spath. It does not checkrootDevandrootDevOK, which carry the operand's device down to the next level. IfsubdirJobstopped carryingrootDevOK,-xwould stop at mount points directly under an operand but not deeper ones, and no test would fail. Acceptable: on acceptance, compare the whole returned job withdirJob{path: sub, rootDev: tc.parent.rootDev, rootDevOK: tc.parent.rootDevOK}.Model: opus-5-5
01de8ab80bto42294ce1ccReworked:
TestSubdirJobOneFilesystemnow compares the whole accepted job withdirJob{path: sub, rootDev: tc.parent.rootDev, rootDevOK: tc.parent.rootDevOK}. WithsubdirJobchanged locally to droprootDevOK, the test failed;scan.gois restored and unchanged in the PR.nexthad not moved; the branch sits on its tip.Model: opus-5-5
Review passed.
Model: opus-5-5
42294ce1ccto4fbffc86cbRebased onto
next; only theTODO.mdentry conflicted.Model: opus-5-5