From da3effd4d640ba7bf60c68d8b3404a6817a73430 Mon Sep 17 00:00:00 2001 From: dkunhamb Date: Mon, 4 Nov 2024 10:36:34 -0600 Subject: [PATCH 01/13] stable exit --- .github/workflows/ci_cd.yml | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index e3f3e4f0d..3d6afec2d 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -174,6 +174,20 @@ jobs: else echo "matrix={\"mechanical-version\":['${{ needs.revn-variations.outputs.test_docker_image_version }}'],\"experimental\":[false]}" >> $GITHUB_OUTPUT fi + container-stability-check: + runs-on: ubuntu-latest + needs: [revn-variations] + steps: + - name: Check Container Stability + run: | + apt update + apt install bc -y + CONTAINER_VERSION=$(echo "${{ needs.revn-variations.outputs.test_docker_image_version }}" | grep -o -E '[0-9]+(\.[0-9]+)?' | head -n 1) + if (( $(echo "$CONTAINER_VERSION > 24.2" | bc -l) )); then + echo "CONTAINER_STABLE_EXIT=true" >> $GITHUB_ENV + else + echo "CONTAINER_STABLE_EXIT=false" >> $GITHUB_ENV + fi remote-connect: name: Remote connect testing and coverage - Mechanical ${{ matrix.mechanical-version }} @@ -304,7 +318,11 @@ jobs: PYTHONUNBUFFERED: 1 run: | . /env/bin/activate - xvfb-run mechanical-env pytest -m embedding -s --junitxml test_results${{ matrix.python-version }}.xml || true + if [ "${{ env.CONTAINER_STABLE_EXIT }}" == "true" ]; then + xvfb-run mechanical-env pytest -m embedding -s --junitxml test_results${{ matrix.python-version }}.xml || true + else + xvfb-run mechanical-env pytest -m embedding -s --junitxml test_results${{ matrix.python-version }}.xml + fi - name: Upload coverage results uses: actions/upload-artifact@v4 From b943155f35bc69af9337cdd001100df867bc0d1b Mon Sep 17 00:00:00 2001 From: pyansys-ci-bot <92810346+pyansys-ci-bot@users.noreply.github.com> Date: Mon, 4 Nov 2024 16:46:30 +0000 Subject: [PATCH 02/13] chore: adding changelog file 965.test.md [dependabot-skip] --- doc/changelog.d/965.test.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 doc/changelog.d/965.test.md diff --git a/doc/changelog.d/965.test.md b/doc/changelog.d/965.test.md new file mode 100644 index 000000000..b6de8c0aa --- /dev/null +++ b/doc/changelog.d/965.test.md @@ -0,0 +1 @@ +stable exit of container \ No newline at end of file From 0213e9d7094218be954b2d73de9adf190fef1dc9 Mon Sep 17 00:00:00 2001 From: dkunhamb Date: Mon, 4 Nov 2024 10:36:34 -0600 Subject: [PATCH 03/13] stable exit --- .github/workflows/ci_cd.yml | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index e3f3e4f0d..ced642655 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -174,6 +174,20 @@ jobs: else echo "matrix={\"mechanical-version\":['${{ needs.revn-variations.outputs.test_docker_image_version }}'],\"experimental\":[false]}" >> $GITHUB_OUTPUT fi + container-stability-check: + runs-on: ubuntu-latest + needs: [revn-variations] + steps: + - name: Check Container Stability + run: | + sudo apt update + sudo apt install bc -y + CONTAINER_VERSION=$(echo "${{ needs.revn-variations.outputs.test_docker_image_version }}" | grep -o -E '[0-9]+(\.[0-9]+)?' | head -n 1) + if (( $(echo "$CONTAINER_VERSION > 24.2" | bc -l) )); then + echo "CONTAINER_STABLE_EXIT=true" >> $GITHUB_ENV + else + echo "CONTAINER_STABLE_EXIT=false" >> $GITHUB_ENV + fi remote-connect: name: Remote connect testing and coverage - Mechanical ${{ matrix.mechanical-version }} @@ -304,7 +318,11 @@ jobs: PYTHONUNBUFFERED: 1 run: | . /env/bin/activate - xvfb-run mechanical-env pytest -m embedding -s --junitxml test_results${{ matrix.python-version }}.xml || true + if [ "${{ env.CONTAINER_STABLE_EXIT }}" == "true" ]; then + xvfb-run mechanical-env pytest -m embedding -s --junitxml test_results${{ matrix.python-version }}.xml || true + else + xvfb-run mechanical-env pytest -m embedding -s --junitxml test_results${{ matrix.python-version }}.xml + fi - name: Upload coverage results uses: actions/upload-artifact@v4 From b5a1625cfd2a1e8f9d4d46dc2db14e96d6f8240d Mon Sep 17 00:00:00 2001 From: dkunhamb Date: Mon, 4 Nov 2024 11:00:19 -0600 Subject: [PATCH 04/13] docs stable test --- .github/workflows/ci_cd.yml | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index ced642655..2f4122cbd 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -319,9 +319,9 @@ jobs: run: | . /env/bin/activate if [ "${{ env.CONTAINER_STABLE_EXIT }}" == "true" ]; then - xvfb-run mechanical-env pytest -m embedding -s --junitxml test_results${{ matrix.python-version }}.xml || true - else xvfb-run mechanical-env pytest -m embedding -s --junitxml test_results${{ matrix.python-version }}.xml + else + xvfb-run mechanical-env pytest -m embedding -s --junitxml test_results${{ matrix.python-version }}.xml || true fi - name: Upload coverage results @@ -563,10 +563,14 @@ jobs: unset PYMECHANICAL_START_INSTANCE output_file=doc_$1_output.txt - xvfb-run mechanical-env make -C doc $1 > $output_file 2>&1 || true - cat $output_file - echo done running make - validate_output $output_file + if [ "${{ env.CONTAINER_STABLE_EXIT }}" == "true" ]; then + xvfb-run mechanical-env make -C doc $1 + else + xvfb-run mechanical-env make -C doc $1 > $output_file 2>&1 || true + cat $output_file + echo done running make + validate_output $output_file + fi } # Validate that the html or pdf build succeeded From 0432c8c18564594fc5f88ceee7a3c8ef009ca35e Mon Sep 17 00:00:00 2001 From: dkunhamb Date: Mon, 4 Nov 2024 14:27:40 -0600 Subject: [PATCH 05/13] test 251 --- .github/workflows/ci_cd.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index 2f4122cbd..f22cb1bfa 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -321,7 +321,7 @@ jobs: if [ "${{ env.CONTAINER_STABLE_EXIT }}" == "true" ]; then xvfb-run mechanical-env pytest -m embedding -s --junitxml test_results${{ matrix.python-version }}.xml else - xvfb-run mechanical-env pytest -m embedding -s --junitxml test_results${{ matrix.python-version }}.xml || true + xvfb-run mechanical-env pytest -m embedding -s --junitxml test_results${{ matrix.python-version }}.xml fi - name: Upload coverage results @@ -566,10 +566,11 @@ jobs: if [ "${{ env.CONTAINER_STABLE_EXIT }}" == "true" ]; then xvfb-run mechanical-env make -C doc $1 else - xvfb-run mechanical-env make -C doc $1 > $output_file 2>&1 || true - cat $output_file - echo done running make - validate_output $output_file + xvfb-run mechanical-env make -C doc $1 + # xvfb-run mechanical-env make -C doc $1 > $output_file 2>&1 || true + # cat $output_file + # echo done running make + # validate_output $output_file fi } From fea23fd57f02b5956a1aed528986d735e17aaa29 Mon Sep 17 00:00:00 2001 From: dkunhamb Date: Tue, 5 Nov 2024 10:57:47 -0600 Subject: [PATCH 06/13] use github outputs --- .github/workflows/ci_cd.yml | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index f22cb1bfa..efee02f10 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -177,6 +177,8 @@ jobs: container-stability-check: runs-on: ubuntu-latest needs: [revn-variations] + outputs: + container_stable_exit: ${{ steps.check_stability.outputs.container_stable_exit }} steps: - name: Check Container Stability run: | @@ -184,9 +186,9 @@ jobs: sudo apt install bc -y CONTAINER_VERSION=$(echo "${{ needs.revn-variations.outputs.test_docker_image_version }}" | grep -o -E '[0-9]+(\.[0-9]+)?' | head -n 1) if (( $(echo "$CONTAINER_VERSION > 24.2" | bc -l) )); then - echo "CONTAINER_STABLE_EXIT=true" >> $GITHUB_ENV + echo "container_stable_exit=true" >> $GITHUB_OUTPUT else - echo "CONTAINER_STABLE_EXIT=false" >> $GITHUB_ENV + echo "container_stable_exit=false" >> $GITHUB_OUTPUT fi remote-connect: @@ -283,7 +285,7 @@ jobs: name: Embedding testing and coverage runs-on: ubuntu-latest timeout-minutes: 10 - needs: [smoke-tests, revn-variations] + needs: [smoke-tests, revn-variations, container-stability-check] container: image: ${{ needs.revn-variations.outputs.test_container }} options: --entrypoint /bin/bash @@ -318,10 +320,10 @@ jobs: PYTHONUNBUFFERED: 1 run: | . /env/bin/activate - if [ "${{ env.CONTAINER_STABLE_EXIT }}" == "true" ]; then + if [ "${{ needs.container-stability-check.outputs.container_stable_exit }}" == "true" ]; then xvfb-run mechanical-env pytest -m embedding -s --junitxml test_results${{ matrix.python-version }}.xml else - xvfb-run mechanical-env pytest -m embedding -s --junitxml test_results${{ matrix.python-version }}.xml + xvfb-run mechanical-env pytest -m embedding -s --junitxml test_results${{ matrix.python-version }}.xml || true fi - name: Upload coverage results @@ -501,7 +503,7 @@ jobs: container: image: ${{ needs.revn-variations.outputs.stable_container }} options: --entrypoint /bin/bash - needs: [style, doc-style, revn-variations] + needs: [style, doc-style, revn-variations, container-stability-check] steps: @@ -563,14 +565,13 @@ jobs: unset PYMECHANICAL_START_INSTANCE output_file=doc_$1_output.txt - if [ "${{ env.CONTAINER_STABLE_EXIT }}" == "true" ]; then + if [ "${{ needs.container-stability-check.outputs.container_stable_exit }}" == "true" ]; then xvfb-run mechanical-env make -C doc $1 else - xvfb-run mechanical-env make -C doc $1 - # xvfb-run mechanical-env make -C doc $1 > $output_file 2>&1 || true - # cat $output_file - # echo done running make - # validate_output $output_file + xvfb-run mechanical-env make -C doc $1 > $output_file 2>&1 || true + cat $output_file + echo done running make + validate_output $output_file fi } From 6b82ab1687d2949778d66d09d35ac178d3a01f46 Mon Sep 17 00:00:00 2001 From: dkunhamb Date: Wed, 6 Nov 2024 10:05:56 -0600 Subject: [PATCH 07/13] fix id --- .github/workflows/ci_cd.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index efee02f10..f3914f58c 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -180,7 +180,7 @@ jobs: outputs: container_stable_exit: ${{ steps.check_stability.outputs.container_stable_exit }} steps: - - name: Check Container Stability + - id: check_stability run: | sudo apt update sudo apt install bc -y From 393638722c3afbb2a16dddea8e954be35c13776b Mon Sep 17 00:00:00 2001 From: dkunhamb Date: Wed, 6 Nov 2024 10:33:28 -0600 Subject: [PATCH 08/13] update docs image --- .github/workflows/ci_cd.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index f3914f58c..6798eb202 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -501,7 +501,7 @@ jobs: name: Documentation runs-on: ubuntu-latest container: - image: ${{ needs.revn-variations.outputs.stable_container }} + image: ${{ needs.revn-variations.outputs.test_container }} options: --entrypoint /bin/bash needs: [style, doc-style, revn-variations, container-stability-check] From 45a205b46b5245d03f9c1a267c020cc3e98f7927 Mon Sep 17 00:00:00 2001 From: klmcadams <58492561+klmcadams@users.noreply.github.com> Date: Wed, 6 Nov 2024 12:03:16 -0500 Subject: [PATCH 09/13] try one equals --- .github/workflows/ci_cd.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index 6798eb202..dda44c156 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -565,7 +565,7 @@ jobs: unset PYMECHANICAL_START_INSTANCE output_file=doc_$1_output.txt - if [ "${{ needs.container-stability-check.outputs.container_stable_exit }}" == "true" ]; then + if [ "${{ needs.container-stability-check.outputs.container_stable_exit }}" = "true" ]; then xvfb-run mechanical-env make -C doc $1 else xvfb-run mechanical-env make -C doc $1 > $output_file 2>&1 || true From 85e42e8c0d17fac295748b89a765b762825b549f Mon Sep 17 00:00:00 2001 From: dkunhamb Date: Wed, 6 Nov 2024 13:55:49 -0600 Subject: [PATCH 10/13] update condition --- .github/workflows/ci_cd.yml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index dda44c156..0b6e29bc2 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -320,7 +320,7 @@ jobs: PYTHONUNBUFFERED: 1 run: | . /env/bin/activate - if [ "${{ needs.container-stability-check.outputs.container_stable_exit }}" == "true" ]; then + if [ "${{ needs.container-stability-check.outputs.container_stable_exit }}" = "true" ]; then xvfb-run mechanical-env pytest -m embedding -s --junitxml test_results${{ matrix.python-version }}.xml else xvfb-run mechanical-env pytest -m embedding -s --junitxml test_results${{ matrix.python-version }}.xml || true @@ -431,7 +431,7 @@ jobs: container: image: ${{ needs.revn-variations.outputs.test_container }} options: --entrypoint /bin/bash - needs: [ style, revn-variations] + needs: [ style, revn-variations, container-stability-check] strategy: fail-fast: false matrix: @@ -467,7 +467,11 @@ jobs: unset PYMECHANICAL_PORT unset PYMECHANICAL_START_INSTANCE . /env/bin/activate - pytest -m remote_session_launch -s --junitxml launch_test_results${{ matrix.python-version }}.xml || true + if [ "${{ needs.container-stability-check.outputs.container_stable_exit }}" = "true" ]; then + pytest -m remote_session_launch -s --junitxml launch_test_results${{ matrix.python-version }}.xml + else + pytest -m remote_session_launch -s --junitxml launch_test_results${{ matrix.python-version }}.xml || true + fi - name: Publish Launch Test Report uses: mikepenz/action-junit-report@v4 @@ -569,7 +573,7 @@ jobs: xvfb-run mechanical-env make -C doc $1 else xvfb-run mechanical-env make -C doc $1 > $output_file 2>&1 || true - cat $output_file + cat $output_filehttps://github.com/ansys/pymechanical/issues echo done running make validate_output $output_file fi From 4ab165d6fe9121a75eba9ed6dbc9fb1cf490491d Mon Sep 17 00:00:00 2001 From: pyansys-ci-bot <92810346+pyansys-ci-bot@users.noreply.github.com> Date: Wed, 6 Nov 2024 19:58:22 +0000 Subject: [PATCH 11/13] chore: adding changelog file 965.maintenance.md [dependabot-skip] --- doc/changelog.d/965.maintenance.md | 1 + doc/changelog.d/965.test.md | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) create mode 100644 doc/changelog.d/965.maintenance.md delete mode 100644 doc/changelog.d/965.test.md diff --git a/doc/changelog.d/965.maintenance.md b/doc/changelog.d/965.maintenance.md new file mode 100644 index 000000000..7a450e7d1 --- /dev/null +++ b/doc/changelog.d/965.maintenance.md @@ -0,0 +1 @@ +Modify how job success is verified for tests \ No newline at end of file diff --git a/doc/changelog.d/965.test.md b/doc/changelog.d/965.test.md deleted file mode 100644 index b6de8c0aa..000000000 --- a/doc/changelog.d/965.test.md +++ /dev/null @@ -1 +0,0 @@ -stable exit of container \ No newline at end of file From fdd737362d739ceb01aebeebf96b331f9d74f517 Mon Sep 17 00:00:00 2001 From: Dipin <26918585+dipinknair@users.noreply.github.com> Date: Wed, 6 Nov 2024 14:15:59 -0600 Subject: [PATCH 12/13] Update .github/workflows/ci_cd.yml --- .github/workflows/ci_cd.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index 1812f5322..6b9774ebf 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -573,7 +573,7 @@ jobs: xvfb-run mechanical-env make -C doc $1 else xvfb-run mechanical-env make -C doc $1 > $output_file 2>&1 || true - cat $output_filehttps://github.com/ansys/pymechanical/issues + cat $output_file echo done running make validate_output $output_file fi From b6f5f3142868244c043c35db15679d31bfdcadf0 Mon Sep 17 00:00:00 2001 From: pyansys-ci-bot <92810346+pyansys-ci-bot@users.noreply.github.com> Date: Thu, 7 Nov 2024 00:40:46 +0000 Subject: [PATCH 13/13] chore: adding changelog file 965.maintenance.md [dependabot-skip] --- doc/changelog.d/965.maintenance.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/changelog.d/965.maintenance.md b/doc/changelog.d/965.maintenance.md index 7a450e7d1..b238e087b 100644 --- a/doc/changelog.d/965.maintenance.md +++ b/doc/changelog.d/965.maintenance.md @@ -1 +1 @@ -Modify how job success is verified for tests \ No newline at end of file +Modify how job success is verified for CI/CD \ No newline at end of file