From b91de6dd29028cac05064c01b7a70c7debc19527 Mon Sep 17 00:00:00 2001 From: MrJack <36191829+biagiopietro@users.noreply.github.com> Date: Sun, 7 Dec 2025 19:14:14 +0100 Subject: [PATCH] Remove unneeded comments Signed-off-by: MrJack <36191829+biagiopietro@users.noreply.github.com> --- pkg/action/install_test.go | 6 ------ pkg/action/upgrade_test.go | 8 -------- 2 files changed, 14 deletions(-) diff --git a/pkg/action/install_test.go b/pkg/action/install_test.go index 775870e55..792944fa9 100644 --- a/pkg/action/install_test.go +++ b/pkg/action/install_test.go @@ -413,17 +413,14 @@ func TestInstallRelease_DryRunClient(t *testing.T) { } func TestInstallRelease_DryRunServerValidation(t *testing.T) { - // Test that server-side dry-run actually calls the Kubernetes API for validation is := assert.New(t) - // Use a fixture that returns dummy resources so our code path is exercised config := actionConfigFixtureWithDummyResources(t, createDummyResourceList(false)) instAction := NewInstall(config) instAction.Namespace = "spaced" instAction.ReleaseName = "test-server-dry-run" - // Set up the fake client to return an error on Create expectedErr := errors.New("validation error: unknown field in spec") config.KubeClient.(*kubefake.FailingKubeClient).CreateError = expectedErr instAction.DryRunStrategy = DryRunServer @@ -431,11 +428,9 @@ func TestInstallRelease_DryRunServerValidation(t *testing.T) { vals := map[string]interface{}{} _, err := instAction.Run(buildChart(withSampleTemplates()), vals) - // The error from the API should be returned is.Error(err) is.Contains(err.Error(), "validation error") - // Reset and test that client-side dry-run does NOT call the API config2 := actionConfigFixtureWithDummyResources(t, createDummyResourceList(false)) config2.KubeClient.(*kubefake.FailingKubeClient).CreateError = expectedErr @@ -445,7 +440,6 @@ func TestInstallRelease_DryRunServerValidation(t *testing.T) { instAction2.DryRunStrategy = DryRunClient resi, err := instAction2.Run(buildChart(withSampleTemplates()), vals) - // Client-side dry-run should succeed since it doesn't call the API is.NoError(err) res, err := releaserToV1Release(resi) is.NoError(err) diff --git a/pkg/action/upgrade_test.go b/pkg/action/upgrade_test.go index e649f1957..f081690cf 100644 --- a/pkg/action/upgrade_test.go +++ b/pkg/action/upgrade_test.go @@ -636,23 +636,19 @@ func TestUpgradeRelease_DryRun(t *testing.T) { } func TestUpgradeRelease_DryRunServerValidation(t *testing.T) { - // Test that server-side dry-run actually calls the Kubernetes API for validation is := assert.New(t) req := require.New(t) - // Use a fixture that returns dummy resources so our code path is exercised config := actionConfigFixtureWithDummyResources(t, createDummyResourceList(true)) upAction := NewUpgrade(config) upAction.Namespace = "spaced" - // Create a previous release rel := releaseStub() rel.Name = "test-server-dry-run" rel.Info.Status = common.StatusDeployed req.NoError(upAction.cfg.Releases.Create(rel)) - // Set up the fake client to return an error on Update expectedErr := errors.New("validation error: unknown field in spec") config.KubeClient.(*kubefake.FailingKubeClient).UpdateError = expectedErr upAction.DryRunStrategy = DryRunServer @@ -662,18 +658,15 @@ func TestUpgradeRelease_DryRunServerValidation(t *testing.T) { _, err := upAction.RunWithContext(ctx, rel.Name, buildChart(), vals) done() - // The error from the API should be returned is.Error(err) is.Contains(err.Error(), "validation error") - // Reset and test that client-side dry-run does NOT call the API config2 := actionConfigFixtureWithDummyResources(t, createDummyResourceList(true)) config2.KubeClient.(*kubefake.FailingKubeClient).UpdateError = expectedErr upAction2 := NewUpgrade(config2) upAction2.Namespace = "spaced" - // Create a previous release rel2 := releaseStub() rel2.Name = "test-client-dry-run" rel2.Info.Status = common.StatusDeployed @@ -685,7 +678,6 @@ func TestUpgradeRelease_DryRunServerValidation(t *testing.T) { resi, err := upAction2.RunWithContext(ctx, rel2.Name, buildChart(), vals) done() - // Client-side dry-run should succeed since it doesn't call the API is.NoError(err) res, err := releaserToV1Release(resi) is.NoError(err)