-
Notifications
You must be signed in to change notification settings - Fork 355
test: Port tests to XKS #1268
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
test: Port tests to XKS #1268
Changes from all commits
12c2dee
1dbf748
4101fc2
0db97c5
8115bee
03dcbf1
218649b
a174968
c394a6d
c21c237
f3492f8
5af060f
bbbd3aa
43cfbfe
c71ed24
5b1ea9b
3fde5f3
42543a6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| apiVersion: argoproj.io/v1alpha1 | ||
| apiVersion: argoproj.io/v1beta1 | ||
| kind: ArgoCD | ||
| metadata: | ||
| name: argocd | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -273,6 +273,16 @@ func CreateRandomE2ETestNamespaceWithCleanupFunc() (*corev1.Namespace, func()) { | |
| return ns, nsDeletionFunc(ns) | ||
| } | ||
|
|
||
| // CreateNamespaceWithArgoCDInstance creates a random namespace, creates an ArgoCD instance with | ||
| // the given name in it, waits for it to be available, and returns the ArgoCD, namespace, and a | ||
| // cleanup func that deletes the namespace. | ||
| func CreateNamespaceWithArgoCDInstance(instanceName string) (*argov1beta1api.ArgoCD, *corev1.Namespace, func()) { | ||
| ns, cleanupFunc := CreateRandomE2ETestNamespaceWithCleanupFunc() | ||
| argoCDInstance := argocd.CreateNewArgoCDInstance(instanceName, ns.Name) | ||
| Eventually(argoCDInstance, "5m", "5s").Should(argocd.BeAvailable()) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🩺 Stability & Availability | 🟠 Major | 🏗️ Heavy lift 🔎 Supported by static analysis🏁 Script executed: #!/bin/bash
set -eu
printf '%s\n' '--- repository conventions and learnings ---'
find /tmp/coderabbit-repo-knowledge/redhat-developer-gitops-operator-63fb9d7f -type f -name '*.md' -maxdepth 3 -print 2>/dev/null | sort | head -80
printf '%s\n' '--- fixture.go relevant definitions ---'
sed -n '220,310p' test/openshift/e2e/ginkgo/fixture/fixture.go
printf '%s\n' '--- cleanup and helper callers ---'
rg -n -C 4 'CreateNamespaceWithArgoCDInstance|cleanupFunc|BeAvailable\(\)' test/openshift/e2e/ginkgoRepository: redhat-developer/gitops-operator Length of output: 50389 🏁 Script executed: #!/bin/bash
set -eu
printf '%s\n' '--- fixture helper and cleanup implementation ---'
rg -n -A45 -B12 'CreateNamespaceWithArgoCDInstance|CreateRandomE2ETestNamespaceWithCleanupFunc|CreateNamespaceWithCleanup' test/openshift/e2e/ginkgo/fixture/fixture.go
printf '%s\n' '--- exact callers 1-113 and 1-114 ---'
rg -l 'CreateNamespaceWithArgoCDInstance' test/openshift/e2e/ginkgo | while read -r f; do
echo "### $f"
rg -n -A18 -B12 'CreateNamespaceWithArgoCDInstance' "$f"
done
printf '%s\n' '--- relevant convention and learning filenames ---'
find /tmp/coderabbit-repo-knowledge/redhat-developer-gitops-operator-63fb9d7f -type f -name '*.md' -print 2>/dev/null | grep -E '/(conventions|learnings|architecture)/' | head -40Repository: redhat-developer/gitops-operator Length of output: 12564 Clean up the namespace when instance setup fails. If 🤖 Prompt for AI Agents |
||
| return argoCDInstance, ns, cleanupFunc | ||
| } | ||
|
|
||
| // Create namespace for tests having a specific label for identification | ||
| // - If the namespace already exists, it will be deleted first | ||
| func CreateNamespace(name string) *corev1.Namespace { | ||
|
|
@@ -670,7 +680,7 @@ func WaitForAllDeploymentsInTheNamespaceToBeReady(ns string, k8sClient client.Cl | |
| // All Deployments in NS are reconciled and ready | ||
| return true | ||
|
|
||
| }, "3m", "1s").Should(BeTrue()) | ||
| }, "5m", "1s").Should(BeTrue()) | ||
|
|
||
| // The above logic will successfully wait for Deployments to be ready. However, this does not mean that the operator's controller logic has completed it's initial cluster reconciliation logic (starting a watch then reconciling existing resources) | ||
| // - I'm not aware of a way to detect when this has completed, so instead I am inserting a 15 second pause. | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.