Skip to content

fix: helm tests#322

Open
cb80 wants to merge 1 commit into
mainfrom
helmTests
Open

fix: helm tests#322
cb80 wants to merge 1 commit into
mainfrom
helmTests

Conversation

@cb80

@cb80 cb80 commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

The motivation is to get rid of the terratest dependency and make sure we properly log the cluster state on errors. This lead to multiple other changes:

  • removal of the dedicated go.mod/sum for the helm tests
  • introduction of dedicated build tags to seperate helm tests from regular ones
  • inclusion of build tags in the golangci-lint config
  • fixes for the resulting golangci-lint findings
  • Alignment of Dockerfile.dev and the helm test workflow to their equivalents in the session manager

@cb80 cb80 self-assigned this Jun 30, 2026
@coderabbitai

coderabbitai Bot commented Jun 30, 2026

Copy link
Copy Markdown

Review Change Stack

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: e1e033c9-6d33-4e90-a5e9-9c0dc69833c4

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Walkthrough

Helm tests are migrated from Terratest to direct helm/kubectl subprocess calls with client-go polling; a helmtests build tag gates all helm test files; helm-tests is merged into the root Go module; Dockerfile.dev becomes a multi-stage build; CI, Makefile, and linter configs are updated accordingly. Integration tests gain proper context propagation.

Changes

Helm Tests Migration and Build Infrastructure

Layer / File(s) Summary
Root module merge and dependency additions
go.mod, helm-tests/go.mod, Taskfile.yaml
helm-tests/go.mod is removed; root go.mod gains k8s.io/api, k8s.io/apimachinery, k8s.io/client-go v0.33.1 direct dependencies, many new indirect deps, and a k3d tool directive; Taskfile.yaml removes the NESTED_MODULES entry for helm-tests.
Dockerfile.dev multi-stage build and CI/Makefile updates
Dockerfile.dev, .github/workflows/helm-tests.yaml, Makefile, .golangci.yaml
Dockerfile.dev switches from a scratch-based image to a golang:1.26 builder + distroless/static-debian12:debug runner with build cache mounts; CI workflow replaces make helm-test with explicit steps (unit test, docker build, k3d cluster creation, image import, integration test with 15-minute timeout); Makefile and golangci-lint config add the helmtests build tag.
Helm unit tests rewritten to exec-based helm template
helm-tests/unit/main_test.go, helm-tests/unit/deployment_test.go, helm-tests/unit/hpa_test.go, helm-tests/unit/pdb_test.go, helm-tests/unit/service_test.go, helm-tests/unit/serviceaccount_test.go
All unit test files add //go:build helmtests; Deployment, HPA, PDB, Service, and ServiceAccount tests replace helm.RenderTemplateE and Kubernetes YAML unmarshalling with exec.CommandContext("helm template") and substring containment checks; test case tables change from helm.Options structs to raw --set value strings.
Helm integration test rewritten to client-go + exec helpers
helm-tests/integration/main_test.go, helm-tests/integration/helm-install_test.go, helm-tests/main.go
helm-install_test.go drops Terratest; adds //go:build helmtests; introduces helpers for kubectl cluster logging, kube client creation, Helm repo/install/uninstall via subprocess, kubectl apply/delete (including in-memory YAML via stdin), pod/service readiness polling with client-go, and random ID generation; TestHelmInstall installs Valkey and extauthz, polls pod readiness, streams container logs, and validates the expected Service exists.
Integration test context propagation improvements
integration/main_test.go, integration/config_test.go, integration/grpc_server_test.go, integration/status_server_test.go, integration/version_test.go
exec.Command replaced with exec.CommandContext; grpc.WithInsecure() replaced with grpc.WithTransportCredentials(insecure.NewCredentials()); http.Get replaced with http.Client.Do with context-aware requests; error formatting switches to %w; context.Background() is threaded through buildCommandsAndRunTests and startValkeyContainer.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@push-tags-from-workflow push-tags-from-workflow Bot added dependencies Pull requests that update a dependency file ci-cd tests dev-ops labels Jun 30, 2026
@cb80 cb80 force-pushed the helmTests branch 9 times, most recently from fc141b2 to 6d13e38 Compare June 30, 2026 16:22
@cb80

cb80 commented Jun 30, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai summary

@coderabbitai

coderabbitai Bot commented Jun 30, 2026

Copy link
Copy Markdown
✅ Action performed

Summary regeneration triggered.

Signed-off-by: Chris Burkert <burkert.chris@gmail.com>
@cb80 cb80 marked this pull request as ready for review July 1, 2026 09:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-cd dependencies Pull requests that update a dependency file dev-ops tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants