mirror of
https://github.com/hanzoai/cd.git
synced 2026-10-30 14:56:45 +00:00
The custom-kustomize-binary test fixture grepped for ARGOCD_APP_NAME, but the parameter injection code sets CD_APP_NAME, so the check always came up empty and TestKustomizeCustomVersion failed. Also replaced argo-cd/argo-cd-tests placeholder label and env values in kustomize_test.go, and the argo-cd chart-index key in util/helm/index_test.go, with our own naming. Left alone: util/helm/client_test.go's calls against the real, live argoproj.github.io/argo-helm chart repo and its published argo-cd chart (0.7.1) -- an actual network integration test, not branding text.
40 lines
775 B
Go
40 lines
775 B
Go
package helm
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
var index = Index{
|
|
Entries: map[string]Entries{
|
|
"cd": {
|
|
{Version: "~0.7.3"},
|
|
{Version: "0.7.1"},
|
|
{Version: "0.5.4"},
|
|
{Version: "0.5.3"},
|
|
{Version: "0.7.2"},
|
|
{Version: "0.5.2"},
|
|
{Version: "~0.5.2"},
|
|
{Version: "0.5.1"},
|
|
{Version: "0.5.0"},
|
|
},
|
|
},
|
|
}
|
|
|
|
func TestIndex_GetEntries(t *testing.T) {
|
|
t.Parallel()
|
|
t.Run("NotFound", func(t *testing.T) {
|
|
t.Parallel()
|
|
_, err := index.GetEntries("foo")
|
|
require.EqualError(t, err, "chart 'foo' not found in index")
|
|
})
|
|
t.Run("Found", func(t *testing.T) {
|
|
t.Parallel()
|
|
ts, err := index.GetEntries("cd")
|
|
require.NoError(t, err)
|
|
assert.Len(t, ts, len(index.Entries["cd"]))
|
|
})
|
|
}
|