Skip to content

feat: E2E Test suite using ginkgo#1081

Open
TheiLLeniumStudios wants to merge 15 commits intostakater:masterfrom
TheiLLeniumStudios:feat/e2e-tests
Open

feat: E2E Test suite using ginkgo#1081
TheiLLeniumStudios wants to merge 15 commits intostakater:masterfrom
TheiLLeniumStudios:feat/e2e-tests

Conversation

@TheiLLeniumStudios
Copy link
Contributor

@TheiLLeniumStudios TheiLLeniumStudios commented Jan 10, 2026

This PR introduces a complete overhaul of the e2e testing infrastructure, replacing the previous test approach with a modern, maintainable, and faster test suite built on Ginkgo v2

Key Changes

Test Framework Migration

  • Migrated from custom test setup to Ginkgo v2 with Gomega matchers
  • Organized tests into logical suites: core, annotations, flags, advanced, csi, argo
  • ~90 test specs with ~180 table-driven entries covering all workload types and scenarios

Runtime Image Building

  • Tests build the Reloader image at runtime from the current codebase (make e2e)
  • Image automatically loaded into Kind cluster before test execution and decouples the code-base from e2e tests

Real Infrastructure Integration

  • Real Vault: Tests run against an actual HashiCorp Vault instance, not mocks
  • Real CSI Secrets Store Driver: Actual secrets-store-csi-driver with Vault provider
  • Real Argo Rollouts: Actual Argo Rollouts controller for Rollout workload testing
  • CSI tests create secrets in Vault, verify SecretProviderClass sync, and validate Reloader triggers rolling updates on secret rotation
  • All versions pinned for reproducibility (Vault 1.20.4, CSI Driver 1.5.5, Argo Rollouts 1.7.2)

Watch-Based Waiting Infrastructure

  • Replaced all time.Sleep() and polling-based waits with Kubernetes watch API
  • Generic WatchUntil[T runtime.Object] function for type-safe resource watching
  • Condition functions (DeploymentReady, DaemonSetReady, etc.) for clean assertions
  • Tests react to actual state changes instead of arbitrary timeouts - faster and more reliable

Workload Adapter Pattern

  • Unified WorkloadAdapter interface for all workload types
  • Supports: Deployment, DaemonSet, StatefulSet, Job, CronJob, Argo Rollout, OpenShift DeploymentConfig
  • Capability interfaces (Pausable, Recreatable, JobTriggerer) for workload-specific features
  • Single test code works across all workload types via table-driven tests

Test Coverage

Category What's Tested
Core Workloads ConfigMap/Secret reload via volumes, envFrom, env valueFrom for all 7 workload types
Annotations auto=true, typed auto (configmap.auto, secret.auto, secretproviderclass.auto), search/match, exclude, pause-period
Flags --watch-globally, --namespaces-to-ignore, --resources-to-ignore, --reload-on-create, --reload-on-delete, --auto-reload-all
CSI Integration Real Vault secret creation/rotation, SecretProviderClass sync, SPCPS version tracking, automatic reload on external secret changes
Advanced Job recreation, CronJob triggered jobs, multi-container pods, init containers, regex matching
Strategies Annotations strategy and env-vars strategy (STAKATER_* environment variables)

Infrastructure Scripts

  • scripts/e2e-cluster-setup.sh - Installs Argo Rollouts, CSI Secrets Store Driver, Vault (with Kubernetes auth configured)
  • scripts/e2e-cluster-cleanup.sh - Cleans up test resources
  • Makefile targets: make e2e-setup, make e2e, make e2e-cleanup, make e2e-ci

Code Quality

  • Added .golangci.yml with comprehensive linter configuration (errcheck, govet, staticcheck, ginkgolinter, etc.)
  • All e2e utility code passes lint checks
  • Unit tests for utility functions (annotations, helm, rand, test helpers)

List of all tests

