Skip to content

test(testkit): separate destructive tests from non-destructive ones #5527

Todo

Description

@matthewgrossman

User Story

I'm moving the e2e/rust tests onto testkit (#5281). Some of them only create and delete their own sandboxes. Others change the environment they run in: they set a gateway-wide setting, restart the gateway, or scale and roll gateway pods. I need a clear rule for which kind is which, so that a destructive test never runs against a gateway someone depends on and never runs beside tests it can break.

Description

Define how testkit tells destructive tests from non-destructive ones, and where each kind may run.

  • Non-destructive: the test creates resources with run-unique names, such as sandboxes, templates and providers, and removes them on cleanup. It only reads gateway-wide state. It can run against any gateway, including a user's own, and beside other tests. Conformance is limited to these.
  • Destructive: the test changes state that other tests or users of the same gateway can see. Known cases:

Decide:

  1. Marking. How a destructive test is marked. Options include a separate feature suite, a testkit attribute, or a nextest test group.
  2. Opting in. How an environment allows destructive tests. For example, tmachine starts a dedicated gateway and publishes a variable, and testkit fails a destructive test without it. A developer running the suites against their own gateway must not change its state by accident.
  3. Isolation. How destructive tests are kept from running beside other tests on the same gateway. This may use the serial test groups from test(runner): apply per-family nextest config and a thread count to runner rows #5295.
  4. Config changes. Tests don't change gateway config files. The environment lays down any non-default config before the gateway starts, as discussed for drop-in config files (feat(gateway): merge drop-in configs over the base file #5489). Confirm that this rule also covers runtime settings, or say where it stops.

Context

Definition of Done

  • The rule for destructive and non-destructive tests, and where each may run, is written down in the testkit or tests README.
  • A destructive test fails, rather than running, against an environment that hasn't opted in.
  • The test(e2e): decide which e2e/rust tests to port and in what order #5297 plan and the affected PR issues name, for each destructive test, how it is marked and which environments run it.

Activity

  1. added
    topic:testing
    on Nov 12, 2026
  2. added
    area:build
    on Nov 15, 2026
  3. matthewgrossman commented on Nov 23, 2026

    @matthewgrossman
    MemberAuthor

    Proposed answer, now decision G in the #5297 plan (waiting on @elezar's yes):

    • Marking: tests that change shared gateway state go in their own family, tests/suites/destructive/ (for example global-settings and kubernetes-ha), never in conformance. The location says the test changes the environment.
    • Opting in: every test in the family calls a testkit helper that fails unless the environment sets OPENSHELL_TEST_DISPOSABLE_GATEWAY=1. tmachine and the host lanes set it; a developer's own gateway doesn't.
    • Isolation: tests in the family run one at a time through test(runner): apply per-family nextest config and a thread count to runner rows #5295's test groups.
    • Runtime settings: only tests in this family may change them, and they restore them.

    Gateway restarts are out of scope here: decision A moves the restart tests to the continuity family (#3521), where the runner applies the restart and tests can't run without CONTINUITY_RUN_ID. That leaves settings_management::settings_global_override_round_trip and kubernetes_ha_rebalancing. For the latter, the Kubernetes environment's kubeconfig (decision F) also needs rights to the gateway deployment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

area:buildtopic:testing

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions