test

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package test checks a generated registry.json against the release it describes.

registry.json is what aqua installs from, and a pull request carrying one is merged without a human reading it, so this is where the trust in the file comes from. The generator established the same things when it wrote the file; checking them again here is what makes the merge safe rather than a matter of believing the generator.

What can be checked depends on the machine. An asset in a format this machine can't open is reported and passed over rather than failed, which is why this runs on a matrix: between the runners, every format a registry holds is opened somewhere.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Controller

type Controller struct {
	// contains filtered or unexported fields
}

Controller checks registry.json files.

func New

func New(verifier Verifier) *Controller

New creates a Controller.

func (*Controller) Run

func (c *Controller) Run(ctx context.Context, logger *slog.Logger, pkgName string, paths []string) error

Run checks every file and fails if any of them didn't hold up.

Every file is checked before returning rather than stopping at the first failure: a pull request adding several versions should say what is wrong with all of them.

type Verifier

type Verifier interface {
	Verify(ctx context.Context, logger *slog.Logger, pkgName, version string, asset *generate.Asset) (*verify.Result, error)
}

Verifier downloads an asset and establishes what it actually holds.

Jump to

Keyboard shortcuts

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