Repository navigation
test(e2e): port OTLP relay and SPIFFE token-exchange tests with environment-owned fixtures - #5978
Open
matthewgrossman wants to merge 17 commits into
Open
matthewgrossman wants to merge 17 commits into
matthewgrossman wants to merge 17 commits into
Conversation
4 of 5 tasks
matthewgrossman
force-pushed
the
test/5976-otlp-spiffe-env-fixtures/matthewgrossman
branch
3 times, most recently
from
November 25, 2026 20:41
574df06 to
dd67b24
Compare
matthewgrossman
marked this pull request as ready for review
November 30, 2026 18:40
Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
…ronment services Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
…change tests Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
…a collector Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
…it suites Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
…r connections to close HttpRecorder now numbers each request's connection, counts every byte it reads, reads multi-valued headers, takes a read timeout, and waits for every connection to close at a request boundary. A test can then check that nothing beyond whole requests reached a server. Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
…ecorder The provider token exchange tests replace their own TCP servers and HTTP parsing with host-server-support recorders. The targets check forwarded bytes, connections and closes through the recorder, so every assertion stays. Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
… environment variable reader Credential::token_grant sets a credential's OAuth2 grant, as Credential::refresh does for refresh. required_env reads a variable an environment publishes and fails, naming what the suite needs, when it is unset. Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
…riables with testkit The provider token exchange tests build their profiles with testkit::Profile instead of YAML strings. otlp-support and spiffe-support read their variables with testkit::required_env, and the inactive relay test names otlp-support's endpoint variable. Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
…bine CLI output CliSandboxBuilder::run_sandbox runs the attached create like run and also returns the sandbox, for tests that check its logs afterwards. CliOutput::output joins stdout and stderr. Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
…ay tests Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
…es with testkit::required_env Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
… refresh and OCI image tests Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
…ay with the relay enabled Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
6 of 7 tasks
Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
matthewgrossman
force-pushed
the
test/5976-otlp-spiffe-env-fixtures/matthewgrossman
branch
from
November 30, 2026 18:50
77ca72b to
9f2571d
Compare
…sman Signed-off-by: Matthew Grossman <mgrossman@nvidia.com> # Conflicts: # tests/suites/features/Cargo.toml
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed in the port, and why it's bigger
The legacy tests started their collector and SPIFFE Workload API inside the test process, so they bound fixed sockets the gateway was configured with and could run only one at a time. The port moves those services into the environment, so tests share one gateway and run concurrently:
cx.nameand reads only those from the file, instead of owning the collector.Excluding lockfiles, the diff is +2223/−2049 (+174):
host-server-support'sHttpRecorderreplaces the token exchange test's own TCP servers and HTTP parsing, andtestkit::Profilebuilds its provider profiles. Without the Workload API, the tests go from ~1570 to 1003.HttpRecorderCredential::token_grant, so profiles with OAuth2 grants can use the profile builder;required_env, which the OTLP and SPIFFE support crates use to read their variables; andCliSandboxBuilder::run_sandboxandCliOutput::outputfor attached creates whose sandbox the test checks afterwards.required_env, and the Keycloak refresh and OCI image tests userun_sandboxandCliOutput::output.spiffe-support89openshell-otel-test-supportin-processotlp-support190e2e/rustconfig.nix,e2e-suites.ymland Cargo manifestsThe lockfiles add +702/−395 more:
tests/suites/featuresandtests/supportnow pull injsonwebtoken,openshell-oteland their dependencies, whiche2e/rustdrops.Summary
Port the OTLP agent trace relay and SPIFFE token exchange tests from
e2e/rustto testkit suites, with the collector and the Workload API stub owned by the environment instead of the tests. Tests check only their own spans and traffic, so they share one gateway and run with more than one worker. Split from #5792.Related Issue
Closes #5976
Part of #5297
Changes
features/otlp-relay:agent_span_reaches_collector_with_attributionandspan_emitted_before_exit_is_delivered. The<podman base>-otlpenvironments run a stock OpenTelemetry Collector for the environment's lifetime, point the gateway's OTLP export and agent relay at it, and publish its JSONL capture asOPENSHELL_TEST_OTLP_LOG(replacingOPENSHELL_TEST_OTLP_PORT). Each test names its spans withcx.name, waits for them, and checks attribution and duplicate resource keys only on those spans.features/provider-token-exchange:independent_grants_across_sandboxesandroutes_recover_and_select_a_b_a_on_one_connection. The<podman base>-spiffeenvironments run the gateway's and supervisors' Workload APIs as a system service (playbooks/files/spiffe-workload-api.py). It creates its signing key on first start, so no key is committed, and publishes the JWKS asOPENSHELL_TEST_SPIFFE_JWKS. Tests don't touch the socket;tests/support/spiffeonly verifies SVIDs against the JWKS. The token servers stay on ephemeral ports.features/otlp-relay-inactive:relay_is_inert_without_collectorruns onubuntu-docker-rootful, whose gateway has no OTLP export or agent relay, and fails ifOPENSHELL_TEST_OTLP_ENDPOINTis set. test(e2e): port OTLP relay and SPIFFE token-exchange tests with environment-owned fixtures #5976 put it in conformance, but there it fails any gateway with the relay configured, and its log read is unreliable on k3s-ha (test(conformance): run the two sandbox-log tests on k3s-ha again #5752). The workload script uses only the Python standard library.e2e-suites.ymlhas no per-rowfilter.tests/support/README.md: the environment contract table listsOPENSHELL_TEST_OTLP_LOG,OPENSHELL_TEST_OTLP_ENDPOINTandOPENSHELL_TEST_SPIFFE_JWKS.e2e-suites.yml: rows forotlp-relayandprovider-token-exchangeon Podman rootless, andotlp-relay-inactiveon Docker rootful.harness = falsewithtestkit::main(). The token-exchange profile stays YAML becausetestkit::Profilehas notoken_grantsetter yet.e2e/rust: removesotlp_relay.rsandprovider_token_exchange.rs, their[[test]]entries and dependencies, theirPODMAN_CI_TESTSentries, and the OTLP and SPIFFE wiring in the Docker and Podman wrappers.This doesn't depend on #5792, so it's based on main. Whichever PR lands second gets a small conflict in
e2e/rust/Cargo.tomlandCargo.lock.Driver coverage
Testing
Run locally through
openshell-test-runneron tmachine:fedora-podman-rootless-otlp/rpmfedora-podman-rootless-spiffe/rpmubuntu-docker-rootful/debAlso run:
cargo fmt --checkandcargo clippy --all-targets --locked -D warningsfortests/supportandtests/suites/features;cargo checkofe2e/rustwith the Docker and Podman features;check-cargo-lockfiles.shandcheck_cargo_lockfile_alignment.py;ruff checkandruff format --checkon the Workload API stub.Checklist