advanced/job_reload_test.go

  • Job Workload Recreation Tests Job with auto annotation should recreate Job with auto=true when ConfigMap changes — Job
  • Job Workload Recreation Tests Job with ConfigMap reference should recreate Job when referenced ConfigMap changes — Job
  • Job Workload Recreation Tests Job with SecretProviderClass reference should recreate Job when Vault secret changes — Job
  • Job Workload Recreation Tests Job with Secret reference should recreate Job when referenced Secret changes — Job
  • Job Workload Recreation Tests Job with valueFrom ConfigMap reference should recreate Job when ConfigMap referenced via valueFrom changes — Job
  • Job Workload Recreation Tests Job with valueFrom Secret reference should recreate Job when Secret referenced via valueFrom changes — Job

advanced/multi_container_test.go

  • Multi-Container Tests Init container with CSI volume should reload when SecretProviderClassPodStatus used by init container changes
  • Multi-Container Tests Init container with CSI volume should reload with auto annotation when init container CSI volume changes
  • Multi-Container Tests Multiple containers different ConfigMaps should reload when any container's ConfigMap changes
  • Multi-Container Tests Multiple containers same ConfigMap should reload when ConfigMap used by multiple containers changes

advanced/regex_test.go

  • Regex Pattern Tests ConfigMap regex pattern should NOT reload when ConfigMap NOT matching pattern changes
  • Regex Pattern Tests ConfigMap regex pattern should reload when ConfigMap matching pattern changes
  • Regex Pattern Tests Secret regex pattern should reload when Secret matching pattern changes

annotations/auto_reload_test.go

  • Auto Reload Annotation Tests with auto annotation and explicit reload annotation together should reload when auto-detected resource changes
  • Auto Reload Annotation Tests with reloader.stakater.com/auto=true annotation should reload Deployment when any referenced ConfigMap changes — Deployment
  • Auto Reload Annotation Tests with reloader.stakater.com/auto=true annotation should reload Deployment when any referenced Secret changes — Deployment
  • Auto Reload Annotation Tests with reloader.stakater.com/auto=true annotation should reload Deployment when either ConfigMap or Secret changes — Deployment
  • Auto Reload Annotation Tests with secretproviderclass.reloader.stakater.com/auto=true annotation should NOT reload Deployment when ConfigMap changes (only SPC auto enabled) — Deployment
  • Auto Reload Annotation Tests with secretproviderclass.reloader.stakater.com/auto=true annotation should reload Deployment when SecretProviderClassPodStatus changes — Deployment
  • Auto Reload Annotation Tests with secretproviderclass.reloader.stakater.com/auto=true annotation should reload when using combined auto=true annotation for SPC

annotations/combination_test.go

  • Combination Annotation Tests auto=true with exclude annotations should NOT reload when excluded ConfigMap changes
  • Combination Annotation Tests auto=true with exclude annotations should NOT reload when excluded Secret changes
  • Combination Annotation Tests auto=true with exclude annotations should reload when non-excluded ConfigMap changes
  • Combination Annotation Tests auto=true with explicit reload annotations should reload when both auto-detected and explicitly listed ConfigMaps change
  • Combination Annotation Tests auto=true with explicit reload annotations should reload when explicitly listed ConfigMap changes with auto=true
  • Combination Annotation Tests auto=true with explicit reload annotations should reload when Secret changes with auto=true and explicit Secret annotation
  • Combination Annotation Tests multiple explicit references should reload when any of multiple explicitly listed ConfigMaps change
  • Combination Annotation Tests multiple explicit references should reload when any of multiple explicitly listed Secrets change
  • Combination Annotation Tests multiple explicit references should reload when both ConfigMap and Secret annotations are present

annotations/exclude_test.go

  • Exclude Annotation Tests ConfigMap exclude annotation should NOT reload when excluded ConfigMap changes
  • Exclude Annotation Tests ConfigMap exclude annotation should reload when non-excluded ConfigMap changes
  • Exclude Annotation Tests Exclude annotation on pod template — Deployment, DaemonSet, StatefulSet, ArgoRollout, DeploymentConfig
  • Exclude Annotation Tests Secret exclude annotation should NOT reload when excluded Secret changes
  • Exclude Annotation Tests Secret exclude annotation should reload when non-excluded Secret changes
  • Exclude Annotation Tests SecretProviderClass exclude annotation should NOT reload when excluded SecretProviderClassPodStatus changes
  • Exclude Annotation Tests SecretProviderClass exclude annotation should reload when non-excluded SecretProviderClassPodStatus changes

annotations/pause_period_test.go

  • Pause Period Tests with pause-period annotation should NOT pause Deployment without pause-period annotation — Deployment
  • Pause Period Tests with pause-period annotation should pause Deployment after reload — Deployment
  • [PENDING] Pause Period Tests with pause-period annotation should pause Deployment when pause-period annotation is on pod template — Deployment

annotations/resource_ignore_test.go

  • Resource Ignore Annotation Tests with reloader.stakater.com/ignore annotation on resource should NOT reload when ConfigMap has ignore=true annotation
  • Resource Ignore Annotation Tests with reloader.stakater.com/ignore annotation on resource should NOT reload when Secret has ignore=true annotation

annotations/search_match_test.go

  • Search and Match Annotation Tests with search and match annotations should NOT reload when resource has match but no Deployment has search — Deployment
  • Search and Match Annotation Tests with search and match annotations should NOT reload when workload has search but ConfigMap has no match
  • Search and Match Annotation Tests with search and match annotations should reload only the deployment with search annotation when multiple deployments use same ConfigMap — Deployment
  • Search and Match Annotation Tests with search and match annotations should reload when workload has search annotation and ConfigMap has match annotation
  • Search and Match Annotation Tests with search annotation on pod template — Deployment, DaemonSet, StatefulSet, ArgoRollout, DeploymentConfig

argo/rollout_test.go

  • Argo Rollout Strategy Tests Rollout strategy annotation should use default rollout strategy (annotation-based reload) — ArgoRollout
  • Argo Rollout Strategy Tests Rollout strategy annotation should use restart strategy when specified (sets restartAt field) — ArgoRollout

core/reference_methods_test.go

  • Reference Method Tests Auto Annotation with valueFrom should reload with auto=true when ConfigMap referenced via valueFrom changes — Deployment, DaemonSet, StatefulSet, ArgoRollout, DeploymentConfig
  • Reference Method Tests Init Container with envFrom should reload when ConfigMap referenced by init container changes — Deployment, DaemonSet, StatefulSet, ArgoRollout, DeploymentConfig
  • Reference Method Tests Init Container with envFrom should reload when Secret referenced by init container changes — Deployment, DaemonSet, StatefulSet, ArgoRollout, DeploymentConfig
  • Reference Method Tests Init Container with Volume Mount should reload when ConfigMap volume mounted in init container changes — Deployment, DaemonSet, StatefulSet, ArgoRollout, DeploymentConfig
  • Reference Method Tests Init Container with Volume Mount should reload when Secret volume mounted in init container changes — Deployment, DaemonSet, StatefulSet, ArgoRollout, DeploymentConfig
  • Reference Method Tests Projected Volumes should reload when ConfigMap changes in mixed projected volume — Deployment, DaemonSet, StatefulSet, ArgoRollout, DeploymentConfig
  • Reference Method Tests Projected Volumes should reload when ConfigMap in projected volume changes — Deployment, DaemonSet, StatefulSet, ArgoRollout, DeploymentConfig
  • Reference Method Tests Projected Volumes should reload when Secret changes in mixed projected volume — Deployment, DaemonSet, StatefulSet, ArgoRollout, DeploymentConfig
  • Reference Method Tests Projected Volumes should reload when Secret in projected volume changes — Deployment, DaemonSet, StatefulSet, ArgoRollout, DeploymentConfig
  • Reference Method Tests valueFrom.configMapKeyRef should reload when ConfigMap referenced via valueFrom.configMapKeyRef changes — Deployment, DaemonSet, StatefulSet, ArgoRollout, DeploymentConfig
  • Reference Method Tests valueFrom.secretKeyRef should reload when Secret referenced via valueFrom.secretKeyRef changes — Deployment, DaemonSet, StatefulSet, ArgoRollout, DeploymentConfig

core/workloads_test.go

  • Workload Reload Tests Annotations Strategy should NOT reload when only ConfigMap labels change (no data change) — Deployment, DaemonSet, StatefulSet, ArgoRollout, DeploymentConfig
  • Workload Reload Tests Annotations Strategy should NOT reload when only Secret labels change (no data change) — Deployment, DaemonSet, StatefulSet, ArgoRollout, DeploymentConfig
  • Workload Reload Tests Annotations Strategy should NOT reload when only SecretProviderClassPodStatus labels change — Deployment, DaemonSet, StatefulSet, ArgoRollout, DeploymentConfig
  • Workload Reload Tests Annotations Strategy should reload when ConfigMap changes — Deployment, DaemonSet, StatefulSet, ArgoRollout, DeploymentConfig
  • Workload Reload Tests Annotations Strategy should reload when Secret changes — Deployment, DaemonSet, StatefulSet, ArgoRollout, DeploymentConfig
  • Workload Reload Tests Annotations Strategy should reload when SecretProviderClassPodStatus changes — Deployment, DaemonSet, StatefulSet, ArgoRollout, DeploymentConfig
  • Workload Reload Tests Annotations Strategy should reload with auto=true annotation when ConfigMap changes — Deployment, DaemonSet, StatefulSet, ArgoRollout, DeploymentConfig
  • Workload Reload Tests CronJob (special handling) should NOT reload without Reloader annotation — Deployment, DaemonSet, StatefulSet
  • Workload Reload Tests CronJob (special handling) should reload when volume-mounted ConfigMap changes — Deployment, DaemonSet, StatefulSet, ArgoRollout, DeploymentConfig
  • Workload Reload Tests CronJob (special handling) should reload when volume-mounted Secret changes — Deployment, DaemonSet, StatefulSet, ArgoRollout, DeploymentConfig
  • Workload Reload Tests CronJob (special handling) should trigger a Job when ConfigMap changes — CronJob
  • Workload Reload Tests CronJob (special handling) should trigger a Job when Secret changes — CronJob
  • Workload Reload Tests CronJob (special handling) should trigger a Job with auto=true annotation when ConfigMap changes — CronJob
  • Workload Reload Tests Edge Cases should NOT reload with auto=false annotation — Deployment, DaemonSet, StatefulSet, ArgoRollout, DeploymentConfig
  • Workload Reload Tests Edge Cases should reload multiple times for sequential ConfigMap updates — Deployment, DaemonSet, StatefulSet, ArgoRollout, DeploymentConfig
  • Workload Reload Tests Edge Cases should reload when either ConfigMap or Secret changes — Deployment, DaemonSet, StatefulSet, ArgoRollout, DeploymentConfig
  • Workload Reload Tests Edge Cases should reload with multiple ConfigMaps when any one changes — Deployment, DaemonSet, StatefulSet, ArgoRollout, DeploymentConfig
  • Workload Reload Tests Edge Cases should reload with multiple Secrets when any one changes — Deployment, DaemonSet, StatefulSet, ArgoRollout, DeploymentConfig
  • Workload Reload Tests EnvVars Strategy should add STAKATER_ env var when ConfigMap changes — Deployment, DaemonSet, StatefulSet, ArgoRollout, DeploymentConfig
  • Workload Reload Tests EnvVars Strategy should add STAKATER_ env var when Secret changes — Deployment, DaemonSet, StatefulSet, ArgoRollout, DeploymentConfig
  • Workload Reload Tests EnvVars Strategy should add STAKATER_ env var when SecretProviderClassPodStatus changes — Deployment, DaemonSet, StatefulSet, ArgoRollout, DeploymentConfig
  • Workload Reload Tests EnvVars Strategy should add STAKATER_ env var when SecretProviderClassPodStatus used by init container changes
  • Workload Reload Tests EnvVars Strategy should add STAKATER_ env var with secretproviderclass auto annotation
  • Workload Reload Tests EnvVars Strategy should NOT add STAKATER_ env var when excluded SecretProviderClassPodStatus changes
  • Workload Reload Tests EnvVars Strategy should NOT add STAKATER_ env var when only ConfigMap labels change — Deployment, DaemonSet, StatefulSet
  • Workload Reload Tests EnvVars Strategy should NOT add STAKATER_ env var when only Secret labels change — Deployment, DaemonSet, StatefulSet
  • Workload Reload Tests EnvVars Strategy should NOT add STAKATER_ env var when only SecretProviderClassPodStatus labels change — Deployment, DaemonSet, StatefulSet, ArgoRollout, DeploymentConfig
  • Workload Reload Tests Pod Template Annotations should NOT reload when pod template has ConfigMap annotation but Secret is updated — Deployment, DaemonSet, StatefulSet, ArgoRollout, DeploymentConfig
  • Workload Reload Tests Pod Template Annotations should reload when annotations are on both workload and pod template — Deployment, DaemonSet, StatefulSet, ArgoRollout, DeploymentConfig
  • Workload Reload Tests Pod Template Annotations should reload when auto=true annotation is on pod template only — Deployment, DaemonSet, StatefulSet, ArgoRollout, DeploymentConfig
  • Workload Reload Tests Pod Template Annotations should reload when ConfigMap annotation is on pod template only — Deployment, DaemonSet, StatefulSet, ArgoRollout, DeploymentConfig
  • Workload Reload Tests Pod Template Annotations should reload when Secret annotation is on pod template only — Deployment, DaemonSet, StatefulSet, ArgoRollout, DeploymentConfig
  • Workload Reload Tests Pod Template Annotations should reload when SecretProviderClass annotation is on pod template only — Deployment, DaemonSet, StatefulSet, ArgoRollout, DeploymentConfig
  • Workload Reload Tests Pod Template Annotations should reload when secretproviderclass auto annotation is on pod template only — Deployment, DaemonSet, StatefulSet, ArgoRollout, DeploymentConfig

