The packaging tier held two kinds of assertion joined only by an expensive shared setup: the shape of the packed tarball and its manifest, and the behaviour of the resulting installed binary. Split them, and teach the second to take the binary it drives from GITEA_AXI_INSTALLED_BIN. When that variable names an existing binary the tier drives it and skips pack-and-install entirely; unset, it packs and installs exactly as before. The installed-binary facet becomes one seam with two callers — the npm distribution path today, the Nix installation path in task 0038 — so the two cannot drift apart in what they guarantee about an installed gitea-axi. Nothing in it may assert on how the binary came to exist, since store paths, wrapper internals, and the arrangement of the installed tree are implementation detail of the installation method. The tarball assertions stay npm-only: no other distribution method produces a tarball or a packed manifest.
23 lines
1001 B
TypeScript
23 lines
1001 B
TypeScript
import { defineConfig } from "vitest/config";
|
|
|
|
export default defineConfig({
|
|
test: {
|
|
// The packaging tier, in two facets. `tarball` asserts the shape of the
|
|
// packed npm tarball and its manifest; `installed-binary` drives an
|
|
// installed gitea-axi, either one named by GITEA_AXI_INSTALLED_BIN or one
|
|
// it packs and installs itself. It builds, packs, and fetches runtime deps
|
|
// from the registry, so it is far slower than the fast tiers and runs on
|
|
// its own via `test:pack`. Distribution touches no Gitea API, so this smoke
|
|
// test is the distribution analogue of the live-Gitea e2e tier rather than
|
|
// a member of it.
|
|
include: ["test/packaging/**/*.test.ts"],
|
|
testTimeout: 180_000,
|
|
hookTimeout: 300_000,
|
|
// Each facet's setup may run `npm pack` against the one shared project
|
|
// root, whose `prepack` writes `dist/`; serialize the files so two builds
|
|
// cannot race on it.
|
|
fileParallelism: false,
|
|
passWithNoTests: true,
|
|
},
|
|
});
|