From 4c769e9de6401e857c2fc8ccdb6f132a7319b946 Mon Sep 17 00:00:00 2001 From: Lakshmi Javadekar <103459615+lakshmimsft@users.noreply.github.com> Date: Fri, 24 Jan 2025 12:07:17 -0800 Subject: [PATCH] Update long running test workflow to verify manifests are registered (#8298) # Description Apply same verification check as was done for cloud and non-cloud tests to check for registered manifests in long running test workflow. ## Type of change - This pull request is a minor refactor, code cleanup, test improvement, or other maintenance task and doesn't change the functionality of Radius (issue link optional). ## Contributor checklist Please verify that the PR meets the following requirements, where applicable: - An overview of proposed schema changes is included in a linked GitHub issue. - [ ] Yes - [ ] Not applicable - A design document PR is created in the [design-notes repository](https://github.com/radius-project/design-notes/), if new APIs are being introduced. - [ ] Yes - [ ] Not applicable - The design document has been reviewed and approved by Radius maintainers/approvers. - [ ] Yes - [ ] Not applicable - A PR for the [samples repository](https://github.com/radius-project/samples) is created, if existing samples are affected by the changes in this PR. - [ ] Yes - [ ] Not applicable - A PR for the [documentation repository](https://github.com/radius-project/docs) is created, if the changes in this PR affect the documentation or any user facing updates are made. - [ ] Yes - [ ] Not applicable - A PR for the [recipes repository](https://github.com/radius-project/recipes) is created, if existing recipes are affected by the changes in this PR. - [ ] Yes - [ ] Not applicable Signed-off-by: lakshmimsft --- .github/workflows/long-running-azure.yaml | 44 +++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/.github/workflows/long-running-azure.yaml b/.github/workflows/long-running-azure.yaml index 94f2e38cbe..38ec993969 100644 --- a/.github/workflows/long-running-azure.yaml +++ b/.github/workflows/long-running-azure.yaml @@ -404,6 +404,50 @@ jobs: rad install kubernetes --reinstall \ --chart ${{ env.RADIUS_CHART_LOCATION }} \ --set rp.image=${{ env.CONTAINER_REGISTRY }}/applications-rp,rp.tag=${{ env.REL_VERSION }},dynamicrp.image=${{ env.CONTAINER_REGISTRY }}/dynamic-rp,dynamicrp.tag=${{ env.REL_VERSION }},controller.image=${{ env.CONTAINER_REGISTRY }}/controller,controller.tag=${{ env.REL_VERSION }},ucp.image=${{ env.CONTAINER_REGISTRY }}/ucpd,ucp.tag=${{ env.REL_VERSION }} + + echo "*** Verify manifests are registered ***" + rm -f registermanifest_logs.txt + # Find the pod with container "ucp" + POD_NAME=$( + kubectl get pods -n radius-system \ + -o jsonpath='{range .items[*]}{.metadata.name}{" "}{.spec.containers[*].name}{"\n"}{end}' \ + | grep "ucp" \ + | head -n1 \ + | cut -d" " -f1 + ) + echo "Found ucp pod: $POD_NAME" + + if [ -z "$POD_NAME" ]; then + echo "No pod with container 'ucp' found in namespace radius-system." + exit 1 + fi + + # Poll logs for up to iterations, 30 seconds each (upto 3 minutes total) + for i in {1..6}; do + kubectl logs "$POD_NAME" -n radius-system | tee registermanifest_logs.txt > /dev/null + + # Exit on error + if grep -qi "Service initializer terminated with error" registermanifest_logs.txt; then + echo "Error found in ucp logs." + grep -i "Service initializer terminated with error" registermanifest_logs.txt + exit 1 + fi + + # Check for success + if grep -q "Successfully registered manifests" registermanifest_logs.txt; then + echo "Successfully registered manifests - message found." + break + fi + + echo "Logs not ready, waiting 30 seconds..." + sleep 30 + done + + # Final check to ensure success message was found + if ! grep -q "Successfully registered manifests" registermanifest_logs.txt; then + echo "Manifests not registered after 3 minutes." + exit 1 + fi - name: Configure Radius test workspace run: | set -x