<feed xmlns='http://www.w3.org/2005/Atom'>
<title>aur-build/testcorpus/git-submodules, branch ai/main</title>
<subtitle>Unnamed repository
</subtitle>
<link rel='alternate' type='text/html' href='http://git.jnsn.dev/cgit/aur-build/'/>
<entry>
<title>tests: make the blanket `allow(dead_code)` in the test tier worth keeping</title>
<updated>2026-11-21T14:01:34+00:00</updated>
<author>
<name>aur-build</name>
<email>aur-build@localhost</email>
</author>
<published>2026-11-21T14:01:34+00:00</published>
<link rel='alternate' type='text/html' href='http://git.jnsn.dev/cgit/aur-build/commit/?id=47f6c6db7faedc292fb55b6637a5f6e292ffcaec'/>
<id>47f6c6db7faedc292fb55b6637a5f6e292ffcaec</id>
<content type='text'>
`tests/common/mod.rs` opened with `#![allow(dead_code)]` and nothing else, which
means it could have been hiding helpers no test called. It was not hiding many —
`upstream2_commit` and nothing else at file scope — but "not many" is not a
check, and the file cannot simply drop the allowance: it is compiled into every
test binary, so a helper one binary uses is dead code in the other twenty and
the lint fires everywhere and means nothing.

So the allowance stays and the check moves up a level. `the_test_helpers_are_used`
reads the file and fails on any `pub` item no test writes, counting a type as
used when a field or method of it is — `Web::raw_request` hands back a `Raw` no
test ever names. `every_fixture_is_referenced` does the same for `testcorpus/`,
which had one entry, `git-submodules`, that no test had ever driven; it is gone.
Both were checked by planting a dead helper and a dead fixture and watching the
suite refuse them.

`tests/dispatch.rs` also carried a function whose entire body was an
`#[allow(dead_code)]` on `fn unused(_: AtomicBool, _: Config) {}` — the deadest
code in the repository, with its two imports behind it.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
`tests/common/mod.rs` opened with `#![allow(dead_code)]` and nothing else, which
means it could have been hiding helpers no test called. It was not hiding many —
`upstream2_commit` and nothing else at file scope — but "not many" is not a
check, and the file cannot simply drop the allowance: it is compiled into every
test binary, so a helper one binary uses is dead code in the other twenty and
the lint fires everywhere and means nothing.

So the allowance stays and the check moves up a level. `the_test_helpers_are_used`
reads the file and fails on any `pub` item no test writes, counting a type as
used when a field or method of it is — `Web::raw_request` hands back a `Raw` no
test ever names. `every_fixture_is_referenced` does the same for `testcorpus/`,
which had one entry, `git-submodules`, that no test had ever driven; it is gone.
Both were checked by planting a dead helper and a dead fixture and watching the
suite refuse them.

`tests/dispatch.rs` also carried a function whose entire body was an
`#[allow(dead_code)]` on `fn unused(_: AtomicBool, _: Config) {}` — the deadest
code in the repository, with its two imports behind it.
</pre>
</div>
</content>
</entry>
<entry>
<title>test: toolchain shims and the fake-package corpus (§16a)</title>
<updated>2026-11-17T21:30:38+00:00</updated>
<author>
<name>aur-build</name>
<email>aur-build@localhost</email>
</author>
<published>2026-11-17T21:30:38+00:00</published>
<link rel='alternate' type='text/html' href='http://git.jnsn.dev/cgit/aur-build/commit/?id=a6f69962e85ccf0f0cfd86f7c85bf0f9a2c8c09e'/>
<id>a6f69962e85ccf0f0cfd86f7c85bf0f9a2c8c09e</id>
<content type='text'>
The harness that makes the rest of this developable. Six real binaries
named exactly like the tools the pipeline shells out to, sharing one
shim module, driven entirely by environment so no production code path
is test-only:

  AUR_SHIM_DIR       where invocations are recorded (jsonl)
  AUR_SHIM_MANIFEST  the fixture manifest to obey
  AUR_SHIM_FAIL      optional tool forced to fail

makechrootpkg emits real .pkg.tar.zst files with .PKGINFO and
.BUILDINFO (the full chroot world, which is why §10.1 filters it),
makepkg answers --printsrcinfo and --vercheck for Stage B, repo-add
rebuilds a gzip'd .db with %FILENAME%/%VERSION%/%SHA256SUM% DESC
entries, gpg writes a detached signature, mkarchroot creates a warm
root. Each one records its invocation so tests assert on what actually
ran.

testcorpus/ holds 17 fixtures, each a PKGBUILD plus a manifest with the
scripted outcome: plain-make, with-patch, install-hooks, skip-checksum,
split-pkgbase, build-fails, check-fails, missing-dep, dep-cycle,
epoch-bump, pkgrel-reset, downgrade, digest-drift, pin-drift,
git-sourced, git-submodules, unresolvable. The harness commits a fixture
into a real git repo standing in for AUR, materialises a local upstream
git repo for VCS fixtures, and swaps payload bytes for the drift cases.

Config.child_env is what puts the shims on PATH for child processes, so
the pipeline runs completely unmodified under test.

Part of P0 (DESIGN.md §17).
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The harness that makes the rest of this developable. Six real binaries
named exactly like the tools the pipeline shells out to, sharing one
shim module, driven entirely by environment so no production code path
is test-only:

  AUR_SHIM_DIR       where invocations are recorded (jsonl)
  AUR_SHIM_MANIFEST  the fixture manifest to obey
  AUR_SHIM_FAIL      optional tool forced to fail

makechrootpkg emits real .pkg.tar.zst files with .PKGINFO and
.BUILDINFO (the full chroot world, which is why §10.1 filters it),
makepkg answers --printsrcinfo and --vercheck for Stage B, repo-add
rebuilds a gzip'd .db with %FILENAME%/%VERSION%/%SHA256SUM% DESC
entries, gpg writes a detached signature, mkarchroot creates a warm
root. Each one records its invocation so tests assert on what actually
ran.

testcorpus/ holds 17 fixtures, each a PKGBUILD plus a manifest with the
scripted outcome: plain-make, with-patch, install-hooks, skip-checksum,
split-pkgbase, build-fails, check-fails, missing-dep, dep-cycle,
epoch-bump, pkgrel-reset, downgrade, digest-drift, pin-drift,
git-sourced, git-submodules, unresolvable. The harness commits a fixture
into a real git repo standing in for AUR, materialises a local upstream
git repo for VCS fixtures, and swaps payload bytes for the drift cases.

Config.child_env is what puts the shims on PATH for child processes, so
the pipeline runs completely unmodified under test.

Part of P0 (DESIGN.md §17).
</pre>
</div>
</content>
</entry>
</feed>
