diff --git a/config/crd/bases/helm.toolkit.fluxcd.io_helmreleases.yaml b/config/crd/bases/helm.toolkit.fluxcd.io_helmreleases.yaml index 4f52a3864..3792414f1 100644 --- a/config/crd/bases/helm.toolkit.fluxcd.io_helmreleases.yaml +++ b/config/crd/bases/helm.toolkit.fluxcd.io_helmreleases.yaml @@ -1514,7 +1514,7 @@ spec: Helm test filters. properties: exclude: - description: Exclude is specifies wheter the named test + description: Exclude is specifies whether the named test should be excluded. type: boolean name: diff --git a/docs/api/helmrelease.md b/docs/api/helmrelease.md index ded792bff..3d02e4f32 100644 --- a/docs/api/helmrelease.md +++ b/docs/api/helmrelease.md @@ -456,46 +456,6 @@ string

DeploymentAction

DeploymentAction defines a consistent interface for Install and Upgrade.

-

Filter -

-

Filters holds the configuration for individual Helm test filters.

-
-
- - - - - - - - - - - - - - - - - -
FieldDescription
-name
- -string - -
-

Name is the name of the test.

-
-exclude
- -bool - -
-(Optional) -

Exclude is specifies wheter the named test should be excluded.

-
-
-

HelmChartTemplate

@@ -1904,19 +1864,6 @@ are run but fail. Can be overwritten for tests run after install or upgrade actions in ‘Install.IgnoreTestFailures’ and ‘Upgrade.IgnoreTestFailures’.

- - -filters
- - -[]./api/v2beta1.Filter - - - - -

Filters is a list of tests to run or exclude from running.

- - diff --git a/internal/action/test_test.go b/internal/action/test_test.go index b9dd71896..a78dcb78f 100644 --- a/internal/action/test_test.go +++ b/internal/action/test_test.go @@ -40,6 +40,15 @@ func Test_newTest(t *testing.T) { Timeout: &metav1.Duration{Duration: time.Minute}, Test: &v2.Test{ Timeout: &metav1.Duration{Duration: 10 * time.Second}, + Filters: &[]v2.Filter{ + { + Name: "test", + }, + { + Name: "test2", + Exclude: true, + }, + }, }, }, } @@ -48,6 +57,9 @@ func Test_newTest(t *testing.T) { g.Expect(got).ToNot(BeNil()) g.Expect(got.Namespace).To(Equal(obj.Namespace)) g.Expect(got.Timeout).To(Equal(obj.Spec.Test.Timeout.Duration)) + g.Expect(got.Filters).To(HaveLen(2)) + g.Expect(got.Filters).To(HaveKeyWithValue(Equal("name"), ContainElement("test"))) + g.Expect(got.Filters).To(HaveKeyWithValue(Equal("!name"), ContainElement("test2"))) }) t.Run("timeout fallback", func(t *testing.T) {