Skip to content

Latest commit

 

History

History
44 lines (36 loc) · 2.92 KB

README.md

File metadata and controls

44 lines (36 loc) · 2.92 KB

Test support crates

Each crate here is a fixture for one concern, such as a service the environment runs, and any suite can depend on it by path. See Adding a feature suite for how an environment and a fixture share a contract.

Environment contract

An environment, the test runner or CI sets variables for tests to read. A tmachine environment publishes its variables with tests/tmachine/ansible/playbooks/test-env.yaml, and openshell-test-runner passes them to the tests. To run a suite against your own deployment, set them yourself. A fixture fails the test when a variable it needs is missing; it never skips it.

Each support crate, and each suite that reads a variable of its own, documents its variables and the environment that sets them in its crate docs, and a missing one is named in the test failure. The table below lists only the variables that testkit, the runner and CI own. The runner also sets OPENSHELL_GATEWAY and OPENSHELL_BIN, which testkit reads; see Running against a gateway.

Variable Set by Read by Meaning
OPENSHELL_TEST_BASE_IMAGE Optional; you, for example to use a mirror testkit::base_image() The default sandbox image. Unset, it is nvcr.io/nvidia/base/ubuntu:24.04.
OPENSHELL_TEST_PYTHON_IMAGE Optional; e2e/rust/e2e-kubernetes.sh and e2e-vm.sh set a pullable image testkit::python_image() The workload image for tests that run python3, curl, git or openssl. Unset, it is openshell/e2e-python:dev, which the tmachine installers load.
OPENSHELL_TEST_UNSUPPORTED CI and e2e/support/conformance.sh derive it from tests/suites/unsupported.yaml with tasks/scripts/suite-unsupported.sh testkit programs Tests the environment can't pass yet, as <test>=<issue> entries. See Unsupported tests.
OPENSHELL_TEST_POSTGRES_URL tasks/scripts/run-postgres-tests.sh (mise run test:rust:postgres), or you openshell-server's PostgreSQL tests A disposable PostgreSQL database. Never point it at one a gateway uses.

Other OPENSHELL_TEST_* names are internal test hooks and are left out on purpose: unit-test child-process markers, the re-entry markers in tests/support/environment.rs, Nix guest-cache settings, install.sh test hooks and crate test settings.

Ports the environment chooses

When a test must listen on a port the environment picked, because the gateway or another service is configured to call it, the environment publishes it as OPENSHELL_TEST_<SERVICE>_PORT and the test binds that port on every IPv4 host address, for example with HttpRecorder::builder().port(port) from host-server-support. The host servers don't listen on IPv6, so the environment must point the caller at an IPv4 address of the test host. The test never picks the port itself. Give each concurrent test a distinct port.