-
Notifications
You must be signed in to change notification settings - Fork 223
USHIFT-6491: Improve gitops test #6116
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: main
Are you sure you want to change the base?
Changes from all commits
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 |
|---|---|---|
|
|
@@ -3,8 +3,15 @@ Documentation MicroShift GitOps tests | |
| Resource ../../resources/microshift-process.resource | ||
|
|
||
| Suite Setup Setup Suite With Namespace | ||
| Suite Teardown Teardown Suite With Namespace | ||
| Suite Setup Setup Suite | ||
| Suite Teardown Teardown Suite | ||
|
|
||
|
|
||
| *** Variables *** | ||
| ${APPLICATION_MANIFEST_PATH} ${CURDIR}/spring-petclinic-app.yaml | ||
| ${APPLICATION_NAMESPACE} spring-petclinic | ||
| ${APPLICATION_NAME} spring-petclinic | ||
| ${GITOPS_NAMESPACE} openshift-gitops | ||
|
|
||
|
|
||
| *** Test Cases *** | ||
|
|
@@ -14,10 +21,28 @@ Verify GitOps Pods Start Correctly | |
| Wait Until Keyword Succeeds 2min 10s | ||
| ... All Pods Should Be Running openshift-gitops | ||
|
|
||
| Verify Workload Deployed Correctly | ||
| [Documentation] Deploys workload and waits for ready status | ||
| Verify Application Deployed Correctly | ||
| [Documentation] Deploys an application and waits for it to be Healthy | ||
| ... using the example from official docs: https://docs.redhat.com/en/documentation/red_hat_build_of_microshift/4.20/html/running_applications/microshift-gitops#microshift-gitops-adding-apps_microshift-gitops | ||
| [Setup] Setup Application Deployment | ||
|
|
||
| Wait Until Resource Exists applications ${APPLICATION_NAME} ${GITOPS_NAMESPACE} timeout=120s | ||
| Oc Wait | ||
| ... -n ${GITOPS_NAMESPACE} application ${APPLICATION_NAME} | ||
| ... --for=jsonpath='{.status.sync.status}'=Synced --timeout=300s | ||
| Oc Wait | ||
| ... -n ${APPLICATION_NAMESPACE} pod --selector=app=${APPLICATION_NAME} | ||
| ... --for=condition=Ready --timeout=300s | ||
|
Comment on lines
+29
to
+35
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. 🧩 Analysis chain🏁 Script executed: # Check if the file exists and examine the relevant section
if [ -f "test/suites/gitops/gitops.robot" ]; then
echo "=== File exists, showing lines 20-40 ==="
cat -n test/suites/gitops/gitops.robot | sed -n '20,40p'
else
echo "File not found at expected location"
find . -name "gitops.robot" -type f 2>/dev/null | head -5
fiRepository: openshift/microshift Length of output: 1200 🏁 Script executed: # Search for other uses of "Oc Wait" and "Synced" in the codebase to understand patterns
echo "=== Searching for Oc Wait usage patterns ==="
rg "Oc Wait" test/ --context 2 -A 2 -B 2 | head -50
echo -e "\n=== Searching for Application Synced patterns ==="
rg "Synced" test/ --context 1 | head -30Repository: openshift/microshift Length of output: 4388 🏁 Script executed: # Look for Wait Until Keyword Succeeds usage in the test suite
echo "=== Checking Wait Until Keyword Succeeds patterns ==="
rg "Wait Until Keyword Succeeds" test/ --context 1 | head -20Repository: openshift/microshift Length of output: 1566 Pod readiness check is racy after
Wrap the pod wait with retry logic to handle the creation delay: Suggested fix- Oc Wait
- ... -n ${APPLICATION_NAMESPACE} pod --selector=app=${APPLICATION_NAME}
- ... --for=condition=Ready --timeout=300s
+ Wait Until Keyword Succeeds 5min 10s
+ ... Oc Wait
+ ... -n ${APPLICATION_NAMESPACE} pod --selector=app=${APPLICATION_NAME}
+ ... --for=condition=Ready --timeout=30s🤖 Prompt for AI Agents |
||
|
|
||
| [Teardown] Teardown Application Deployment | ||
|
|
||
|
|
||
| *** Keywords *** | ||
| Setup Application Deployment | ||
| [Documentation] Setup the application deployment | ||
| Oc Apply -f ${APPLICATION_MANIFEST_PATH} | ||
|
|
||
| VAR ${manifest_path}= ${CURDIR}/test-deployment.yaml | ||
| Oc Apply -f ${manifest_path} -n ${NAMESPACE} | ||
| Wait Until Keyword Succeeds 5min 10s | ||
| ... Named Deployment Should Be Available test-app | ||
| Teardown Application Deployment | ||
| [Documentation] Teardown the application deployment | ||
| Oc Delete -f ${APPLICATION_MANIFEST_PATH} | ||
| Oc Delete ns ${APPLICATION_NAMESPACE} | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| kind: AppProject | ||
| apiVersion: argoproj.io/v1alpha1 | ||
| metadata: | ||
| name: default | ||
| namespace: openshift-gitops | ||
| spec: | ||
| clusterResourceWhitelist: | ||
| - group: '*' | ||
| kind: '*' | ||
| destinations: | ||
| - namespace: '*' | ||
| server: '*' | ||
| sourceRepos: | ||
| - '*' | ||
| --- | ||
| kind: Application | ||
| apiVersion: argoproj.io/v1alpha1 | ||
| metadata: | ||
| name: spring-petclinic | ||
| namespace: openshift-gitops | ||
| spec: | ||
| destination: | ||
| namespace: spring-petclinic | ||
| server: https://kubernetes.default.svc | ||
| project: default | ||
| source: | ||
| directory: | ||
| recurse: true | ||
| path: app | ||
| repoURL: https://github.com/siamaksade/openshift-gitops-getting-started | ||
| syncPolicy: | ||
| automated: {} | ||
| syncOptions: | ||
| - CreateNamespace=true | ||
| - ServerSideApply=true |
This file was deleted.
Uh oh!
There was an error while loading. Please reload this page.