Skip to content

tests: use go-yq instead of python-yq - #125

Merged
audunmg merged 1 commit into
mainfrom
go-yq
Aug 19, 2026
Merged

tests: use go-yq instead of python-yq#125
audunmg merged 1 commit into
mainfrom
go-yq

Conversation

@gquintard

@gquintard gquintard commented Aug 18, 2026

Copy link
Copy Markdown
Collaborator

will help with #117

@gquintard
gquintard marked this pull request as draft August 18, 2026 01:22
@gquintard
gquintard force-pushed the go-yq branch 3 times, most recently from 66dda45 to 0743746 Compare August 18, 2026 05:27
@gquintard
gquintard requested review from audunmg and briiians and a lite review from Copilot August 18, 2026 05:28

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the chart unit-test suite to use Go yq (mikefarah/yq v4-style flags) instead of the Python yq wrapper, aligning test JSON extraction and type assertions across the charts. This supports ongoing work like #117 by making CI/test tooling more predictable and removing a Python dependency from the pipeline.

Changes:

  • Replace Python-yq-style yq -r -c usage with yq -o=json -I=0 (plus -r where needed) across BATS unit tests.
  • Adjust type assertions from jq-style (string/number) to go-yq tag outputs (!!str/!!int) where applicable.
  • Remove pip install yq from CI (but CI still needs an explicit go-yq install; see comment).

Reviewed changes

Copilot reviewed 34 out of 35 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
varnish-enterprise/test/unit/statefulset.bats Switch JSON extraction to go-yq flags for StatefulSet assertions.
varnish-enterprise/test/unit/service.bats Switch JSON extraction to go-yq flags for Service assertions.
varnish-enterprise/test/unit/pdb.bats Switch extraction to go-yq flags and update type expectations to !!*.
varnish-enterprise/test/unit/hpa.bats Switch extraction to go-yq flags and update type expectations to !!int.
varnish-enterprise/test/unit/extra.bats Switch multi-doc/object filtering to go-yq JSON output.
varnish-enterprise/test/unit/deployment.bats Switch JSON extraction to go-yq flags for Deployment assertions.
varnish-enterprise/test/unit/daemonset.bats Switch JSON extraction to go-yq flags for DaemonSet assertions.
varnish-enterprise/test/unit/cluster.bats Switch JSON extraction to go-yq flags for cluster-related templates.
varnish-controller/test/unit/service-ui.bats Switch annotations extraction to go-yq flags.
varnish-controller/test/unit/service-apigw.bats Switch annotations extraction to go-yq flags.
varnish-controller/test/unit/secret-credentials.bats Switch secret field extraction to go-yq flags.
varnish-controller/test/unit/imagePullSecrets.bats Switch imagePullSecrets extraction to go-yq flags.
varnish-controller/test/unit/hpa-ui.bats Switch extraction to go-yq flags and update type expectations to !!int.
varnish-controller/test/unit/hpa-brainz.bats Switch extraction to go-yq flags and update type expectations to !!int.
varnish-controller/test/unit/hpa-apigw.bats Switch extraction to go-yq flags and update type expectations to !!int.
varnish-controller/test/unit/extra.bats Switch multi-doc/object filtering and checksum reads to go-yq JSON output.
varnish-controller/test/unit/deployment-ui.bats Switch Deployment UI assertions to go-yq flags throughout.
varnish-controller/test/unit/deployment-brainz.bats Switch Deployment brainz assertions to go-yq flags throughout.
varnish-controller/test/unit/deployment-apigw.bats Switch Deployment apigw assertions to go-yq flags throughout.
varnish-controller-router/test/unit/service-router-management.bats Switch service/router-management assertions to go-yq flags.
varnish-controller-router/test/unit/service-router-http.bats Switch service/router-http assertions to go-yq flags.
varnish-controller-router/test/unit/service-router-dns-backend.bats Switch service/router-dns-backend assertions to go-yq flags.
varnish-controller-router/test/unit/deployment-router.bats Switch deployment/router assertions to go-yq flags throughout.
varnish-controller-router/test/unit/deployment-powerdns.bats Switch deployment/powerdns assertions to go-yq flags throughout.
varnish-controller-router/test/unit/configmap-powerdns.bats Switch ConfigMap powerdns assertions to go-yq flags.
varnish-cache/test/unit/statefulset.bats Switch JSON extraction to go-yq flags for StatefulSet assertions.
varnish-cache/test/unit/service.bats Switch JSON extraction to go-yq flags for Service assertions.
varnish-cache/test/unit/pdb.bats Switch extraction to go-yq flags and update type expectations to !!*.
varnish-cache/test/unit/hpa.bats Switch extraction to go-yq flags and update type expectations to !!int.
varnish-cache/test/unit/extra.bats Switch multi-doc/object filtering to go-yq JSON output.
varnish-cache/test/unit/deployment.bats Switch JSON extraction to go-yq flags for Deployment assertions.
varnish-cache/test/unit/daemonset.bats Switch JSON extraction to go-yq flags for DaemonSet assertions.
.github/workflows/ci.yml Remove python-yq install and tweak unit-test step formatting (CI still needs explicit go-yq install).

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread .github/workflows/ci.yml Outdated
@gquintard
gquintard marked this pull request as ready for review August 18, 2026 13:32

@briiians briiians left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, I rebased #117 off of this too.

@audunmg audunmg left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks clean and tests work well.

@audunmg
audunmg merged commit c1f8c4c into main Aug 19, 2026
5 checks passed
@audunmg
audunmg deleted the go-yq branch August 19, 2026 02:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants