From 811c4c20725e40426dbdc3d7096b1097ab89cd80 Mon Sep 17 00:00:00 2001 From: KryukovaPolina <32718724+KryukovaPolina@users.noreply.github.com> Date: Thu, 2 Apr 2026 17:09:39 +0300 Subject: [PATCH 1/7] refactor: upgrade consul config --- .github/workflows/consul.yaml | 62 +++++++++++----------- workflow-config/consul.yaml | 96 +++++++++++++++++++++-------------- 2 files changed, 88 insertions(+), 70 deletions(-) diff --git a/.github/workflows/consul.yaml b/.github/workflows/consul.yaml index b3bca930..0bbc47d6 100644 --- a/.github/workflows/consul.yaml +++ b/.github/workflows/consul.yaml @@ -134,7 +134,7 @@ jobs: # == Start Monitoring installation ======= - name: Install Monitoring - if: matrix.test.monitoring == true + if: matrix.test.install.monitoring == true uses: ./qubership-test-pipelines/actions/shared/helm_deploy with: path_to_template: templates/monitoring/vm_without_tests.yml @@ -146,14 +146,14 @@ jobs: restricted: false - name: Get Installed Monitoring CR name - if: matrix.test.monitoring == true + if: matrix.test.install.monitoring == true uses: ./qubership-test-pipelines/actions/shared/get_crds id: install_monitoring_get_crds with: crd_location: Netcracker/qubership-monitoring-operator/charts/qubership-monitoring-operator/crds - name: Verify Monitoring installation - if: matrix.test.monitoring == true + if: matrix.test.install.monitoring == true uses: ./qubership-test-pipelines/actions/shared/verify_installation with: namespace: monitoring @@ -161,7 +161,7 @@ jobs: test_completion_retry_interval: 10s service_ready_max_retries: 80 service_ready_retry_interval: 10s - artifact_name: Install_Monitoring_${{ matrix.test.artifact_name }} + artifact_name: ${{ matrix.test.install.artifact_name }}_monitoring monitoring_pipeline: true crd_list: ${{ steps.install_monitoring_get_crds.outputs.crd_names }} check_tests: true @@ -170,7 +170,7 @@ jobs: # == Start ======= Specific steps for TLS ======= - name: TLS specific step - if: matrix.test.tls == true + if: matrix.test.install.tls == true run: | echo "::group::Describe nodes" kubectl describe nodes @@ -201,7 +201,7 @@ jobs: # == Start ======= Specific steps for S3 ======= - name: Create S3 bucket id: create_bucket - if: matrix.test.s3 == true + if: matrix.test.install.s3 == true || matrix.test.upgrade.s3 == true uses: ./qubership-test-pipelines/actions/shared/setup_s3_bucket with: aws_access_key_id: ${{ secrets.AWS_S3_ACCESS_KEY_ID }} @@ -210,47 +210,47 @@ jobs: prefix: consul - name: Add s3 secrets to template (clean install) - if: matrix.test.s3 == true + if: matrix.test.install.s3 == true run: | echo "::group::Add secrets to template" python qubership-test-pipelines/scripts/update_yaml.py \ - --file='qubership-test-pipelines/templates/consul-service/consul_clean_all_on_sc_drd_s3_tls.yml' \ + --file='qubership-test-pipelines/${{ matrix.test.install.template }}' \ --path='backupDaemon/s3/keyId' \ --value='${{secrets.AWS_S3_ACCESS_KEY_ID}}' \ && python qubership-test-pipelines/scripts/update_yaml.py \ - --file='qubership-test-pipelines/templates/consul-service/consul_clean_all_on_sc_drd_s3_tls.yml' \ + --file='qubership-test-pipelines/${{ matrix.test.install.template }}' \ --path='backupDaemon/s3/keySecret' \ --value='${{secrets.AWS_S3_ACCESS_KEY_SECRET}}' \ && python qubership-test-pipelines/scripts/update_yaml.py \ - --file='qubership-test-pipelines/templates/consul-service/consul_clean_all_on_sc_drd_s3_tls.yml' \ + --file='qubership-test-pipelines/${{ matrix.test.install.template }}' \ --path='backupDaemon/s3/bucket' \ --value="${{ steps.create_bucket.outputs.bucket_name }}" # == End ======= Specific steps for S3 ======= # == Start ======= Specific steps for Allure report ======= - name: Add s3 backet for Allure report - if: matrix.test.allure == true + if: matrix.test.install.allure == true run: >- python qubership-test-pipelines/scripts/update_yaml.py - --file='qubership-test-pipelines/${{ matrix.test.template }}' + --file='qubership-test-pipelines/${{ matrix.test.install.template }}' --path='integrationTests/atpStorage/username' --value='${{secrets.AWS_S3_ACCESS_KEY_ID}}' && python qubership-test-pipelines/scripts/update_yaml.py - --file='qubership-test-pipelines/${{ matrix.test.template }}' + --file='qubership-test-pipelines/${{ matrix.test.install.template }}' --path='integrationTests/atpStorage/password' --value='${{secrets.AWS_S3_ACCESS_KEY_SECRET}}' # == End ======= Specific steps for Allure report ======= - name: Print clean install deployment parameters - run: cat qubership-test-pipelines/${{ matrix.test.template }} + run: cat qubership-test-pipelines/${{ matrix.test.install.template }} # == 02 Start ======= Common steps for all tests ======= - - name: Install Consul [${{ matrix.test.install_version }}] + - name: Install Consul [${{ matrix.test.install.version }}] uses: ./qubership-test-pipelines/actions/shared/helm_deploy id: consul_install with: - path_to_template: ${{ matrix.test.template }} - service_branch: ${{ matrix.test.install_version }} + path_to_template: ${{ matrix.test.install.template }} + service_branch: ${{ matrix.test.install.version }} service_name: consul repository_name: ${{ inputs.repository_name }} path_to_chart: charts/helm/consul-service @@ -272,8 +272,8 @@ jobs: uses: ./qubership-test-pipelines/actions/shared/collect_diag_info with: namespace: consul - artifact_name: Installation_${{ matrix.test.artifact_name }} - service_branch: ${{ matrix.test.install_version }} + artifact_name: ${{ matrix.test.install.artifact_name }} + service_branch: ${{ matrix.test.install.version }} - name: Delete status-provisioner job shell: bash @@ -282,35 +282,35 @@ jobs: # == Start ======= Specific steps for S3 ======= - name: Add s3 secrets to template (upgrade) - if: matrix.test.sequence == 'upgrade' && matrix.test.s3 == true + if: matrix.test.sequence == 'upgrade' && matrix.test.upgrade.s3 == true shell: bash run: | python qubership-test-pipelines/scripts/update_yaml.py \ - --file='qubership-test-pipelines/templates/consul-service/consul_clean_all_on_sc_drd_s3.yml' \ + --file='qubership-test-pipelines/${{ matrix.test.upgrade.template }}' \ --path='backupDaemon/s3/keyId' \ --value='${{secrets.AWS_S3_ACCESS_KEY_ID}}' \ && python qubership-test-pipelines/scripts/update_yaml.py \ - --file='qubership-test-pipelines/templates/consul-service/consul_clean_all_on_sc_drd_s3.yml' \ + --file='qubership-test-pipelines/${{ matrix.test.upgrade.template }}' \ --path='backupDaemon/s3/keySecret' \ --value='${{secrets.AWS_S3_ACCESS_KEY_SECRET}}' \ && python qubership-test-pipelines/scripts/update_yaml.py \ - --file='qubership-test-pipelines/templates/consul-service/consul_clean_all_on_sc_drd_s3.yml' \ + --file='qubership-test-pipelines/${{ matrix.test.upgrade.template }}' \ --path='backupDaemon/s3/bucket' \ --value="${{ steps.create_bucket.outputs.bucket_name }}" - name: Print upgrade deployment parameters - if: matrix.test.sequence == 'upgrade' && matrix.test.s3 == true - run: cat qubership-test-pipelines/${{ matrix.test.upgrade_template }} + if: matrix.test.sequence == 'upgrade' && matrix.test.upgrade.s3 == true + run: cat qubership-test-pipelines/${{ matrix.test.upgrade.template }} # == End ======= Specific steps for S3 ======= # == Start ======= Specific steps for upgrade tests ======= - - name: Upgrade to [${{ matrix.test.upgrade_version }}] + - name: Upgrade to [${{ matrix.test.upgrade.version }}] if: matrix.test.sequence == 'upgrade' uses: ./qubership-test-pipelines/actions/shared/helm_deploy id: consul_upgrade with: - path_to_template: ${{ matrix.test.upgrade_template }} - service_branch: ${{ matrix.test.upgrade_version }} + path_to_template: ${{ matrix.test.upgrade.template }} + service_branch: ${{ matrix.test.upgrade.version }} deploy_mode: upgrade service_name: consul repository_name: ${{ inputs.repository_name }} @@ -338,13 +338,13 @@ jobs: uses: ./qubership-test-pipelines/actions/shared/collect_diag_info with: namespace: consul - artifact_name: Upgrade_${{ matrix.test.artifact_name }} - service_branch: ${{ matrix.test.upgrade_version }} + artifact_name: ${{ matrix.test.upgrade.artifact_name }} + service_branch: ${{ matrix.test.upgrade.version }} # == End ======= Specific steps for upgrade tests ======= # == Start ======= Specific steps for S3 ======= - name: Delete S3 bucket - if: always() && matrix.test.s3 == true + if: always() && (matrix.test.install.s3 == true || matrix.test.upgrade.s3 == true) uses: ./qubership-test-pipelines/actions/shared/cleanup_s3_bucket with: aws_access_key_id: ${{ secrets.AWS_S3_ACCESS_KEY_ID }} diff --git a/workflow-config/consul.yaml b/workflow-config/consul.yaml index 827c96f0..0c7e705f 100644 --- a/workflow-config/consul.yaml +++ b/workflow-config/consul.yaml @@ -1,65 +1,83 @@ jobs: ## A special configuration section for generating jobs for installing previous releases on the current version - purpose: automation - name: Clean [${release_version}], Upgrade to [${service_branch}] - install_version: ${release_version} - template: templates/consul-service/consul_clean_all_on_sc.yml - upgrade_version: ${service_branch} - upgrade_template: templates/consul-service/consul_clean_all_on_sc.yml + name: Clean [${release_version}]. Upgrade to [${service_branch}] sequence: upgrade restricted: false - artifact_name: Clean_${release_version}_Upgrade_CURRENT + install: + version: ${release_version} + template: templates/consul-service/consul_clean_all_on_sc.yml + artifact_name: consul_clean_${release_version} + upgrade: + version: ${service_branch} + template: templates/consul-service/consul_clean_all_on_sc.yml + artifact_name: consul_upgrade_current ## =============================================================================== - name: Clean [${service_branch}] restricted - install_version: ${service_branch} - template: templates/consul-service/consul_clean_all_on_sc_restricted.yml sequence: install restricted: true - artifact_name: Clean_CURRENT_Restricted + install: + version: ${service_branch} + template: templates/consul-service/consul_clean_all_on_sc_restricted.yml + artifact_name: consul_clean_current_restricted - - name: Clean [${service_branch}] Full-AT Ports-specifying Custom-labels - install_version: ${service_branch} - template: templates/consul-service/consul_clean_all_on_sc_full_at.yml + - name: Clean [${service_branch}] full-at sequence: install restricted: false - artifact_name: Clean_CURRENT_Full-AT - monitoring: true + install: + version: ${service_branch} + template: templates/consul-service/consul_clean_all_on_sc_full_at.yml + artifact_name: consul_clean_current_full_at + monitoring: true - - name: Clean [${service_branch}] S3 TLS - install_version: ${service_branch} - template: templates/consul-service/consul_clean_all_on_sc_drd_s3_tls.yml + - name: Clean [${service_branch}] s3 tls sequence: install restricted: false - s3: true - tls: true - artifact_name: Clean_CURRENT_S3_TLS + install: + version: ${service_branch} + template: templates/consul-service/consul_clean_all_on_sc_drd_s3_tls.yml + artifact_name: consul_clean_current_s3_tls + s3: true + tls: true - - name: Clean [${service_branch}]. Upgrade [${service_branch}] Diff Params - install_version: ${service_branch} - template: templates/consul-service/consul_clean_all_on_sc.yml - upgrade_version: ${service_branch} - upgrade_template: templates/consul-service/consul_clean_all_on_sc_updated.yml + - name: Clean [${service_branch}]. Upgrade to [${service_branch}] diff params sequence: upgrade restricted: false - artifact_name: Clean_CURRENT_Upgrade_CURRENT_Diff_Params + install: + version: ${service_branch} + template: templates/consul-service/consul_clean_all_on_sc.yml + artifact_name: consul_clean_current + upgrade: + version: ${service_branch} + template: templates/consul-service/consul_clean_all_on_sc_updated.yml + artifact_name: consul_upgrade_current_diff_params - - name: Clean [${service_branch}] W/O Components. Upgrade [${service_branch}] All Components S3 - install_version: ${service_branch} - template: templates/consul-service/consul_clean_on_sc_without_components.yml - upgrade_version: ${service_branch} - upgrade_template: templates/consul-service/consul_clean_all_on_sc_drd_s3.yml + - name: Clean [${service_branch}] w/o components. Upgrade to [${service_branch}] all components s3 sequence: upgrade restricted: false - s3: true - artifact_name: Clean_CURRENT_WO_Components.Upgrade_CURRENT_All_Components_S3 + install: + version: ${service_branch} + template: templates/consul-service/consul_clean_on_sc_without_components.yml + artifact_name: consul_clean_current_wo_components + s3: false + tls: false + upgrade: + version: ${service_branch} + template: templates/consul-service/consul_clean_all_on_sc_drd_s3.yml + artifact_name: consul_upgrade_current_all_components_s3 + s3: true + tls: false - purpose: automation - name: Clean [${release_version}] Restricted. Upgrade To [${service_branch}] Restricted - install_version: ${release_version} - template: templates/consul-service/consul_clean_all_on_sc_restricted.yml - upgrade_version: ${service_branch} - upgrade_template: templates/consul-service/consul_clean_all_on_sc_restricted.yml + name: Clean [${release_version}] restricted. Upgrade to [${service_branch}] restricted sequence: upgrade restricted: true - artifact_name: Clean_PREVIOUS_Restricted.Upgrade_CURRENT_Restricted + install: + version: ${release_version} + template: templates/consul-service/consul_clean_all_on_sc_restricted.yml + artifact_name: consul_clean_previous_restricted + upgrade: + version: ${service_branch} + template: templates/consul-service/consul_clean_all_on_sc_restricted.yml + artifact_name: consul_upgrade_current_restricted From 41dbf74f6508f27c6f62aa73630b12a9a457a87c Mon Sep 17 00:00:00 2001 From: KryukovaPolina <32718724+KryukovaPolina@users.noreply.github.com> Date: Fri, 3 Apr 2026 15:28:53 +0300 Subject: [PATCH 2/7] refactor: add action for tls --- .github/workflows/consul.yaml | 30 ++---------------- actions/shared/setup_tls/action.yml | 48 +++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+), 27 deletions(-) create mode 100644 actions/shared/setup_tls/action.yml diff --git a/.github/workflows/consul.yaml b/.github/workflows/consul.yaml index 0bbc47d6..5d42bc2c 100644 --- a/.github/workflows/consul.yaml +++ b/.github/workflows/consul.yaml @@ -169,34 +169,10 @@ jobs: # == End Monitoring installation ======= # == Start ======= Specific steps for TLS ======= - - name: TLS specific step + - name: Setup TLS if: matrix.test.install.tls == true - run: | - echo "::group::Describe nodes" - kubectl describe nodes - echo "::endgroup::" - echo "::group::Install cert-manager" - helm repo add jetstack https://charts.jetstack.io --force-update - helm upgrade --install cert-manager jetstack/cert-manager --namespace cert-manager \ - --create-namespace --version v1.16.3 --set prometheus.enabled=true --set crds.enabled=true - echo "::endgroup::" - echo "::group::Create cert-manager entities" - kubectl apply -f qubership-test-pipelines/resources/test-issuer.yaml - sleep 10s - kubectl apply -f qubership-test-pipelines/resources/test-certificate.yaml - sleep 10s - kubectl apply -f qubership-test-pipelines/resources/test-clusterissuer.yaml - echo "::endgroup::" - echo "::group::Get cert-manager resources" - kubectl get pods -n cert-manager - kubectl get secrets -n cert-manager - kubectl get certificates -A - echo "::endgroup::" - echo "::group::Get clusterissuer" - kubectl get clusterissuer - kubectl get clusterissuer test-clusterissuer -o yaml - echo "::endgroup::" - # == End ======= Specific steps for TLS ======= + uses: ./qubership-test-pipelines/actions/shared/setup_tls + # == End ======= Specific steps for TLS ======= # == Start ======= Specific steps for S3 ======= - name: Create S3 bucket diff --git a/actions/shared/setup_tls/action.yml b/actions/shared/setup_tls/action.yml new file mode 100644 index 00000000..146e5e62 --- /dev/null +++ b/actions/shared/setup_tls/action.yml @@ -0,0 +1,48 @@ +name: Setup TLS +description: Installs cert-manager and creates test issuer/certificate for TLS testing +runs: + using: composite + steps: + - name: Describe nodes + shell: bash + run: | + echo "::group::Describe nodes" + kubectl describe nodes + echo "::endgroup::" + + - name: Install cert-manager + shell: bash + run: | + echo "::group::Install cert-manager" + helm repo add jetstack https://charts.jetstack.io --force-update + helm upgrade --install cert-manager jetstack/cert-manager --namespace cert-manager \ + --create-namespace --version v1.16.3 --set prometheus.enabled=true --set crds.enabled=true + echo "::endgroup::" + + - name: Create cert-manager entities + shell: bash + run: | + echo "::group::Create cert-manager entities" + kubectl apply -f qubership-test-pipelines/resources/test-issuer.yaml + sleep 10s + kubectl apply -f qubership-test-pipelines/resources/test-certificate.yaml + sleep 10s + kubectl apply -f qubership-test-pipelines/resources/test-clusterissuer.yaml + echo "::endgroup::" + + - name: Get cert-manager resources + shell: bash + run: | + echo "::group::Get cert-manager resources" + kubectl get pods -n cert-manager + kubectl get secrets -n cert-manager + kubectl get certificates -A + echo "::endgroup::" + + - name: Get clusterissuer + shell: bash + run: | + echo "::group::Get clusterissuer" + kubectl get clusterissuer + kubectl get clusterissuer test-clusterissuer -o yaml + echo "::endgroup::" From fee61e3e735bfe13167c8cff85ac33936e1d335d Mon Sep 17 00:00:00 2001 From: KryukovaPolina <32718724+KryukovaPolina@users.noreply.github.com> Date: Fri, 3 Apr 2026 16:53:59 +0300 Subject: [PATCH 3/7] refactor: add comments to scripts --- .github/workflows/consul.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/consul.yaml b/.github/workflows/consul.yaml index 5d42bc2c..b54eae56 100644 --- a/.github/workflows/consul.yaml +++ b/.github/workflows/consul.yaml @@ -188,7 +188,7 @@ jobs: - name: Add s3 secrets to template (clean install) if: matrix.test.install.s3 == true run: | - echo "::group::Add secrets to template" + # ▶️ Add s3 secrets to template python qubership-test-pipelines/scripts/update_yaml.py \ --file='qubership-test-pipelines/${{ matrix.test.install.template }}' \ --path='backupDaemon/s3/keyId' \ @@ -207,6 +207,7 @@ jobs: - name: Add s3 backet for Allure report if: matrix.test.install.allure == true run: >- + # ▶️ Add s3 backet for Allure report python qubership-test-pipelines/scripts/update_yaml.py --file='qubership-test-pipelines/${{ matrix.test.install.template }}' --path='integrationTests/atpStorage/username' From 41e5d025fc4a0eec78a681da6fac2e8a031be60f Mon Sep 17 00:00:00 2001 From: KryukovaPolina <32718724+KryukovaPolina@users.noreply.github.com> Date: Fri, 3 Apr 2026 17:50:33 +0300 Subject: [PATCH 4/7] refactor: delete duplication from verify_installation --- actions/shared/verify_installation/action.yml | 44 ------------------- 1 file changed, 44 deletions(-) diff --git a/actions/shared/verify_installation/action.yml b/actions/shared/verify_installation/action.yml index 0a3cb78b..097ad681 100644 --- a/actions/shared/verify_installation/action.yml +++ b/actions/shared/verify_installation/action.yml @@ -59,11 +59,6 @@ runs: # language=bash run: echo "ERROR_FLAG=false" >> $GITHUB_ENV - - name: Initialize error flag - shell: bash - # language=bash - run: echo "ERROR_FLAG=false" >> $GITHUB_ENV - - name: Check service is ready shell: bash # language=bash @@ -151,45 +146,6 @@ runs: echo "ERROR_FLAG=true" >> $GITHUB_ENV fi - - name: Get logs from test pod - if: inputs.check_tests == 'true' - shell: bash - # language=bash - run: | - # ▶️ Get logs from test pod - chmod +x ./qubership-test-pipelines/scripts/check_tests.sh - ls -la ./qubership-test-pipelines/scripts/check_tests.sh - - for i in $(seq 1 ${{inputs.test_completion_max_retries}}); do - echo "Test check attempt $i/${{inputs.test_completion_max_retries}}" - set +e - ./qubership-test-pipelines/scripts/check_tests.sh "${{inputs.namespace}}" - tests_exit_code=$? - set -e - - case $tests_exit_code in - 0) - echo "✅ Tests passed successfully" - break - ;; - 1) - echo "⏳ Tests still in progress" - ;; - 2) - echo "::error:: ❌ Tests failed" - echo "ERROR_FLAG=true" >> $GITHUB_ENV - break - ;; - esac - - if [ $i -eq ${{inputs.test_completion_max_retries}} ]; then - echo "::warning:: ⚠️ Tests not completed after ${{inputs.test_completion_max_retries}} retries" - echo "ERROR_FLAG=true" >> $GITHUB_ENV - else - sleep ${{inputs.test_completion_retry_interval}} - fi - done - - name: Get monitoring specific resources if: ${{ inputs.monitoring_pipeline == 'true' }} shell: bash From 48f30174b73733b8c3f551935de1c3c4e017653d Mon Sep 17 00:00:00 2001 From: KryukovaPolina <32718724+KryukovaPolina@users.noreply.github.com> Date: Mon, 6 Apr 2026 21:03:05 +0300 Subject: [PATCH 5/7] refactor: update verify installation --- .github/workflows/consul.yaml | 31 ++-- actions/shared/verify_installation/action.yml | 162 +++++------------- 2 files changed, 59 insertions(+), 134 deletions(-) diff --git a/.github/workflows/consul.yaml b/.github/workflows/consul.yaml index b54eae56..be8063d7 100644 --- a/.github/workflows/consul.yaml +++ b/.github/workflows/consul.yaml @@ -114,6 +114,13 @@ jobs: matrix: test: ${{ fromJson(needs.prepare.outputs.matrix) }} name: ${{ matrix.test.name }} + env: + CHECK_TESTS: true + NAMESPACE: consul + TEST_COMPLETION_MAX_RETRIES: 1 + TEST_COMPLETION_RETRY_INTERVAL: 10s + SERVICE_READY_MAX_RETRIES: 100 + SERVICE_READY_RETRY_INTERVAL: 10s steps: # == 01 Start ======= Common pre-steps for all tests ======= - name: Print job parameters @@ -237,12 +244,12 @@ jobs: - name: Verify Consul installation uses: ./qubership-test-pipelines/actions/shared/verify_installation with: - check_tests: true - namespace: consul - test_completion_max_retries: 50 - test_completion_retry_interval: 10s - service_ready_max_retries: 50 - service_ready_retry_interval: 10s + check_tests: ${{ env.CHECK_TESTS }} + namespace: ${{ env.NAMESPACE }} + test_completion_max_retries: ${{ env.TEST_COMPLETION_MAX_RETRIES }} + test_completion_retry_interval: ${{ env.TEST_COMPLETION_RETRY_INTERVAL }} + service_ready_max_retries: ${{ env.SERVICE_READY_MAX_RETRIES }} + service_ready_retry_interval: ${{ env.SERVICE_READY_RETRY_INTERVAL }} - name: Collect Diagnostics Consul installation if: ${{ !cancelled() && steps.consul_install.conclusion != 'skipped' }} @@ -303,12 +310,12 @@ jobs: if: matrix.test.sequence == 'upgrade' uses: ./qubership-test-pipelines/actions/shared/verify_installation with: - check_tests: true - namespace: consul - test_completion_max_retries: 50 - test_completion_retry_interval: 10s - service_ready_max_retries: 50 - service_ready_retry_interval: 10s + check_tests: ${{ env.CHECK_TESTS }} + namespace: ${{ env.NAMESPACE }} + test_completion_max_retries: ${{ env.TEST_COMPLETION_MAX_RETRIES }} + test_completion_retry_interval: ${{ env.TEST_COMPLETION_RETRY_INTERVAL }} + service_ready_max_retries: ${{ env.SERVICE_READY_MAX_RETRIES }} + service_ready_retry_interval: ${{ env.SERVICE_READY_RETRY_INTERVAL }} - name: Collect Diagnostics Consul upgrade if: ${{ !cancelled() && steps.consul_upgrade.conclusion != 'skipped' }} diff --git a/actions/shared/verify_installation/action.yml b/actions/shared/verify_installation/action.yml index 097ad681..4142acdf 100644 --- a/actions/shared/verify_installation/action.yml +++ b/actions/shared/verify_installation/action.yml @@ -67,16 +67,16 @@ runs: chmod +x ./qubership-test-pipelines/scripts/check_cr.sh chmod +x ./qubership-test-pipelines/scripts/check_resources.sh - echo "Checking CRDs: ${{inputs.crd_list}}" + echo "Checking CRDs: ${{ inputs.crd_list }}" cr_success=false resources_success=false - for i in {1..${{inputs.service_ready_max_retries}}}; do - echo "Attempt $i/${{inputs.service_ready_max_retries}}" + for i in $(seq 1 ${{ inputs.service_ready_max_retries }}); do + echo "Attempt $i/${{ inputs.service_ready_max_retries }}" if [ "$cr_success" = "false" ]; then set +e - ./qubership-test-pipelines/scripts/check_cr.sh "${{inputs.crd_list}}" "${{inputs.namespace}}" + ./qubership-test-pipelines/scripts/check_cr.sh "${{ inputs.crd_list }}" "${{ inputs.namespace }}" cr_exit_code=$? set -e @@ -84,158 +84,76 @@ runs: 0) echo "✅ CR check successful" cr_success=true - break ;; 1) echo "⏳ CR check in progress" - echo -e "Retrying in ${{inputs.service_ready_retry_interval}} seconds...\n" - sleep ${{inputs.service_ready_retry_interval}} ;; 2) echo "::error:: ❌ CR check failed" echo "ERROR_FLAG=true" >> $GITHUB_ENV + cr_success=false break ;; esac fi - done - if [[ "${{ inputs.monitoring_pipeline }}" == "true" ]]; then - # ▶️ Check monitoring CRs statuses - echo "Checking VictoriaMetrics CRs in namespace: ${{inputs.namespace}}" - chmod +x ./qubership-test-pipelines/scripts/monitoring/check-vm-cr-statuses.sh - echo $(pwd) - echo "${{inputs.repository_name}}/.github/expected-vm-cr-statuses.json" - cat "${{inputs.repository_name}}/.github/expected-vm-cr-statuses.json" - ./qubership-test-pipelines/scripts/monitoring/check-vm-cr-statuses.sh \ - "${{inputs.namespace}}" \ - "${{inputs.service_ready_max_retries}}" \ - "${{inputs.service_ready_retry_interval}}" \ - "${{inputs.repository_name}}/.github/expected-vm-cr-statuses.json" \ - "${{inputs.crd_list}}" - fi - for i in {1..${{inputs.service_ready_max_retries}}}; do - echo "Attempt $i/${{inputs.service_ready_max_retries}}" + if [ "$resources_success" = "false" ]; then set +e - ./qubership-test-pipelines/scripts/check_resources.sh "${{inputs.namespace}}" + ./qubership-test-pipelines/scripts/check_resources.sh "${{ inputs.namespace }}" resources_exit_code=$? set -e if [ $resources_exit_code -eq 0 ]; then echo "✅ Resources checks successful" resources_success=true - break elif [ $resources_exit_code -eq 1 ]; then echo "⏳ Some resources are not ready" - echo "PODS:" - kubectl get pods -n "${{inputs.namespace}}" - sleep ${{inputs.service_ready_retry_interval}} + # echo "PODS:" + # kubectl get pods -n "${{ inputs.namespace }}" fi fi - done if [ "$cr_success" = "true" ] && [ "$resources_success" = "true" ]; then echo "✅ All checks completed successfully!" + break fi - if [ "$cr_success" = "false" ]; then - echo "::error:: ❌ CR check not successful after ${{inputs.service_ready_max_retries}} retries" - echo "ERROR_FLAG=true" >> $GITHUB_ENV - fi - if [ "$resources_success" = "false" ]; then - echo "::error:: ❌ Resources not ready after ${{inputs.service_ready_max_retries}} retries" - echo "ERROR_FLAG=true" >> $GITHUB_ENV + + if [ $i -lt ${{ inputs.service_ready_max_retries }} ]; then + sleep ${{ inputs.service_ready_retry_interval }} fi + done + + if [ "$cr_success" = "false" ]; then + echo "::error:: ❌ CR check not successful after ${{ inputs.service_ready_max_retries }} retries" + echo "ERROR_FLAG=true" >> $GITHUB_ENV + fi + if [ "$resources_success" = "false" ]; then + echo "::error:: ❌ Resources not ready after ${{ inputs.service_ready_max_retries }} retries" + echo "ERROR_FLAG=true" >> $GITHUB_ENV + fi - name: Get monitoring specific resources if: ${{ inputs.monitoring_pipeline == 'true' }} shell: bash # language=bash run: | - # ▶️ Check service is ready - chmod +x ./qubership-test-pipelines/scripts/check_cr.sh - chmod +x ./qubership-test-pipelines/scripts/check_resources.sh - - echo "Checking CRDs: ${{inputs.crd_list}}" - cr_success=false - resources_success=false - - for i in {1..${{inputs.service_ready_max_retries}}}; do - echo "Attempt $i/${{inputs.service_ready_max_retries}}" - - if [ "$cr_success" = "false" ]; then - set +e - ./qubership-test-pipelines/scripts/check_cr.sh "${{inputs.crd_list}}" "${{inputs.namespace}}" - cr_exit_code=$? - set -e - - case $cr_exit_code in - 0) - echo "✅ CR check successful" - cr_success=true - break - ;; - 1) - echo "⏳ CR check in progress" - echo -e "Retrying in ${{inputs.service_ready_retry_interval}} seconds...\n" - sleep ${{inputs.service_ready_retry_interval}} - ;; - 2) - echo "::error:: ❌ CR check failed" - echo "ERROR_FLAG=true" >> $GITHUB_ENV - break - ;; - esac - fi - done + # ▶️ Get monitoring specific resources if [[ "${{ inputs.monitoring_pipeline }}" == "true" ]]; then - # ▶️ Check monitoring CRs statuses - echo "Checking VictoriaMetrics CRs in namespace: ${{inputs.namespace}}" + echo "Checking VictoriaMetrics CRs in namespace: ${{ inputs.namespace }}" chmod +x ./qubership-test-pipelines/scripts/monitoring/check-vm-cr-statuses.sh - echo $(pwd) - echo "${{inputs.repository_name}}/.github/expected-vm-cr-statuses.json" - cat "${{inputs.repository_name}}/.github/expected-vm-cr-statuses.json" + echo "Current directory: $(pwd)" + echo "${{ inputs.repository_name }}/.github/expected-vm-cr-statuses.json" + cat "${{ inputs.repository_name }}/.github/expected-vm-cr-statuses.json" ./qubership-test-pipelines/scripts/monitoring/check-vm-cr-statuses.sh \ - ${{inputs.namespace}} \ - ${{inputs.service_ready_max_retries}} \ - ${{inputs.service_ready_retry_interval}} \ - ${{inputs.repository_name}}/.github/expected-vm-cr-statuses.json \ - ${{inputs.crd_list}} + "${{ inputs.namespace }}" \ + "${{ inputs.service_ready_max_retries }}" \ + "${{ inputs.service_ready_retry_interval }}" \ + "${{ inputs.repository_name }}/.github/expected-vm-cr-statuses.json" \ + "${{ inputs.crd_list }}" fi - for i in {1..${{inputs.service_ready_max_retries}}}; do - echo "Attempt $i/${{inputs.service_ready_max_retries}}" - if [ "$resources_success" = "false" ]; then - set +e - ./qubership-test-pipelines/scripts/check_resources.sh "${{inputs.namespace}}" - resources_exit_code=$? - set -e - - if [ $resources_exit_code -eq 0 ]; then - echo "✅ Resources checks successful" - resources_success=true - break - elif [ $resources_exit_code -eq 1 ]; then - echo "⏳ Some resources are not ready" - echo "PODS:" - kubectl get pods -n "${{inputs.namespace}}" - sleep ${{inputs.service_ready_retry_interval}} - fi - fi - done - - if [ "$cr_success" = "true" ] && [ "$resources_success" = "true" ]; then - echo "✅ All checks completed successfully!" - fi - if [ "$cr_success" = "false" ]; then - echo "::error:: ❌ CR check not successful after ${{inputs.service_ready_max_retries}} retries" - echo "ERROR_FLAG=true" >> $GITHUB_ENV - fi - if [ "$resources_success" = "false" ]; then - echo "::error:: ❌ Resources not ready after ${{inputs.service_ready_max_retries}} retries" - echo "ERROR_FLAG=true" >> $GITHUB_ENV - fi - name: Get logs from test pod - if: ${{ inputs.check_tests == 'true' }} + if: inputs.check_tests == 'true' shell: bash # language=bash run: | @@ -243,10 +161,10 @@ runs: chmod +x ./qubership-test-pipelines/scripts/check_tests.sh ls -la ./qubership-test-pipelines/scripts/check_tests.sh - for i in $(seq 1 ${{inputs.test_completion_max_retries}}); do - echo "Test check attempt $i/${{inputs.test_completion_max_retries}}" + for i in $(seq 1 ${{ inputs.test_completion_max_retries }}); do + echo "Test check attempt $i/${{ inputs.test_completion_max_retries }}" set +e - ./qubership-test-pipelines/scripts/check_tests.sh "${{inputs.namespace}}" + ./qubership-test-pipelines/scripts/check_tests.sh "${{ inputs.namespace }}" tests_exit_code=$? set -e @@ -265,11 +183,11 @@ runs: ;; esac - if [ $i -eq ${{inputs.test_completion_max_retries}} ]; then - echo "::warning:: ⚠️ Tests not completed after ${{inputs.test_completion_max_retries}} retries" + if [ $i -eq ${{ inputs.test_completion_max_retries }} ]; then + echo "::warning:: ⚠️ Tests not completed after ${{ inputs.test_completion_max_retries }} retries" echo "ERROR_FLAG=true" >> $GITHUB_ENV else - sleep ${{inputs.test_completion_retry_interval}} + sleep ${{ inputs.test_completion_retry_interval }} fi done From 7e18bdb3e365599f02fd04979f7049718bb0ca49 Mon Sep 17 00:00:00 2001 From: KryukovaPolina <32718724+KryukovaPolina@users.noreply.github.com> Date: Fri, 22 May 2026 15:25:30 +0300 Subject: [PATCH 6/7] feat: update consul config --- .github/workflows/consul.yaml | 31 ++++---- workflow-config/consul_nightly.yaml | 110 ++++++++++++++++------------ 2 files changed, 79 insertions(+), 62 deletions(-) diff --git a/.github/workflows/consul.yaml b/.github/workflows/consul.yaml index bcc23932..d0e3e52f 100644 --- a/.github/workflows/consul.yaml +++ b/.github/workflows/consul.yaml @@ -93,7 +93,7 @@ jobs: uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v5.1.0 with: ref: ${{ inputs.pipeline_branch }} - repository: netcracker/qubership-test-pipelines + repository: Netcracker/qubership-test-pipelines path: qubership-test-pipelines persist-credentials: false @@ -156,7 +156,7 @@ jobs: uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v5.1.0 with: ref: ${{ inputs.pipeline_branch }} - repository: netcracker/qubership-test-pipelines + repository: Netcracker/qubership-test-pipelines path: qubership-test-pipelines persist-credentials: false @@ -236,25 +236,21 @@ jobs: --value="${{ steps.create_bucket.outputs.bucket_name }}" # == End ======= Specific steps for S3 ======= - # == Start ======= Specific steps for Allure report ======= - - name: Add s3 backet for Allure report + - name: Add s3 bucket for Allure report if: matrix.test.install.allure == true - run: >- - # ▶️ Add s3 backet for Allure report - python qubership-test-pipelines/scripts/update_yaml.py - --file='qubership-test-pipelines/${{ matrix.test.install.template }}' - --path='integrationTests/atpStorage/username' - --value='${{secrets.AWS_S3_ACCESS_KEY_ID}}' - && python qubership-test-pipelines/scripts/update_yaml.py - --file='qubership-test-pipelines/${{ matrix.test.install.template }}' - --path='integrationTests/atpStorage/password' - --value='${{secrets.AWS_S3_ACCESS_KEY_SECRET}}' - # == End ======= Specific steps for Allure report ======= + run: | + python qubership-test-pipelines/scripts/update_yaml.py \ + --file='qubership-test-pipelines/${{ matrix.test.install.template }}' \ + --path='integrationTests/atpStorage/username' \ + --value='${{secrets.AWS_S3_ACCESS_KEY_ID}}' \ + && python qubership-test-pipelines/scripts/update_yaml.py \ + --file='qubership-test-pipelines/${{ matrix.test.install.template }}' \ + --path='integrationTests/atpStorage/password' \ + --value='${{secrets.AWS_S3_ACCESS_KEY_SECRET}}' - name: Print clean install deployment parameters run: cat qubership-test-pipelines/${{ matrix.test.install.template }} - # == 02 Start ======= Common steps for all tests ======= - name: Install Consul [${{ matrix.test.install.version }}] uses: ./qubership-test-pipelines/actions/shared/helm_deploy id: consul_install @@ -373,9 +369,10 @@ jobs: uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v5.1.0 with: ref: ${{ inputs.pipeline_branch }} - repository: netcracker/qubership-test-pipelines + repository: Netcracker/qubership-test-pipelines path: qubership-test-pipelines persist-credentials: false + - name: Check job status uses: ./qubership-test-pipelines/actions/shared/check_job_status with: diff --git a/workflow-config/consul_nightly.yaml b/workflow-config/consul_nightly.yaml index cc84cc5b..e43d4122 100644 --- a/workflow-config/consul_nightly.yaml +++ b/workflow-config/consul_nightly.yaml @@ -1,74 +1,94 @@ jobs: ## A special configuration section for generating jobs for installing previous releases on the current version - purpose: automation - name: Clean [${release_version}], Upgrade to [${service_branch}] - install_version: ${release_version} - template: templates/consul-service/consul_clean_all_on_sc.yml - upgrade_version: ${service_branch} - upgrade_template: templates/consul-service/consul_clean_all_on_sc.yml + name: Clean [${release_version}]. Upgrade to [${service_branch}] sequence: upgrade restricted: false - artifact_name: Clean_${release_version}_Upgrade_CURRENT + install: + version: ${release_version} + template: templates/consul-service/consul_clean_all_on_sc.yml + artifact_name: consul_clean_previous + upgrade: + version: ${service_branch} + template: templates/consul-service/consul_clean_all_on_sc.yml + artifact_name: consul_upgrade_current ## =============================================================================== - name: Clean [${service_branch}] restricted - install_version: ${service_branch} - template: templates/consul-service/consul_clean_all_on_sc_restricted.yml sequence: install restricted: true - artifact_name: Clean_CURRENT_Restricted + install: + version: ${service_branch} + template: templates/consul-service/consul_clean_all_on_sc_restricted.yml + artifact_name: consul_clean_current_restricted - - name: Clean [${service_branch}] Full-AT Ports-specifying Custom-labels - install_version: ${service_branch} - template: templates/consul-service/consul_clean_all_on_sc_full_at.yml + - name: Clean [${service_branch}] full-at ports-specifying custom-labels sequence: install restricted: false - artifact_name: Clean_CURRENT_Full-AT - monitoring: true + install: + version: ${service_branch} + template: templates/consul-service/consul_clean_all_on_sc_full_at.yml + artifact_name: consul_clean_current_full_at + monitoring: true - - name: Clean [${service_branch}] S3 TLS - install_version: ${service_branch} - template: templates/consul-service/consul_clean_all_on_sc_drd_s3_tls.yml + - name: Clean [${service_branch}] s3 tls sequence: install restricted: false - s3: true - tls: true - artifact_name: Clean_CURRENT_S3_TLS + install: + version: ${service_branch} + template: templates/consul-service/consul_clean_all_on_sc_drd_s3_tls.yml + artifact_name: consul_clean_current_s3_tls + s3: true + tls: true - - name: Clean [${service_branch}]. Upgrade [${service_branch}] Diff Params - install_version: ${service_branch} - template: templates/consul-service/consul_clean_all_on_sc.yml - upgrade_version: ${service_branch} - upgrade_template: templates/consul-service/consul_clean_all_on_sc_updated.yml + - name: Clean [${service_branch}]. Upgrade to [${service_branch}] diff params sequence: upgrade restricted: false - artifact_name: Clean_CURRENT_Upgrade_CURRENT_Diff_Params + install: + version: ${service_branch} + template: templates/consul-service/consul_clean_all_on_sc.yml + artifact_name: consul_clean_current + upgrade: + version: ${service_branch} + template: templates/consul-service/consul_clean_all_on_sc_updated.yml + artifact_name: consul_upgrade_current_diff_params - - name: Clean [${service_branch}] W/O Components. Upgrade [${service_branch}] All Components S3 - install_version: ${service_branch} - template: templates/consul-service/consul_clean_on_sc_without_components.yml - upgrade_version: ${service_branch} - upgrade_template: templates/consul-service/consul_clean_all_on_sc_drd_s3.yml + - name: Clean [${service_branch}] w/o components. Upgrade to [${service_branch}] all components s3 sequence: upgrade restricted: false - s3: true - artifact_name: Clean_CURRENT_WO_Components.Upgrade_CURRENT_All_Components_S3 + install: + version: ${service_branch} + template: templates/consul-service/consul_clean_on_sc_without_components.yml + artifact_name: consul_clean_current_wo_components + s3: false + tls: false + upgrade: + version: ${service_branch} + template: templates/consul-service/consul_clean_all_on_sc_drd_s3.yml + artifact_name: consul_upgrade_current_all_components_s3 + s3: true + tls: false - purpose: automation - name: Clean [${release_version}] Restricted. Upgrade To [${service_branch}] Restricted - install_version: ${release_version} - template: templates/consul-service/consul_clean_all_on_sc_restricted.yml - upgrade_version: ${service_branch} - upgrade_template: templates/consul-service/consul_clean_all_on_sc_restricted.yml + name: Clean [${release_version}] restricted. Upgrade to [${service_branch}] restricted sequence: upgrade restricted: true - artifact_name: Clean_PREVIOUS_Restricted.Upgrade_CURRENT_Restricted + install: + version: ${release_version} + template: templates/consul-service/consul_clean_all_on_sc_restricted.yml + artifact_name: consul_clean_previous_restricted + upgrade: + version: ${service_branch} + template: templates/consul-service/consul_clean_all_on_sc_restricted.yml + artifact_name: consul_upgrade_current_restricted - name: Clean [${service_branch}] with Monitoring and Allure - install_version: ${service_branch} - template: templates/consul-service/consul_clean_all_on_sc_monitoring_allure.yml sequence: install - artifact_name: Clean_CURRENT_allure - test_tags: crudORalerts - monitoring: true - allure: true + restricted: false + install: + version: ${service_branch} + template: templates/consul-service/consul_clean_all_on_sc_monitoring_allure.yml + artifact_name: consul_clean_current_allure + monitoring: true + allure: true + test_tags: crudORalerts From ad86fc1a5418d376814bdfbb0f9d34dcc8b0ea0d Mon Sep 17 00:00:00 2001 From: KryukovaPolina <32718724+KryukovaPolina@users.noreply.github.com> Date: Fri, 22 May 2026 16:59:02 +0300 Subject: [PATCH 7/7] feat: update consul workflow --- .github/workflows/consul.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/consul.yaml b/.github/workflows/consul.yaml index d0e3e52f..72aa4acd 100644 --- a/.github/workflows/consul.yaml +++ b/.github/workflows/consul.yaml @@ -241,11 +241,11 @@ jobs: run: | python qubership-test-pipelines/scripts/update_yaml.py \ --file='qubership-test-pipelines/${{ matrix.test.install.template }}' \ - --path='integrationTests/atpStorage/username' \ + --path='integrationTests/atpReport/atpStorage/username' \ --value='${{secrets.AWS_S3_ACCESS_KEY_ID}}' \ && python qubership-test-pipelines/scripts/update_yaml.py \ --file='qubership-test-pipelines/${{ matrix.test.install.template }}' \ - --path='integrationTests/atpStorage/password' \ + --path='integrationTests/atpReport/atpStorage/password' \ --value='${{secrets.AWS_S3_ACCESS_KEY_SECRET}}' - name: Print clean install deployment parameters