csi/csi_test.go

  • CSI SecretProviderClass Tests Real Vault Integration Tests should handle multiple Vault secret updates
  • CSI SecretProviderClass Tests Real Vault Integration Tests should reload when Vault secret changes
  • CSI SecretProviderClass Tests Typed Auto Annotation Tests should reload for both ConfigMap and SPC when using combined auto=true

flags/auto_reload_all_test.go

  • Auto Reload All Flag Tests with autoReloadAll=true flag should reload workloads without any annotations when autoReloadAll is true
  • Auto Reload All Flag Tests with autoReloadAll=true flag should respect auto=false annotation even when autoReloadAll is true

flags/ignored_workloads_test.go

  • Ignored Workloads Flag Tests with both ignoreCronJobs=true and ignoreJobs=true flags should NOT reload CronJobs when both job flags are true — CronJob
  • Ignored Workloads Flag Tests with ignoreCronJobs=true flag should NOT reload CronJobs when ignoreCronJobs=true — CronJob
  • Ignored Workloads Flag Tests with ignoreCronJobs=true flag should still reload Deployments when ignoreCronJobs=true — CronJob

flags/ignore_resources_test.go

  • Ignore Resources Flag Tests with ignoreConfigMaps=true flag should NOT reload when ConfigMap changes with ignoreConfigMaps=true
  • Ignore Resources Flag Tests with ignoreConfigMaps=true flag should still reload when Secret changes with ignoreConfigMaps=true
  • Ignore Resources Flag Tests with ignoreSecrets=true flag should NOT reload when Secret changes with ignoreSecrets=true
  • Ignore Resources Flag Tests with ignoreSecrets=true flag should still reload when ConfigMap changes with ignoreSecrets=true

flags/namespace_ignore_test.go

  • Namespace Ignore Flag Tests with ignoreNamespaces flag should NOT reload in ignored namespace
  • Namespace Ignore Flag Tests with ignoreNamespaces flag should reload in watched (non-ignored) namespace

flags/namespace_selector_test.go

  • Namespace Selector Flag Tests with namespaceSelector flag should NOT reload workloads in non-matching namespaces
  • Namespace Selector Flag Tests with namespaceSelector flag should reload workloads in matching namespaces

flags/reload_on_create_test.go

  • Reload On Create Flag Tests with reloadOnCreate=false (default) should NOT reload when a new ConfigMap is created (default behavior)
  • Reload On Create Flag Tests with reloadOnCreate=true flag should reload when a new ConfigMap is created
  • Reload On Create Flag Tests with reloadOnCreate=true flag should reload when a new Secret is created

