Skip to content

fix(k8s): hermetically resolve cluster secrets fixture - #6959

Merged
dan-petty merged 1 commit into
mainfrom
fix/6957-hermetic-cluster-secrets-fixture
Nov 24, 2026
Merged

dan-petty merged 1 commit into
mainfrom
fix/6957-hermetic-cluster-secrets-fixture

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

In tests/k8s/test_cluster_secrets_file.py, test_resolve_fixture_secrets_file_variants tests _resolve_fixture_secrets_file() by asserting assert cs._resolve_fixture_secrets_file() == cs._FIXTURE_SECRETS_FILE. When devops_cli runs from site-packages (such as in /app/.venv inside the Service test image), _FIXTURE_SECRETS_FILE does not exist on disk, so _resolve_fixture_secrets_file() falls back to _FALLBACK_FIXTURE_SECRETS_FILE (tests/fixtures/cluster-secrets.toml). This causes test_resolve_fixture_secrets_file_variants to fail with AssertionError, breaking Service Image Tests (shard 1 of 6) in CI. Additionally, src/devops_cli/k8s/cluster_secrets.py restricts fallback fixture loading with if env_file is None and k8s_dir is None:, preventing fallback when k8s_dir is passed without a local cluster-secrets file.

Closes #6957

Change: openspec/changes/archive/2026-11-24-6957-hermetic-cluster-secrets-fixture/

In `tests/k8s/test_cluster_secrets_file.py`,
`test_resolve_fixture_secrets_file_variants` tests
`_resolve_fixture_secrets_file()` by asserting that it equals
`cs._FIXTURE_SECRETS_FILE`. When `devops_cli` is installed in a container
image, `_FIXTURE_SECRETS_FILE` does not exist on disk, causing the test
to fail with an `AssertionError` in `Service Image Tests (shard 1 of 6)`.

Use monkeypatch to test primary resolution with an existing file in `tmp_path`,
and permit `load_cluster_secrets_table()` to fall back to the fixture
when `k8s_dir` lacks a local `cluster-secrets.toml`.

Closes #6957

Change:
`openspec/changes/archive/2026-11-24-6957-hermetic-cluster-secrets-fixture/`
@dan-petty dan-petty added type/bug Type bug: the code does not do what it must scope/k8s Kubernetes commands, Helm charts, pods, services, and policies labels Nov 24, 2026
@dan-petty
dan-petty marked this pull request as ready for review November 24, 2026 03:56
@dan-petty
dan-petty merged commit c5f5bfd into main Nov 24, 2026
28 checks passed
@dan-petty
dan-petty deleted the fix/6957-hermetic-cluster-secrets-fixture branch November 24, 2026 04:06
dan-petty-release Bot added a commit that referenced this pull request Nov 24, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.206.2](v0.206.1...v0.206.2)
(2026-11-24)


### Bug Fixes

* **k8s:** hermetically resolve cluster secrets fixture
([#6959](#6959))
([c5f5bfd](c5f5bfd))


### Code Refactoring

* **k8s:** take helper pod and harbor task images from manifests
([#6958](#6958))
([f96dc6b](f96dc6b))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: dan-petty-release[bot] <346998822+dan-petty-release[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope/k8s Kubernetes commands, Helm charts, pods, services, and policies type/bug Type bug: the code does not do what it must

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(k8s): hermetic cluster secrets fixture resolution in test suite

1 participant