ci

package
v0.1.0-preview.1 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2026 License: MPL-2.0 Imports: 6 Imported by: 0

README

CI (unit testing)

This README describes how the core GitHub Actions CI provides Wander with continuous integration testing.

Release artifact checks

The build workflow verifies that every release archive contains exactly one Wander executable built with the embedded UI, the Wander license, generated Go dependency material, and the retained browser notices. The same notice bundle is installed into OCI images and native Linux packages. Its Linux AMD64 job additionally:

  1. exercises the root redirect, UI assets, API, CSP, and disabled-UI behavior;
  2. starts a clean three-server Wander cluster and performs a rolling restart;
  3. rolls a Nomad 1.6.5 cluster forward to Wander and back to Nomad 1.6.5; and
  4. verifies persisted state after every server replacement.

The compatibility baseline is downloaded from HashiCorp's release service and checked against a pinned SHA-256 digest before use. The rehearsal itself is ci/rehearse-release-lifecycle.sh; it accepts the Wander archive and Nomad 1.6.5 archive as arguments, so the same check can be run against local release artifacts.

License boundary check

The security job runs ci/check-license-boundary.sh before dependency scans. It rejects implementation files containing BUSL 1.1 or Business Source License headers. It also verifies that consul-template's optional Vault Kubernetes authentication dependency resolves to the approved MPL-2.0 v0.4.1 release, rather than the BUSL-1.1 v0.5.0 requested transitively, and rejects the incompletely licensed go-spin package from the embedded-UI release closure. These checks prevent accidental reintroduction of the known prohibited boundary, but do not replace the provenance review recorded in docs/plans/license-provenance-audit.md.

Steps

  1. When a branch is pushed, GHA triggers .github/workflows/test-core.yaml.

  2. The first job is mods which creates a pre-cache of Go modules.

  • Only useful for the followup jobs on Linux runners
  • Is keyed on hash(go.sum), so a cache is re-used until deps are modified.
  1. The checks, test-api, test-* jobs are started.
  • The checks job runs make check
  • The test job runs groups of tests, see below

3i. The check step also runs make missing

  • Invokes tools/missing to scan ci/test-core.json and the Wander source.
  • Fails the build if any packages in Nomad are not covered.

4a. The test-* jobs are run.

  • Configured as a matrix of "groups"; each group is a set of packages.
  • The GHA invokes test-wander with $GOTEST_GROUP for each group.
  • The makefile uses tools/missing to translate the group into packages
  • Package groups are configured in ci/test-core.json

4b. The test-api job is run.

  • Because api is a submodule, invokation of test command is special.
  • The GHA invokes test-wander-module with the name of the submodule.
  1. The compile jobs are run
  • Waits on checks to complete first
  • Runs on each of linux, macos, windows

Documentation

Index

Constants

This section is empty.

Variables

View Source
var PortAllocator = portal.New(
	new(fatalTester),
	portal.WithAddress("127.0.0.1"),
)

PortAllocator is used to acquire unused ports for testing real network listeners.

View Source
var TinyChroot = map[string]string{

	"/usr/bin/sleep": "/bin/sleep",
	"/usr/bin/dash":  "/bin/sh",
	"/usr/bin/bash":  "/bin/bash",
	"/usr/bin/cat":   "/bin/cat",

	"/usr/bin/stty":   "/usr/bin/stty",
	"/usr/bin/head":   "/usr/bin/head",
	"/usr/bin/mktemp": "/usr/bin/mktemp",
	"/usr/bin/echo":   "/usr/bin/echo",
	"/usr/bin/touch":  "/usr/bin/touch",
	"/usr/bin/stat":   "/usr/bin/stat",

	"/etc/ld.so.cache":  "/etc/ld.so.cache",
	"/etc/ld.so.conf":   "/etc/ld.so.conf",
	"/etc/ld.so.conf.d": "/etc/ld.so.conf.d",
	"/etc/passwd":       "/etc/passwd",
	"/etc/resolv.conf":  "/etc/resolv.conf",

	"/lib":                 "/lib",
	"/lib32":               "/lib32",
	"/lib64":               "/lib64",
	"/usr/lib/jvm":         "/usr/lib/jvm",
	"/run/resolvconf":      "/run/resolvconf",
	"/run/systemd/resolve": "/run/systemd/resolve",
}

TinyChroot is useful for testing, where we do not use anything other than trivial /bin commands like sleep and sh. Copying a minimal chroot helps in environments like GHA with very poor [network] disk performance.

Note that you cannot chroot a symlink.

Do not modify this value.

Functions

func Parallel

func Parallel(t *testing.T)

Parallel runs t in parallel, unless CI is set to a true value.

In CI (CircleCI / GitHub Actions) we get better performance by running tests in serial while not restricting GOMAXPROCS.

func SkipSlow

func SkipSlow(t *testing.T, reason string)

SkipSlow skips a slow test unless NOMAD_SLOW_TEST is set to a true value.

func SkipTestWithoutRootAccess

func SkipTestWithoutRootAccess(t *testing.T)

SkipTestWithoutRootAccess will skip test t if it's not running in CI environment and test is not running with Root access.

Types

This section is empty.

Jump to

Keyboard shortcuts

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