Skip to content

Commit d20bd0f

Browse files
gcp-cherry-pick-bot[bot]crenshaw-dev
authored andcommitted
fix(test): broken e2e test (cherry-pick argoproj#22975) (argoproj#23017)
Signed-off-by: Michael Crenshaw <[email protected]> Co-authored-by: Michael Crenshaw <[email protected]>
1 parent b845252 commit d20bd0f

File tree

5 files changed

+44
-3
lines changed

5 files changed

+44
-3
lines changed

test/e2e/app_multiple_sources_test.go

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ func TestMultiSourceAppWithHelmExternalValueFiles(t *testing.T) {
6565
RepoURL: RepoURL(RepoURLTypeFile),
6666
Ref: "values",
6767
}, {
68-
RepoURL: "https://github.com/argoproj/argocd-example-apps.git",
68+
RepoURL: RepoURL(RepoURLTypeFile),
6969
TargetRevision: "HEAD",
7070
Path: "helm-guestbook",
7171
Helm: &ApplicationSourceHelm{
@@ -107,9 +107,13 @@ func TestMultiSourceAppWithHelmExternalValueFiles(t *testing.T) {
107107
for _, r := range app.Status.Resources {
108108
statusByName[r.Name] = r.Status
109109
}
110-
// check if the app has 3 resources, guestbook and 2 pods
111110
assert.Len(t, statusByName, 1)
112-
assert.Equal(t, SyncStatusCodeSynced, statusByName["helm-guestbook"])
111+
assert.Equal(t, SyncStatusCodeSynced, statusByName["guestbook-ui"])
112+
113+
// Confirm that the deployment has 3 replicas.
114+
output, err := Run("", "kubectl", "get", "deployment", "guestbook-ui", "-n", DeploymentNamespace(), "-o", "jsonpath={.spec.replicas}")
115+
require.NoError(t, err)
116+
assert.Equal(t, "3", output, "Expected 3 replicas for the helm-guestbook deployment")
113117
})
114118
}
115119

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
apiVersion: v2
2+
version: 1.0.0
3+
name: helm-guestbook
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: guestbook-ui
5+
labels:
6+
test: "true"
7+
spec:
8+
replicas: {{ .Values.replicas }}
9+
revisionHistoryLimit: 3
10+
selector:
11+
matchLabels:
12+
app: guestbook-ui
13+
template:
14+
metadata:
15+
labels:
16+
app: guestbook-ui
17+
spec:
18+
containers:
19+
- image: quay.io/argoprojlabs/argocd-e2e-container:0.2
20+
imagePullPolicy: IfNotPresent
21+
name: guestbook-ui
22+
ports:
23+
- containerPort: 80
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
name: guestbook-ui
5+
spec:
6+
ports:
7+
- port: 80
8+
targetPort: 80
9+
selector:
10+
app: guestbook-ui
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
replicas: 1

0 commit comments

Comments
 (0)