flags/reload_on_delete_test.go

  • Reload On Delete Flag Tests with reloadOnDelete=false (default) should NOT reload when a referenced ConfigMap is deleted (default behavior)
  • Reload On Delete Flag Tests with reloadOnDelete=true flag should reload when a referenced ConfigMap is deleted
  • Reload On Delete Flag Tests with reloadOnDelete=true flag should reload when a referenced Secret is deleted

flags/resource_selector_test.go

  • Resource Label Selector Flag Tests with resourceLabelSelector flag should NOT reload when unlabeled ConfigMap changes
  • Resource Label Selector Flag Tests with resourceLabelSelector flag should reload when labeled ConfigMap changes

flags/watch_globally_test.go

  • Watch Globally Flag Tests with watchGlobally=false flag should NOT reload workloads in other namespaces when watchGlobally=false
  • Watch Globally Flag Tests with watchGlobally=false flag should reload workloads in Reloader's namespace when watchGlobally=false
  • Watch Globally Flag Tests with watchGlobally=true flag (default) should reload workloads in any namespace when watchGlobally=true

@faizanahmad055 faizanahmad055 mentioned this pull request Jan 12, 2026
Copy link
Contributor

@msafwankarim msafwankarim left a comment

Choose a reason for hiding this comment

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

Is it possible to generate list of specs titles and add it in description maybe. Just for the overview and see if there is redundant or missing stuff

Rest looks good to me

@TheiLLeniumStudios
Copy link
Contributor Author

@msafwankarim added a list of all tests in the description

var secretControllerInitialized bool = false
var configmapControllerInitialized bool = false
var secretControllerInitialized = false
var configmapControllerInitialized = false
Copy link
Contributor

@faizanahmad055 faizanahmad055 Jan 21, 2026

Choose a reason for hiding this comment

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

Should we add some kind of synchronization here with atomic or mutex? Not sure but since multiple threads might try to access this, it could cause race condition or sync issues.

@faizanahmad055
Copy link
Contributor

Rest it looks okay. I ran the e2e and unit tests. It works great.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Overhauls the end-to-end testing setup by introducing a Ginkgo v2-based e2e suite with shared utilities (workload adapters + watch-based waits), plus Makefile/CI integration for provisioning infra and running the suite.

Changes:

  • Added a new Ginkgo v2 e2e test hierarchy (core, annotations, flags, advanced, csi, argo) and a comprehensive test/e2e/utils helper library.
  • Introduced watch-based waiting utilities and a workload adapter/registry pattern to run the same specs across multiple workload types.
  • Added Makefile targets, CI workflow updates, and cluster cleanup scripting; plus minor refactors/formatting across existing code.

Reviewed changes

