test/

directory
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2026 License: AGPL-3.0

README

test/

Cross-cutting test assets that do not belong next to a single Go package:

  • test/integration/ — end-to-end harness that boots the server with a temp SQLite + embedded NATS, registers a mock worker, and runs a real OpenJD job; also holds the real-directory (LDAP), real-provider (OIDC) and real-root (run-as-user isolation) suites
  • test/conformance/ — the official OpenJD conformance suite run against the vendored third_party/ fixtures (build tag conformance; make test-conformance)
  • test/oracle/ — the EXPR differential test against the OpenJD reference implementation, plus its corpus and adjudicated baseline (build tag oracle; make test-expr-oracle)

Unit tests live next to the code they cover (_test.go files), not here.

The end-to-end smoke script used by release verification is scripts/smoke.sh (run it via make smoke), not a directory under test/.

Build tags

The untagged files in test/integration/ run with make test. Files behind the integration build tag run only with make test-integration or one of the dedicated targets below.

Two of these suites talk to a real external identity source rather than a fake, and both skip, rather than fail, when Docker is absent. A skip verifies nothing, so confirm they ran (GOFLAGS=-count=1, and look for --- PASS) after touching the code they cover.

LDAP: ldap_test.go

test/integration/ldap_test.go (tag integration) runs against a real directory. Every other LDAP test drives a fake connection, which cannot catch a mistake in go-ldap wire usage: a wrong search scope, a misnamed attribute, a filter a real server rejects, or a server answering an unsupported request in a way no fake would imitate.

make test-ldap    # boots a throwaway OpenLDAP container; needs Docker

Skips cleanly when Docker is absent. SQI_TEST_LDAP_URL points it at a directory you already have (including a real Active Directory) instead of starting a container; that directory must hold the tree in the file's seedLDIF constant.

It runs in CI on every change (ldap-integration, on both amd64 and arm64 because the image's variants differ). It guards against server behavior no fake reproduces: OpenLDAP answers the AD-only nested-group matching rule with success and zero entries, which, if mishandled, silently demotes users to default_role. See docs/auth.md § "How this is tested".

OIDC / SSO: oidc_test.go

test/integration/oidc_test.go (tag integration) runs the SSO login path against a real Keycloak. The unit tests drive a fake provider that signs real tokens, so a validation mistake surfaces there, but a fake returns whatever the test asks for, so it cannot show what a real provider omits. Keycloak emits no group membership without a protocol mapper configured for it, and a token with no groups still validates: every user silently lands on default_role.

make test-oidc    # boots a throwaway Keycloak container; needs Docker

SQI_TEST_OIDC_ISSUER points it at a realm you already have instead of starting a container; that realm must hold the fixture the file seeds, and the tests that mutate the fixture skip under it. The image tag is pinned, because the tests scrape Keycloak's login and logout-confirmation markup, and must stay in step with the docker pull in .github/workflows/ci.yml.

It runs in CI on every change (oidc-integration), on one architecture rather than two: no arch-specific divergence is known for a JVM application whose HTTP and token behavior is all this job asserts on.

It also pins the vendor behavior the logout design rests on, including that Keycloak answers an id_token_hint-less end-session request with an interactive confirmation page and keeps its session live behind it. See docs/auth.md § "Provider logout is weaker than it looks".

Directories

Path Synopsis
Package chaos holds the Go-test entry point of the chaos suite: it runs every built-in chaos-* scenario (internal/loadtest/scenario/library) end to end against a real sqi-server, with simulated workers and real sqi-worker processes, while the scenario's faults kill, stall and cut them, and fails on any invariant the run breaks that the scenario does not expect.
Package chaos holds the Go-test entry point of the chaos suite: it runs every built-in chaos-* scenario (internal/loadtest/scenario/library) end to end against a real sqi-server, with simulated workers and real sqi-worker processes, while the scenario's faults kill, stall and cut them, and fails on any invariant the run breaks that the scenario does not expect.
Package conformance runs the official OpenJD conformance test suite (https://github.com/OpenJobDescription/openjd-specifications) against sqi's internal/openjd implementation.
Package conformance runs the official OpenJD conformance test suite (https://github.com/OpenJobDescription/openjd-specifications) against sqi's internal/openjd implementation.
integration
s3sync command
Command s3sync is a test-only sync helper for the S3 staging integration test.
Command s3sync is a test-only sync helper for the S3 staging integration test.
Package load holds the Go-test entry point of the load and soak harness (internal/loadtest, cmd/sqi-load): it runs the built-in smoke scenario end to end against a real sqi-server process with simulated workers.
Package load holds the Go-test entry point of the load and soak harness (internal/loadtest, cmd/sqi-load): it runs the built-in smoke scenario end to end against a real sqi-server process with simulated workers.
Package oracle differential-tests sqi's Go EXPR evaluator (internal/openjd/expr) against the implementation the OpenJD specification names as its reference, in the Recommended Library Interface section.
Package oracle differential-tests sqi's Go EXPR evaluator (internal/openjd/expr) against the implementation the OpenJD specification names as its reference, in the Recommended Library Interface section.
Command stubproc is a stand-in for any vendor CLI a preset invokes.
Command stubproc is a stand-in for any vendor CLI a preset invokes.
record
Package record is the wire shape of one stubproc invocation record.
Package record is the wire shape of one stubproc invocation record.
Package winservice drives sqi-server and sqi-worker through the real Windows Service Control Manager.
Package winservice drives sqi-server and sqi-worker through the real Windows Service Control Manager.

Jump to

Keyboard shortcuts

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