releasebundletest

package
v0.9.15 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package releasebundletest builds fixture release bundles (a staged Apple/Android artifact directory plus a matching fixture git repo root) shared by internal/releasebundle's own tests and cmd/release-artifact-gate's end-to-end subprocess test. It is a normal, exported package (not a _test.go file) precisely so both can import it without duplicating fixture-construction logic.

Index

Constants

View Source
const (
	OpenFHEVersion = "v1.5.1"
	OpenFHECommit  = "1306d14f8c26bb6150d3e6ad54f28dfe1007689e"

	// AppleMACOSDeploymentTarget is the fixture repo's declared macOS
	// deployment target and the default value NewBundle's Apple staging
	// manifest records -- both must agree for the zero-value Opts to
	// build a gate-accepted bundle.
	AppleMACOSDeploymentTarget = "14.0"

	ValidSwiftReleaseManifest = `` /* 458-byte string literal not displayed */

)

Variables

This section is empty.

Functions

func InstallPATHShadowOtool

func InstallPATHShadowOtool(t testing.TB) string

InstallPATHShadowOtool puts a marker-reading fake otool first on PATH. Adversarial subprocess tests use it to prove the production CLI ignores PATH and invokes only the fixed trusted system tool.

func NewBundle

func NewBundle(t testing.TB, opts Opts) (bundleDir, repoRoot string)

NewBundle builds a complete, self-consistent staged bundle directory (Apple + Android artifact/sbom/provenance/staging-manifest) and a matching fixture repo root, per opts.

func NewRepoRoot

func NewRepoRoot(t testing.TB, swiftManifest string) (repoRoot, commit string)

NewRepoRoot creates a real, tiny, committed git repository shaped like enough of ARES-core for releasebundle to read: the two pin files and clients/swift/Package.release.swift. It returns the repo root and the exact commit it committed.

func ReplaceAppleMacOSLibrary

func ReplaceAppleMacOSLibrary(t testing.TB, bundleDir, libraryPath string)

ReplaceAppleMacOSLibrary rewrites the canonical macOS archive member and refreshes the Apple staging manifest hash. It is used only by Darwin-scoped production CLI tests that compile a tiny real Mach-O archive.

func TamperFile

func TamperFile(t testing.TB, path string)

TamperFile appends bytes to the file at path, invalidating any previously-computed hash of it. Exported so mutation tests in other packages (e.g. cmd/release-artifact-gate's end-to-end test) can simulate a corrupted/substituted staged artifact without reaching into this package's internals.

Types

type Opts

type Opts struct {
	AppleSlices                         []string
	AndroidABIs                         []string
	AndroidLibsOverride                 map[string][]string // abi -> lib list; overrides the default full set for that ABI only
	AresRevOverride                     string              // if set, used for BOTH platform manifests instead of the fixture repo's real HEAD
	AndroidAresRevOverride              string              // if set, used only for the android manifest (creates a cross-platform mismatch)
	AndroidOpenFHEVersionOverride       string              // if set, used only for the android manifest
	SwiftManifestOverride               string              // if set, replaces Package.release.swift content
	AppleMACOSDeploymentTargetOverride  string              // if set, used instead of AppleMACOSDeploymentTarget in the Apple manifest
	AppleMachOMinosOverride             string              // if set, encoded in the canonical macOS library for the hermetic otool fixture
	AppleDecoyFirstMachOMinos           string              // if set, adds a matching-looking decoy before the canonical macOS library
	AppleExtraZipMembers                []string            // additional member names used by ZIP-name mutation tests
	AppleNonUTF8ZipMember               string              // additional member whose ZIP NonUTF8 flag is set
	AppleSymlinkZipMember               string              // additional member encoded as a symbolic link
	OmitCanonicalAppleMacOSLibrary      bool                // if set, only headers (and any requested decoy) are staged for macos-arm64
	DuplicateCanonicalAppleMacOSLibrary bool                // if set, writes the exact canonical member twice
}

Opts controls what NewBundle builds, so mutation tests can request a deliberately broken fixture instead of hand-corrupting zip bytes after the fact. The zero value builds a complete, valid, gate-accepted bundle.

Jump to

Keyboard shortcuts

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