Copilot reviewed 83 out of 89 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
test/loadtest/internal/cmd/run.go Import ordering / minor formatting cleanup.
test/loadtest/internal/cmd/report.go Struct field alignment / formatting.
test/e2e/utils/workload_statefulset.go Adds StatefulSet workload adapter.
test/e2e/utils/workload_openshift.go Adds OpenShift DeploymentConfig workload adapter.
test/e2e/utils/workload_job.go Adds Job workload adapter (recreation-oriented).
test/e2e/utils/workload_deployment.go Adds Deployment workload adapter (incl. pause/unpause checks).
test/e2e/utils/workload_daemonset.go Adds DaemonSet workload adapter.
test/e2e/utils/workload_cronjob.go Adds CronJob workload adapter (job-trigger checks).
test/e2e/utils/workload_argo.go Adds Argo Rollout workload adapter.
test/e2e/utils/workload_adapter.go Defines WorkloadAdapter interface + registry + capability interfaces.
test/e2e/utils/watch.go Adds generic watch-based waiting helpers and timeouts.
test/e2e/utils/utils.go Adds generic command runner + project-dir/kubeconfig helpers.
test/e2e/utils/testenv.go Adds TestEnvironment for wiring Kubernetes clients + per-suite namespaces/releases.
test/e2e/utils/test_helpers_test.go Unit tests for MergeAnnotations helper.
test/e2e/utils/test_helpers.go Adds MergeAnnotations helper.
test/e2e/utils/rand_test.go Unit tests for random name utilities.
test/e2e/utils/rand.go Adds RandSeq/RandName helper functions.
test/e2e/utils/podspec.go Adds PodSpec mutation helpers + ApplyWorkloadConfig.
test/e2e/utils/openshift.go Adds OpenShift API detection helper.
test/e2e/utils/helm_test.go Unit tests for Helm helper functions.
test/e2e/utils/helm.go Adds Helm-based deploy/undeploy helpers for Reloader + image parsing.
test/e2e/utils/conditions.go Adds generic watch conditions for readiness/annotations/envvars/CSI SPCPS checks.
test/e2e/utils/argo.go Adds typed helpers for Argo Rollouts creation/deletion and installation detection.
test/e2e/utils/annotations.go Adds annotation constants + builder helpers used across e2e tests.
test/e2e/utils/accessors.go Adds typed accessors used by generic conditions across workload kinds.
test/e2e/flags/watch_globally_test.go Adds watchGlobally flag coverage.
test/e2e/flags/resource_selector_test.go Adds resourceLabelSelector flag coverage.
test/e2e/flags/reload_on_delete_test.go Adds reloadOnDelete flag coverage.
test/e2e/flags/reload_on_create_test.go Adds reloadOnCreate flag coverage.
test/e2e/flags/namespace_selector_test.go Adds namespaceSelector flag coverage.
test/e2e/flags/namespace_ignore_test.go Adds ignoreNamespaces flag coverage.
test/e2e/flags/ignored_workloads_test.go Adds ignoreCronJobs/ignoreJobs flag coverage.
test/e2e/flags/ignore_resources_test.go Adds ignoreConfigMaps/ignoreSecrets flag coverage.
test/e2e/flags/flags_suite_test.go Flags suite bootstrapping (SetupTestEnvironment, deploy helpers).
test/e2e/flags/auto_reload_all_test.go Adds autoReloadAll flag coverage.
test/e2e/csi/csi_suite_test.go CSI suite bootstrapping + preflight skips.
test/e2e/core/core_suite_test.go Core suite bootstrapping + optional adapter registration (Argo/OpenShift).
test/e2e/argo/rollout_test.go Adds Argo-specific rollout strategy tests.
test/e2e/argo/argo_suite_test.go Argo suite bootstrapping + preflight skip.
test/e2e/annotations/search_match_test.go Adds search/match annotation behavior tests (incl. pending pod-template case).
test/e2e/annotations/resource_ignore_test.go Adds resource ignore annotation tests.
test/e2e/annotations/pause_period_test.go Adds pause-period behavior tests (incl. pending pod-template case).
test/e2e/annotations/annotations_suite_test.go Annotations suite bootstrapping + optional adapter registration.
test/e2e/advanced/regex_test.go Adds regex-based reload tests.
test/e2e/advanced/multi_container_test.go Adds multi-container and init-container CSI tests.
test/e2e/advanced/advanced_suite_test.go Advanced suite bootstrapping.
test/e2e/README.md Documents e2e setup/run workflow and suite structure.
scripts/e2e-cluster-cleanup.sh Adds cluster cleanup automation (Vault/CSI/Argo + test resources).
pkg/kube/client.go Comment spacing cleanup.
pkg/common/config.go Import ordering cleanup.
pkg/common/common.go Import ordering cleanup + parameter rename in ShouldReload.
internal/pkg/util/util_test.go Import ordering cleanup.
internal/pkg/util/util.go Import ordering cleanup.
internal/pkg/util/interface.go Changes type assertions to non-panicking style.
internal/pkg/testutil/kube.go Import ordering cleanup.
internal/pkg/leadership/leadership_test.go Import spacing cleanup.
internal/pkg/leadership/leadership.go Import ordering cleanup + goroutine loop minor tweak.
internal/pkg/handler/upgrade.go Import ordering cleanup + small naming/comment cleanups.
internal/pkg/handler/update.go Import ordering cleanup.
internal/pkg/handler/pause_deployment_test.go Improves error wrapping with %w + import ordering.
internal/pkg/handler/pause_deployment.go Import ordering cleanup.
internal/pkg/handler/handlers_test.go Adds unit tests for resource handler config/SHA behavior.
internal/pkg/handler/delete.go Minor refactor for safer type assertion usage + comment cleanup.
internal/pkg/handler/create.go Minor refactor for safer type assertion usage.
internal/pkg/controller/controller.go Refactors controller construction, list option modifier naming, and handler type assertion safety.
internal/pkg/app/app.go Minor variable rename for clarity.
Makefile Adds e2e targets + updates lint/fmt/test targets.
.golangci.yml Adds golangci-lint configuration (including ginkgo linter).
.gitignore Ignores *.test artifacts.
.github/workflows/pull_request.yaml Updates Kind version and wires e2e setup/run into PR workflow.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +55 to +58
opts := metav1.ListOptions{Watch: true}
if name != "" {
opts.FieldSelector = fields.OneTermEqualSelector("metadata.name", name).String()
}
Copy link

