Files
cd/cmd/util/applicationset_test.go
zeekay fe2ecab28e cmd: drop Argo wording from CLI help, comments, identifiers
Local identifiers (argoClientSet/argoDB/argoappv1/isArgoCDConfigMap
etc.), comments, and log/help text renamed to our own voice across the
cd, cd-server, cd-applicationset-controller, and util binaries. Left
the generated ArgoprojV1alpha1 clientset accessor and OAuth client-id
constants untouched (external contract). Fixed two stale test
fixtures that were silently broken by an earlier partial rename
(cluster_test.go's hostnames, app_test.go's TestTruncateString
expectation).
2026-09-05 01:21:56 -07:00

43 lines
862 B
Go

package util
import (
"testing"
"github.com/stretchr/testify/assert"
appv1 "github.com/hanzoai/cd/pkg/apis/application/v1alpha1"
)
var appSet = `apiVersion: apps.hanzo.ai/v1alpha1
kind: ApplicationSet
metadata:
name: guestbook
spec:
generators:
- list:
elements:
- cluster: engineering-dev
url: https://1.2.3.4
template:
metadata:
name: '{{cluster}}-guestbook'
spec:
source:
repoURL: https://github.com/infra-team/cluster-deployments.git
targetRevision: HEAD
path: guestbook/{{cluster}}
destination:
server: '{{url}}'
namespace: guestbook
`
func TestReadAppSet(t *testing.T) {
t.Parallel()
var appSets []*appv1.ApplicationSet
err := readAppset([]byte(appSet), &appSets)
if err != nil {
t.Log("Failed reading appset file")
}
assert.Len(t, appSets, 1)
}