Skip to content

test(infra): docker, tf, watchers and Argo CRD tests run on edge fakes - #3857

Merged
dan-petty merged 11 commits into
mainfrom
test/1335-infra-tests-on-edge-fakes
Nov 6, 2026
Merged

dan-petty merged 11 commits into
mainfrom
test/1335-infra-tests-on-edge-fakes

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

The tests of the Docker engine endpoint and cache, the watchers, OpenTofu cost, cosign and workload sandbox now run on the edge fakes: the process fake, the DNS fake, the clock, the Kubernetes API fake and the Docker engine fake. They no longer patch internal names.

To make this possible, the Argo workflow wait and the Cloudflare DNS record matching move out of the commands into public functions of argo/workflows.py and cloudflare/dns.py. The commands become thin adapters that render the result. The wait and the matching rules have their own tests on the fakes. The commands keep wiring tests for --wait, --force and --type.

The fakes gain a few hooks for this: ClockFake.after_each_sleep, DockerEngineFake.script_every_run, fail(method, error) on the Kubernetes API fake and extra_allowed_env on a recorded process call. docs/TESTING.md names them.

Closes #3751

Change: openspec/changes/archive/2026-11-06-3751-infra-tests-on-edge-fakes/

await_workflow waits on the clock seam and raises ArgoWorkflowTimeoutError. The command prints the error. The CRD tests run on the Kubernetes API fake.
find_matching_records and delete_dns_records are public functions of cloudflare/dns.py. The command renders the result. The matching cases run over the HTTP fake.
…on edge fakes

The tests use process_fake, keyring_store, docker_daemon, clock, cli and mcp_dispatcher in place of patches. Each file sits at the mirror path of its source.
…, the clock and cli

DockerEngineService reads time through the clock seam. The tests patch no name.
The 1,385-line engine test file becomes seven files under tests/docker/ and one command test file. No test changes in this commit.
@dan-petty dan-petty added type/test Type test: a new or changed test scope/infra Docker container images, DevContainers, and infrastructure tooling labels Nov 6, 2026
@dan-petty

Copy link
Copy Markdown
Owner Author

Results of the full uv run devops ci on this branch after the rebase onto origin/main:

  • 20104 tests passed. Two tests failed. Both fail the same way on origin/main on this host: test_mark_only_commands_under_global_dry_run and test_the_direct_executor_refuses_a_network_profile_before_it_starts_the_tool[direct] (the popeye binary path).
  • Coverage is 94.66% (the gate needs 85%). The coverage row shows fail only because the test row failed.
  • All other rows pass: lint, format, typecheck, security, docs, openspec, test-tree, startup-imports, swallowed-failures and the rest.

Review fixes in the last commits: wiring tests for dns delete --force and --type, a test for the exit 1 of argo workflows submit --wait on a timeout, and two more hook names in docs/TESTING.md.

One review note not fixed: test_endpoint_podman_rootful_skipped_when_inaccessible skips when the test runs as root. A root process can open any socket path, so no test setup can make the path inaccessible for it. The skip is a host-capability skip.

@dan-petty
dan-petty marked this pull request as ready for review November 6, 2026 22:18
@dan-petty
dan-petty merged commit 5bc50d0 into main Nov 6, 2026
24 checks passed
@dan-petty
dan-petty deleted the test/1335-infra-tests-on-edge-fakes branch November 6, 2026 22:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope/infra Docker container images, DevContainers, and infrastructure tooling type/test Type test: a new or changed test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test(infra): docker, tf, watchers and Argo CRD tests run on edge fakes

1 participant