Skip to content

Commit

Permalink
attempt to write a test
Browse files Browse the repository at this point in the history
  • Loading branch information
cardoe committed Apr 27, 2024
1 parent 383591f commit ea93b75
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions reposerver/repository/repository_test.go
Expand Up @@ -2208,6 +2208,44 @@ func TestGenerateManifestWithAnnotatedTagsAndMultiSourceApp(t *testing.T) {
}
}

func TestGenerateMultiSourceHelmWithFileParameter(t *testing.T) {

service := newService(t, "../../util/helm/testdata")

refSources := map[string]*argoappv1.RefTarget{}

refSources["$global"] = &argoappv1.RefTarget{
TargetRevision: "HEAD",
}

manifestRequest := &apiclient.ManifestRequest{
Repo: &argoappv1.Repository{},
ApplicationSource: &argoappv1.ApplicationSource{
Ref: "$global",
Path: "./redis",
TargetRevision: "HEAD",
Helm: &argoappv1.ApplicationSourceHelm{
ValueFiles: []string{"$global/redis/values-production.yaml"},
FileParameters: []argoappv1.HelmFileParameter{{
Name: "password",
Path: "$global/external/external-secret.txt",
}},
},
},
HasMultipleSources: true,
NoCache: true,
RefSources: refSources,
}

res, err := service.GenerateManifest(context.Background(), manifestRequest)
if err != nil {
t.Errorf("unexpected %s", err)
}

assert.NoError(t, err)
assert.Contains(t, res.Manifests[6], `"replicas":3`, "Values should not be overriden")
}

func TestFindResources(t *testing.T) {
testCases := []struct {
name string
Expand Down

0 comments on commit ea93b75

Please sign in to comment.