Copilot AI Feb 2, 2026

Choose a reason for hiding this comment

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

WatchUntil starts a watch without first checking current state (e.g., via GET/LIST). If the condition is already satisfied before the watch begins (common for fast updates like reload annotations), no event may be delivered and this will timeout/flap. Consider: (1) do an initial GET/LIST + condition check, and (2) start the watch from the returned ResourceVersion (or use client-go's watchtools.UntilWithSync-style list+watch).

Copilot uses AI. Check for mistakes.
Comment on lines +88 to +91
watcher, err := watchFunc(ctx, opts)
if err != nil {
return zero, false, nil
}
Copy link

Copilot AI Feb 2, 2026

Choose a reason for hiding this comment

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

watchOnce discards errors from watchFunc (return zero, false, nil). This turns real failures (RBAC, missing API, bad selector) into silent retries until ErrWatchTimeout, which makes debugging very hard. Prefer returning the error (possibly wrapped) or at least propagating the last error when timing out.

Copilot uses AI. Check for mistakes.
Comment on lines +67 to +70
result, done, err := watchOnce(ctx, watchFunc, opts, condition)
if done {
return result, err
}
Copy link

Copilot AI Feb 2, 2026

Choose a reason for hiding this comment

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

WatchUntil ignores any non-nil err from watchOnce when done is false. As written, ErrWatchError returned by watchOnce on watch.Error events is never surfaced to callers (it just loops until timeout). Either treat ErrWatchError as terminal (return it) or explicitly decide which errors are retryable and carry the last error forward.

Copilot uses AI. Check for mistakes.
Comment on lines +255 to +257
if cfg.UseInitContainerCSI && cfg.SPCName != "" {
AddCSIVolume(spec, 0, cfg.SPCName)
}
Copy link

Copilot AI Feb 2, 2026

Choose a reason for hiding this comment

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

UseInitContainerCSI calls AddCSIVolume(spec, 0, ...), which mounts the CSI volume onto the first main container, not an init container. That doesn't match the flag name and will lead to incorrect workload manifests if this config is used. Either implement init-container CSI mounting (volume + mount on spec.InitContainers[...]) or remove this option to avoid misleading behavior.

Copilot uses AI. Check for mistakes.
Comment on lines +24 to +26
if err := os.Chdir(cmd.Dir); err != nil {
_, _ = fmt.Fprintf(GinkgoWriter, "chdir dir: %q\n", err)
}
Copy link

Copilot AI Feb 2, 2026

Choose a reason for hiding this comment

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

Run sets cmd.Dir (good) but also calls os.Chdir(cmd.Dir), which mutates process-wide working directory and can introduce test flakiness if commands run concurrently in the same process. Since exec.Cmd already respects cmd.Dir, consider removing the os.Chdir call (or restoring the original cwd via defer).

Copilot uses AI. Check for mistakes.

test:
"$(GOCMD)" test -timeout 1800s -v ./...
"$(GOCMD)" test -timeout 1800s -v -short -count=1 ./internal/... ./test/e2e/utils/...
Copy link

Copilot AI Feb 2, 2026

Choose a reason for hiding this comment

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

make test now runs only ./internal/... and ./test/e2e/utils/..., which skips existing unit tests under ./pkg/... (e.g., pkg/common/common_test.go). If this is the CI entrypoint, it will silently drop coverage. Consider including ./pkg/... (or reverting to ./...) and controlling duration with -short/package exclusions instead.

Copilot uses AI. Check for mistakes.
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.

3 participants