buildcheck

package
v1.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 14, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package buildcheck holds pre-flight checks shared by the test suites under test/ that run the built bin/gopherstack-linux binary in a container (test/terraform and test/integration).

Index

Constants

This section is empty.

Variables

View Source
var ErrStaleBinary = errors.New("bin/gopherstack-linux is stale")

ErrStaleBinary means bin/gopherstack-linux predates a .go file that builds into it. Dockerfile.test serves that gitignored binary as-is (gopherstack-ydop): a stale one makes container-backed tests silently validate old code and report a false result -- a real fix looks like "still broken" and a real revert looks like "no change".

Functions

func CheckFreshness

func CheckFreshness(logger *slog.Logger, binInfo fs.FileInfo, repoRoot string) error

CheckFreshness fails loudly when any .go file under services/, pkgs/, or the root package is newer than the already-stat'd bin/gopherstack-linux. repoRoot is the caller's relative path from its own package directory (where `go test` sets CWD) to the repository root -- "../.." for a package living one directory below test/ (test/terraform, test/integration), "../../.." for one living two directories below it (test/terraform/azure), and so on. There is no single constant that works for every caller, which is exactly the bug this parameter fixes: an earlier hardcoded "../.." silently resolved to the wrong directory (and therefore a bogus "walking test/terraform/services: no such file or directory" error) for test/terraform/azure.

Skipped in CI: the build job for these suites compiles the binary fresh from the exact commit under test, moments before this check would run. That guarantee comes from the job graph (ci.yml's `needs: [build]`), not from filesystem mtimes -- and mtimes are not a reliable signal across an artifact upload/download round-trip, so comparing them here could turn into exactly the permanent CI failure this check must not become.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL