github.com/argoproj/argo-cd/v3@v3.2.1/test/e2e/helm_test.go (about)

     1  package e2e
     2  
     3  import (
     4  	"fmt"
     5  	"net"
     6  	"net/http"
     7  	"os"
     8  	"strings"
     9  	"testing"
    10  
    11  	"github.com/argoproj/gitops-engine/pkg/health"
    12  	. "github.com/argoproj/gitops-engine/pkg/sync/common"
    13  	"github.com/stretchr/testify/assert"
    14  	corev1 "k8s.io/api/core/v1"
    15  
    16  	. "github.com/argoproj/argo-cd/v3/pkg/apis/application/v1alpha1"
    17  	"github.com/argoproj/argo-cd/v3/test/e2e/fixture"
    18  	. "github.com/argoproj/argo-cd/v3/test/e2e/fixture/app"
    19  	projectFixture "github.com/argoproj/argo-cd/v3/test/e2e/fixture/project"
    20  	"github.com/argoproj/argo-cd/v3/util/errors"
    21  )
    22  
    23  func TestHelmHooksAreCreated(t *testing.T) {
    24  	Given(t).
    25  		Path("hook").
    26  		When().
    27  		PatchFile("hook.yaml", `[{"op": "replace", "path": "/metadata/annotations", "value": {"helm.sh/hook": "pre-install"}}]`).
    28  		CreateApp().
    29  		Sync().
    30  		Then().
    31  		Expect(OperationPhaseIs(OperationSucceeded)).
    32  		Expect(HealthIs(health.HealthStatusHealthy)).
    33  		Expect(SyncStatusIs(SyncStatusCodeSynced)).
    34  		Expect(ResourceResultIs(ResourceResult{Version: "v1", Kind: "Pod", Namespace: fixture.DeploymentNamespace(), Name: "hook", Message: "pod/hook created", Images: []string{"quay.io/argoprojlabs/argocd-e2e-container:0.1"}, HookType: HookTypePreSync, HookPhase: OperationSucceeded, SyncPhase: SyncPhasePreSync}))
    35  }
    36  
    37  // make sure we treat Helm weights as a sync wave
    38  func TestHelmHookWeight(t *testing.T) {
    39  	Given(t).
    40  		Path("hook").
    41  		When().
    42  		// this create a weird hook, that runs during sync - but before the pod, and because it'll fail - the pod will never be created
    43  		PatchFile("hook.yaml", `[
    44  	{"op": "replace", "path": "/metadata/annotations", "value": {"argocd.argoproj.io/hook": "Sync", "helm.sh/hook-weight": "-1"}},
    45  	{"op": "replace", "path": "/spec/containers/0/command/0", "value": "false"}
    46  ]`).
    47  		CreateApp().
    48  		IgnoreErrors().
    49  		Sync().
    50  		Then().
    51  		Expect(OperationPhaseIs(OperationFailed)).
    52  		Expect(ResourceResultNumbering(1))
    53  }
    54  
    55  // make sure that execute the delete policy
    56  func TestHelmHookDeletePolicy(t *testing.T) {
    57  	Given(t).
    58  		Path("hook").
    59  		When().
    60  		PatchFile("hook.yaml", `[{"op": "add", "path": "/metadata/annotations/helm.sh~1hook-delete-policy", "value": "hook-succeeded"}]`).
    61  		CreateApp().
    62  		Sync().
    63  		Then().
    64  		Expect(OperationPhaseIs(OperationSucceeded)).
    65  		Expect(ResourceResultNumbering(2)).
    66  		Expect(NotPod(func(p corev1.Pod) bool { return p.Name == "hook" }))
    67  }
    68  
    69  func TestDeclarativeHelm(t *testing.T) {
    70  	Given(t).
    71  		Path("helm").
    72  		When().
    73  		Declarative("declarative-apps/app.yaml").
    74  		Sync().
    75  		Then().
    76  		Expect(OperationPhaseIs(OperationSucceeded)).
    77  		Expect(HealthIs(health.HealthStatusHealthy)).
    78  		Expect(SyncStatusIs(SyncStatusCodeSynced))
    79  }
    80  
    81  func TestDeclarativeHelmInvalidValuesFile(t *testing.T) {
    82  	Given(t).
    83  		Path("helm").
    84  		When().
    85  		Declarative("declarative-apps/invalid-helm.yaml").
    86  		Then().
    87  		Expect(HealthIs(health.HealthStatusHealthy)).
    88  		Expect(SyncStatusIs(SyncStatusCodeUnknown)).
    89  		Expect(Condition(ApplicationConditionComparisonError, "does-not-exist-values.yaml: no such file or directory"))
    90  }
    91  
    92  func TestHelmRepo(t *testing.T) {
    93  	fixture.SkipOnEnv(t, "HELM")
    94  	Given(t).
    95  		CustomCACertAdded().
    96  		HelmRepoAdded("custom-repo").
    97  		RepoURLType(fixture.RepoURLTypeHelm).
    98  		Chart("helm").
    99  		Revision("1.0.0").
   100  		When().
   101  		CreateApp().
   102  		Then().
   103  		When().
   104  		Sync().
   105  		Then().
   106  		Expect(OperationPhaseIs(OperationSucceeded)).
   107  		Expect(HealthIs(health.HealthStatusHealthy)).
   108  		Expect(SyncStatusIs(SyncStatusCodeSynced))
   109  }
   110  
   111  func TestHelmValues(t *testing.T) {
   112  	Given(t).
   113  		Path("helm").
   114  		When().
   115  		AddFile("foo.yml", "").
   116  		CreateApp().
   117  		AppSet("--values", "foo.yml").
   118  		Then().
   119  		And(func(app *Application) {
   120  			assert.Equal(t, []string{"foo.yml"}, app.Spec.GetSource().Helm.ValueFiles)
   121  		})
   122  }
   123  
   124  func TestHelmIgnoreMissingValueFiles(t *testing.T) {
   125  	Given(t).
   126  		Path("helm").
   127  		When().
   128  		Declarative("declarative-apps/invalid-helm.yaml").
   129  		Then().
   130  		And(func(app *Application) {
   131  			assert.Equal(t, []string{"does-not-exist-values.yaml"}, app.Spec.GetSource().Helm.ValueFiles)
   132  			assert.False(t, app.Spec.GetSource().Helm.IgnoreMissingValueFiles)
   133  		}).
   134  		When().
   135  		AppSet("--ignore-missing-value-files").
   136  		Then().
   137  		And(func(app *Application) {
   138  			assert.True(t, app.Spec.GetSource().Helm.IgnoreMissingValueFiles)
   139  		}).
   140  		When().
   141  		Sync().
   142  		Then().
   143  		Expect(OperationPhaseIs(OperationSucceeded)).
   144  		Expect(HealthIs(health.HealthStatusHealthy)).
   145  		Expect(SyncStatusIs(SyncStatusCodeSynced)).
   146  		When().
   147  		AppUnSet("--ignore-missing-value-files").
   148  		Then().
   149  		And(func(app *Application) {
   150  			assert.False(t, app.Spec.GetSource().Helm.IgnoreMissingValueFiles)
   151  		}).
   152  		When().
   153  		IgnoreErrors().
   154  		Sync().
   155  		Then().
   156  		Expect(ErrorRegex("Error: open .*does-not-exist-values.yaml: no such file or directory", ""))
   157  }
   158  
   159  func TestHelmValuesMultipleUnset(t *testing.T) {
   160  	Given(t).
   161  		Path("helm").
   162  		When().
   163  		AddFile("foo.yml", "").
   164  		AddFile("baz.yml", "").
   165  		CreateApp().
   166  		AppSet("--values", "foo.yml", "--values", "baz.yml").
   167  		Then().
   168  		And(func(app *Application) {
   169  			assert.NotNil(t, app.Spec.GetSource().Helm)
   170  			assert.Equal(t, []string{"foo.yml", "baz.yml"}, app.Spec.GetSource().Helm.ValueFiles)
   171  		}).
   172  		When().
   173  		AppUnSet("--values", "foo.yml").
   174  		Then().
   175  		And(func(app *Application) {
   176  			assert.NotNil(t, app.Spec.GetSource().Helm)
   177  			assert.Equal(t, []string{"baz.yml"}, app.Spec.GetSource().Helm.ValueFiles)
   178  		}).
   179  		When().
   180  		AppUnSet("--values", "baz.yml").
   181  		Then().
   182  		And(func(app *Application) {
   183  			assert.Nil(t, app.Spec.GetSource().Helm)
   184  		})
   185  }
   186  
   187  func TestHelmValuesLiteralFileLocal(t *testing.T) {
   188  	Given(t).
   189  		Path("helm").
   190  		When().
   191  		CreateApp().
   192  		AppSet("--values-literal-file", "testdata/helm/baz.yaml").
   193  		Then().
   194  		And(func(app *Application) {
   195  			data, err := os.ReadFile("testdata/helm/baz.yaml")
   196  			if err != nil {
   197  				panic(err)
   198  			}
   199  			assert.Equal(t, strings.TrimSuffix(string(data), "\n"), app.Spec.GetSource().Helm.ValuesString())
   200  		}).
   201  		When().
   202  		AppUnSet("--values-literal").
   203  		Then().
   204  		And(func(app *Application) {
   205  			assert.Nil(t, app.Spec.GetSource().Helm)
   206  		})
   207  }
   208  
   209  func TestHelmValuesLiteralFileRemote(t *testing.T) {
   210  	sentinel := "a: b"
   211  	serve := func(c chan<- string) {
   212  		// listen on first available dynamic (unprivileged) port
   213  		listener, err := net.Listen("tcp", ":0")
   214  		if err != nil {
   215  			panic(err)
   216  		}
   217  
   218  		// send back the address so that it can be used
   219  		c <- listener.Addr().String()
   220  		http.HandleFunc("/", func(w http.ResponseWriter, _ *http.Request) {
   221  			// return the sentinel text at root URL
   222  			fmt.Fprint(w, sentinel)
   223  		})
   224  
   225  		panic(http.Serve(listener, nil))
   226  	}
   227  	c := make(chan string, 1)
   228  
   229  	// run a local webserver to test data retrieval
   230  	go serve(c)
   231  	address := <-c
   232  	t.Logf("Listening at address: %s", address)
   233  
   234  	Given(t).
   235  		Path("helm").
   236  		When().
   237  		CreateApp().
   238  		AppSet("--values-literal-file", "http://"+address).
   239  		Then().
   240  		And(func(app *Application) {
   241  			assert.Equal(t, "a: b", app.Spec.GetSource().Helm.ValuesString())
   242  		}).
   243  		When().
   244  		AppUnSet("--values-literal").
   245  		Then().
   246  		And(func(app *Application) {
   247  			assert.Nil(t, app.Spec.GetSource().Helm)
   248  		})
   249  }
   250  
   251  func TestHelmCrdHook(t *testing.T) {
   252  	fixture.SkipOnEnv(t, "HELM")
   253  	Given(t).
   254  		Path("helm-crd").
   255  		When().
   256  		CreateApp().
   257  		Sync().
   258  		Then().
   259  		Expect(OperationPhaseIs(OperationSucceeded)).
   260  		Expect(HealthIs(health.HealthStatusHealthy)).
   261  		Expect(SyncStatusIs(SyncStatusCodeSynced)).
   262  		Expect(ResourceResultNumbering(2))
   263  }
   264  
   265  func TestHelmReleaseName(t *testing.T) {
   266  	Given(t).
   267  		Path("helm").
   268  		When().
   269  		CreateApp().
   270  		AppSet("--release-name", "foo").
   271  		Then().
   272  		And(func(app *Application) {
   273  			assert.Equal(t, "foo", app.Spec.GetSource().Helm.ReleaseName)
   274  		})
   275  }
   276  
   277  func TestHelmSet(t *testing.T) {
   278  	Given(t).
   279  		Path("helm").
   280  		When().
   281  		CreateApp().
   282  		AppSet("--helm-set", "foo=bar", "--helm-set", "foo=baz", "--helm-set", "app=$ARGOCD_APP_NAME").
   283  		Then().
   284  		And(func(app *Application) {
   285  			assert.Equal(t, []HelmParameter{{Name: "foo", Value: "baz"}, {Name: "app", Value: "$ARGOCD_APP_NAME"}}, app.Spec.GetSource().Helm.Parameters)
   286  		})
   287  }
   288  
   289  func TestHelmSetString(t *testing.T) {
   290  	Given(t).
   291  		Path("helm").
   292  		When().
   293  		CreateApp().
   294  		AppSet("--helm-set-string", "foo=bar", "--helm-set-string", "foo=baz", "--helm-set-string", "app=$ARGOCD_APP_NAME").
   295  		Then().
   296  		And(func(app *Application) {
   297  			assert.Equal(t, []HelmParameter{{Name: "foo", Value: "baz", ForceString: true}, {Name: "app", Value: "$ARGOCD_APP_NAME", ForceString: true}}, app.Spec.GetSource().Helm.Parameters)
   298  		})
   299  }
   300  
   301  func TestHelmSetFile(t *testing.T) {
   302  	Given(t).
   303  		Path("helm").
   304  		When().
   305  		CreateApp().
   306  		AppSet("--helm-set-file", "foo=bar.yaml", "--helm-set-file", "foo=baz.yaml").
   307  		Then().
   308  		And(func(app *Application) {
   309  			assert.Equal(t, []HelmFileParameter{{Name: "foo", Path: "baz.yaml"}}, app.Spec.GetSource().Helm.FileParameters)
   310  		})
   311  }
   312  
   313  // ensure we can use envsubst in "set" variables
   314  func TestHelmSetEnv(t *testing.T) {
   315  	Given(t).
   316  		Path("helm-values").
   317  		When().
   318  		CreateApp().
   319  		AppSet("--helm-set", "foo=$ARGOCD_APP_NAME").
   320  		Sync().
   321  		Then().
   322  		Expect(OperationPhaseIs(OperationSucceeded)).
   323  		Expect(SyncStatusIs(SyncStatusCodeSynced)).
   324  		And(func(_ *Application) {
   325  			assert.Equal(t, fixture.Name(), errors.NewHandler(t).FailOnErr(fixture.Run(".", "kubectl", "-n", fixture.DeploymentNamespace(), "get", "cm", "my-map", "-o", "jsonpath={.data.foo}")).(string))
   326  		})
   327  }
   328  
   329  func TestHelmSetStringEnv(t *testing.T) {
   330  	Given(t).
   331  		Path("helm-values").
   332  		When().
   333  		CreateApp().
   334  		AppSet("--helm-set-string", "foo=$ARGOCD_APP_NAME").
   335  		Sync().
   336  		Then().
   337  		Expect(OperationPhaseIs(OperationSucceeded)).
   338  		Expect(SyncStatusIs(SyncStatusCodeSynced)).
   339  		And(func(_ *Application) {
   340  			assert.Equal(t, fixture.Name(), errors.NewHandler(t).FailOnErr(fixture.Run(".", "kubectl", "-n", fixture.DeploymentNamespace(), "get", "cm", "my-map", "-o", "jsonpath={.data.foo}")).(string))
   341  		})
   342  }
   343  
   344  // make sure kube-version gets passed down to resources
   345  func TestKubeVersion(t *testing.T) {
   346  	fixture.SkipOnEnv(t, "HELM")
   347  	Given(t).
   348  		Path("helm-kube-version").
   349  		When().
   350  		CreateApp().
   351  		Sync().
   352  		Then().
   353  		Expect(SyncStatusIs(SyncStatusCodeSynced)).
   354  		And(func(_ *Application) {
   355  			kubeVersion := errors.NewHandler(t).FailOnErr(fixture.Run(".", "kubectl", "-n", fixture.DeploymentNamespace(), "get", "cm", "my-map",
   356  				"-o", "jsonpath={.data.kubeVersion}")).(string)
   357  			// Capabilities.KubeVersion defaults to 1.9.0, we assume here you are running a later version
   358  			assert.LessOrEqual(t, fixture.GetVersions(t).ServerVersion.Format("v%s.%s.0"), kubeVersion)
   359  		}).
   360  		When().
   361  		// Make sure override works.
   362  		AppSet("--helm-kube-version", "999.999.999").
   363  		Sync().
   364  		Then().
   365  		Expect(SyncStatusIs(SyncStatusCodeSynced)).
   366  		And(func(_ *Application) {
   367  			assert.Equal(t, "v999.999.999", errors.NewHandler(t).FailOnErr(fixture.Run(".", "kubectl", "-n", fixture.DeploymentNamespace(), "get", "cm", "my-map",
   368  				"-o", "jsonpath={.data.kubeVersion}")).(string))
   369  		})
   370  }
   371  
   372  // make sure api versions gets passed down to resources
   373  func TestApiVersions(t *testing.T) {
   374  	fixture.SkipOnEnv(t, "HELM")
   375  	Given(t).
   376  		Path("helm-api-versions").
   377  		When().
   378  		CreateApp().
   379  		Sync().
   380  		Then().
   381  		Expect(SyncStatusIs(SyncStatusCodeSynced)).
   382  		And(func(_ *Application) {
   383  			apiVersions := errors.NewHandler(t).FailOnErr(fixture.Run(".", "kubectl", "-n", fixture.DeploymentNamespace(), "get", "cm", "my-map",
   384  				"-o", "jsonpath={.data.apiVersions}")).(string)
   385  			// The v1 API shouldn't be going anywhere.
   386  			assert.Contains(t, apiVersions, "v1")
   387  		}).
   388  		When().
   389  		// Make sure override works.
   390  		AppSet("--helm-api-versions", "v1/MyTestResource").
   391  		Sync().
   392  		Then().
   393  		Expect(SyncStatusIs(SyncStatusCodeSynced)).
   394  		And(func(_ *Application) {
   395  			apiVersions := errors.NewHandler(t).FailOnErr(fixture.Run(".", "kubectl", "-n", fixture.DeploymentNamespace(), "get", "cm", "my-map",
   396  				"-o", "jsonpath={.data.apiVersions}")).(string)
   397  			assert.Contains(t, apiVersions, "v1/MyTestResource")
   398  		})
   399  }
   400  
   401  func TestHelmNamespaceOverride(t *testing.T) {
   402  	fixture.SkipOnEnv(t, "HELM")
   403  	Given(t).
   404  		Path("helm-namespace").
   405  		When().
   406  		CreateApp().
   407  		Sync().
   408  		Then().
   409  		Expect(SyncStatusIs(SyncStatusCodeSynced)).
   410  		When().
   411  		AppSet("--helm-namespace", "does-not-exist").
   412  		Then().
   413  		// The app should go out of sync, because the resource's target namespace changed.
   414  		Expect(SyncStatusIs(SyncStatusCodeOutOfSync))
   415  }
   416  
   417  func TestHelmValuesHiddenDirectory(t *testing.T) {
   418  	fixture.SkipOnEnv(t, "HELM")
   419  	Given(t).
   420  		Path(".hidden-helm").
   421  		When().
   422  		AddFile("foo.yaml", "").
   423  		CreateApp().
   424  		AppSet("--values", "foo.yaml").
   425  		Sync().
   426  		Then().
   427  		Expect(OperationPhaseIs(OperationSucceeded)).
   428  		Expect(HealthIs(health.HealthStatusHealthy)).
   429  		Expect(SyncStatusIs(SyncStatusCodeSynced))
   430  }
   431  
   432  func TestHelmWithDependencies(t *testing.T) {
   433  	fixture.SkipOnEnv(t, "HELM")
   434  
   435  	ctx := Given(t).
   436  		CustomCACertAdded().
   437  		// these are slow tests
   438  		Timeout(30).
   439  		HelmPassCredentials()
   440  
   441  	ctx = ctx.HelmRepoAdded("custom-repo")
   442  
   443  	helmVer := ""
   444  
   445  	ctx.Path("helm-with-dependencies").
   446  		When().
   447  		CreateApp("--helm-version", helmVer).
   448  		Sync().
   449  		Then().
   450  		Expect(SyncStatusIs(SyncStatusCodeSynced))
   451  }
   452  
   453  func TestHelmWithMultipleDependencies(t *testing.T) {
   454  	fixture.SkipOnEnv(t, "HELM")
   455  
   456  	Given(t).Path("helm-with-multiple-dependencies").
   457  		CustomCACertAdded().
   458  		// these are slow tests
   459  		Timeout(30).
   460  		HelmHTTPSCredentialsUserPassAdded().
   461  		HelmPassCredentials().
   462  		When().
   463  		CreateApp().
   464  		Sync().
   465  		Then().
   466  		Expect(SyncStatusIs(SyncStatusCodeSynced))
   467  }
   468  
   469  func TestHelmDependenciesPermissionDenied(t *testing.T) {
   470  	fixture.SkipOnEnv(t, "HELM")
   471  
   472  	projName := "argo-helm-project-denied"
   473  	projectFixture.
   474  		Given(t).
   475  		Name(projName).
   476  		Destination("*,*").
   477  		When().
   478  		Create().
   479  		AddSource(fixture.RepoURL(fixture.RepoURLTypeFile))
   480  
   481  	expectedErr := fmt.Sprintf("helm repos localhost:5000/myrepo are not permitted in project '%s'", projName)
   482  	GivenWithSameState(t).
   483  		Project(projName).
   484  		Path("helm-oci-with-dependencies").
   485  		CustomCACertAdded().
   486  		HelmHTTPSCredentialsUserPassAdded().
   487  		HelmPassCredentials().
   488  		When().
   489  		IgnoreErrors().
   490  		CreateApp().
   491  		Then().
   492  		Expect(Error("", expectedErr))
   493  
   494  	expectedErr = fmt.Sprintf("helm repos https://localhost:9443/argo-e2e/testdata.git/helm-repo/local, https://localhost:9443/argo-e2e/testdata.git/helm-repo/local2 are not permitted in project '%s'", projName)
   495  	GivenWithSameState(t).
   496  		Project(projName).
   497  		Path("helm-with-multiple-dependencies-permission-denied").
   498  		CustomCACertAdded().
   499  		HelmHTTPSCredentialsUserPassAdded().
   500  		HelmPassCredentials().
   501  		When().
   502  		IgnoreErrors().
   503  		CreateApp().
   504  		Then().
   505  		Expect(Error("", expectedErr))
   506  }
   507  
   508  func TestHelm3CRD(t *testing.T) {
   509  	fixture.SkipOnEnv(t, "HELM")
   510  	Given(t).
   511  		Path("helm3-crd").
   512  		When().
   513  		CreateApp().
   514  		Sync().
   515  		Then().
   516  		Expect(SyncStatusIs(SyncStatusCodeSynced)).
   517  		Expect(ResourceSyncStatusIs("CustomResourceDefinition", "crontabs.stable.example.com", SyncStatusCodeSynced))
   518  }
   519  
   520  func TestHelmRepoDiffLocal(t *testing.T) {
   521  	fixture.SkipOnEnv(t, "HELM")
   522  	helmTmp := t.TempDir()
   523  	Given(t).
   524  		CustomCACertAdded().
   525  		HelmRepoAdded("custom-repo").
   526  		RepoURLType(fixture.RepoURLTypeHelm).
   527  		Chart("helm").
   528  		Revision("1.0.0").
   529  		When().
   530  		CreateApp().
   531  		Then().
   532  		When().
   533  		Sync().
   534  		Then().
   535  		Expect(OperationPhaseIs(OperationSucceeded)).
   536  		Expect(HealthIs(health.HealthStatusHealthy)).
   537  		Expect(SyncStatusIs(SyncStatusCodeSynced)).
   538  		And(func(app *Application) {
   539  			t.Setenv("XDG_CONFIG_HOME", helmTmp)
   540  			errors.NewHandler(t).FailOnErr(fixture.Run("", "helm", "repo", "add", "custom-repo", fixture.GetEnvWithDefault("ARGOCD_E2E_HELM_SERVICE", fixture.RepoURL(fixture.RepoURLTypeHelm)),
   541  				"--username", fixture.GitUsername,
   542  				"--password", fixture.GitPassword,
   543  				"--cert-file", "../fixture/certs/argocd-test-client.crt",
   544  				"--key-file", "../fixture/certs/argocd-test-client.key",
   545  				"--ca-file", "../fixture/certs/argocd-test-ca.crt",
   546  			))
   547  			diffOutput, err := fixture.RunCli("app", "diff", app.Name, "--local", "testdata/helm")
   548  			assert.Empty(t, diffOutput)
   549  			assert.NoError(t, err)
   550  		})
   551  }
   552  
   553  func TestHelmOCIRegistry(t *testing.T) {
   554  	Given(t).
   555  		PushChartToOCIRegistry("testdata/helm-values", "helm-values", "1.0.0").
   556  		HelmOCIRepoAdded("myrepo").
   557  		RepoURLType(fixture.RepoURLTypeHelmOCI).
   558  		Chart("helm-values").
   559  		Revision("1.0.0").
   560  		When().
   561  		CreateApp().
   562  		Then().
   563  		When().
   564  		Sync().
   565  		Then().
   566  		Expect(OperationPhaseIs(OperationSucceeded)).
   567  		Expect(HealthIs(health.HealthStatusHealthy)).
   568  		Expect(SyncStatusIs(SyncStatusCodeSynced))
   569  }
   570  
   571  func TestGitWithHelmOCIRegistryDependencies(t *testing.T) {
   572  	Given(t).
   573  		PushChartToOCIRegistry("testdata/helm-values", "helm-values", "1.0.0").
   574  		HelmOCIRepoAdded("myrepo").
   575  		Path("helm-oci-with-dependencies").
   576  		When().
   577  		CreateApp().
   578  		Then().
   579  		When().
   580  		Sync().
   581  		Then().
   582  		Expect(OperationPhaseIs(OperationSucceeded)).
   583  		Expect(HealthIs(health.HealthStatusHealthy)).
   584  		Expect(SyncStatusIs(SyncStatusCodeSynced))
   585  }
   586  
   587  func TestHelmOCIRegistryWithDependencies(t *testing.T) {
   588  	Given(t).
   589  		PushChartToOCIRegistry("testdata/helm-values", "helm-values", "1.0.0").
   590  		PushChartToOCIRegistry("testdata/helm-oci-with-dependencies", "helm-oci-with-dependencies", "1.0.0").
   591  		HelmOCIRepoAdded("myrepo").
   592  		RepoURLType(fixture.RepoURLTypeHelmOCI).
   593  		Chart("helm-oci-with-dependencies").
   594  		Revision("1.0.0").
   595  		When().
   596  		CreateApp().
   597  		Then().
   598  		When().
   599  		Sync().
   600  		Then().
   601  		Expect(OperationPhaseIs(OperationSucceeded)).
   602  		Expect(HealthIs(health.HealthStatusHealthy)).
   603  		Expect(SyncStatusIs(SyncStatusCodeSynced))
   604  }
   605  
   606  func TestTemplatesGitWithHelmOCIDependencies(t *testing.T) {
   607  	Given(t).
   608  		PushChartToOCIRegistry("testdata/helm-values", "helm-values", "1.0.0").
   609  		HelmoOCICredentialsWithoutUserPassAdded().
   610  		Path("helm-oci-with-dependencies").
   611  		When().
   612  		CreateApp().
   613  		Then().
   614  		When().
   615  		Sync().
   616  		Then().
   617  		Expect(OperationPhaseIs(OperationSucceeded)).
   618  		Expect(HealthIs(health.HealthStatusHealthy)).
   619  		Expect(SyncStatusIs(SyncStatusCodeSynced))
   620  }
   621  
   622  func TestTemplatesHelmOCIWithDependencies(t *testing.T) {
   623  	Given(t).
   624  		PushChartToOCIRegistry("testdata/helm-values", "helm-values", "1.0.0").
   625  		PushChartToOCIRegistry("testdata/helm-oci-with-dependencies", "helm-oci-with-dependencies", "1.0.0").
   626  		HelmoOCICredentialsWithoutUserPassAdded().
   627  		RepoURLType(fixture.RepoURLTypeHelmOCI).
   628  		Chart("helm-oci-with-dependencies").
   629  		Revision("1.0.0").
   630  		When().
   631  		CreateApp().
   632  		Then().
   633  		When().
   634  		Sync().
   635  		Then().
   636  		Expect(OperationPhaseIs(OperationSucceeded)).
   637  		Expect(HealthIs(health.HealthStatusHealthy)).
   638  		Expect(SyncStatusIs(SyncStatusCodeSynced))
   639  }