Repository navigation
Commit ec30722
authored
fix(tests): keep two unit tests green after the release image restamp (#5179)
## What this PR does
Every PR against `release-1.7` has had a red `Unit & controller tests`
check since v1.7.0-rc.3 (seen on #5172,
[job](https://github.com/cozystack/cozystack/actions/runs/41162009892/job/124421449910)).
The cause is the release build itself: the `Prepare release` commit
(0402103) rewrites `packages/*/values.yaml`, and two unit tests read
exactly the fields it rewrites.
| test | reads | before the release build | after |
|---|---|---|---|
| `hack/cni-plugins-staging-contract.bats` "the kube-ovn release the CNI
plugin pin was checked against is the one vendored" |
`.global.images.kubeovn.tag` in `packages/system/kubeovn/values.yaml` |
`v1.15.26@sha256:…` | `v1.7.0@sha256:…` |
| `packages/system/monitoring/tests/vtraces_collector_test.yaml` "pins
the collector image through the cozy-lib.image helper" |
`tracingCollector.image` |
`docker.io/otel/opentelemetry-collector-contrib:0.136.0@sha256:…` |
`ghcr.io/cozystack/cozystack/otelcol-tracing:v0.136.0-cozystack.0@sha256:…`
|
Changes:
- The bats test now takes the vendored kube-ovn release from
`appVersion` in `packages/system/kubeovn/charts/kube-ovn/Chart.yaml`.
That is the value `packages/system/kubeovn/Makefile` builds the image
from, and a release build leaves it alone. The hint printed on a
mismatch names the new file.
- The helm unittest case no longer names the image at all. It sets
`_cluster.images-registry` and asserts that the registry lands in front
of the rendered image and that the image stays digest-pinned (the
`grafana_upstream_image_plugins_test.yaml` pattern). Removing the
`cozy-lib.image` call from the template makes it fail; the old regex did
not.
Verified locally on this branch: `bats
hack/cni-plugins-staging-contract.bats` 10/10, `helm unittest
packages/system/monitoring -f tests/vtraces_collector_test.yaml` 28/28.
Not a backport: `main` still carries the pre-release pins, so both tests
pass there today. The same patch is open against `main` as #5180, so
`release-1.8` does not meet the same surprise.
Fixes #5178.
Refs #5172 (blocked on this check).
### Downstream repositories
- [x] No downstream repository is affected by this change
### Release note
```release-note
NONE
```2 files changed
Lines changed: 15 additions & 6 deletions
File tree
- hack
- packages/system/monitoring/tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
26 | 29 | | |
27 | 30 | | |
28 | 31 | | |
| |||
347 | 350 | | |
348 | 351 | | |
349 | 352 | | |
350 | | - | |
351 | | - | |
352 | | - | |
| 353 | + | |
| 354 | + | |
353 | 355 | | |
354 | 356 | | |
355 | 357 | | |
356 | | - | |
| 358 | + | |
357 | 359 | | |
358 | 360 | | |
359 | 361 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
473 | 473 | | |
474 | 474 | | |
475 | 475 | | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
476 | 480 | | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
477 | 484 | | |
478 | 485 | | |
479 | 486 | | |
480 | 487 | | |
481 | 488 | | |
482 | 489 | | |
483 | | - | |
| 490 | + | |
0 commit comments