Skip to content

Commit

Permalink
test: set forceString false in test
Browse files Browse the repository at this point in the history
Signed-off-by: daengdaengLee <[email protected]>
  • Loading branch information
daengdaengLee committed Sep 19, 2024
1 parent 3221f0a commit 54ff712
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions reposerver/repository/repository_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4155,6 +4155,12 @@ func Test_GenerateManifests_Commands(t *testing.T) {
Name: "test-param-name",
// Use build env var to test substitution.
Value: "test-value-$ARGOCD_APP_NAME",
ForceString: false,
},
{
Name: "test-param-name-forcestring",
// Use build env var to test substitution.
Value: "test-value-$ARGOCD_APP_NAME",
ForceString: true,
},
{
Expand All @@ -4178,7 +4184,7 @@ func Test_GenerateManifests_Commands(t *testing.T) {
res, err := service.GenerateManifest(context.Background(), &q)

require.NoError(t, err)
assert.Equal(t, []string{"helm template . --name-template test-app --namespace test-namespace --kube-version 1.2.3 --set test-param-bool-name=false --set-string test-param-name=test-value-test-app --set-file test-file-param-name=./test-file-param.yaml --values ./my-chart-values.yaml --values <temp file with values from source.helm.values/valuesObject> --api-versions v1/Test --api-versions v2/Test"}, res.Commands)
assert.Equal(t, []string{"helm template . --name-template test-app --namespace test-namespace --kube-version 1.2.3 --set test-param-name=test-value-test-app --set test-param-bool-name=false --set-string test-param-name-forcestring=test-value-$ARGOCD_APP_NAME --set-file test-file-param-name=./test-file-param.yaml --values ./my-chart-values.yaml --values <temp file with values from source.helm.values/valuesObject> --api-versions v1/Test --api-versions v2/Test"}, res.Commands)

t.Run("with overrides", func(t *testing.T) {
// These can be set explicitly instead of using inferred values. Make sure the overrides apply.
Expand All @@ -4190,7 +4196,7 @@ func Test_GenerateManifests_Commands(t *testing.T) {
res, err = service.GenerateManifest(context.Background(), &q)

require.NoError(t, err)
assert.Equal(t, []string{"helm template . --name-template different-release-name --namespace different-namespace --kube-version 5.6.7 --set test-param-bool-name=false --set-string test-param-name=test-value-test-app --set-file test-file-param-name=./test-file-param.yaml --values ./my-chart-values.yaml --values <temp file with values from source.helm.values/valuesObject> --api-versions v3 --api-versions v4"}, res.Commands)
assert.Equal(t, []string{"helm template . --name-template different-release-name --namespace different-namespace --kube-version 5.6.7 --set test-param-name=test-value-test-app --set test-param-bool-name=false --set-string test-param-name-forcestring=test-value-$ARGOCD_APP_NAME --set-file test-file-param-name=./test-file-param.yaml --values ./my-chart-values.yaml --values <temp file with values from source.helm.values/valuesObject> --api-versions v3 --api-versions v4"}, res.Commands)
})
})

Expand Down

0 comments on commit 54ff712

Please sign in to comment.