Skip to content

Commit d95fc55

Browse files
committed
Fix log collection in Selenium workflows
Prior to this commit, if a test failed, the script 'run-suites.sh' would exit with non-zero status, stopping the exection of the job; therefore, the steps to move the logs to the expected location won't be executed. This commit separates the tests from the log preparation.
1 parent 9f336b9 commit d95fc55

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

.github/workflows/test-management-ui-for-pr.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,16 @@ jobs:
6161
IMAGE_TAG=$(find PACKAGES/rabbitmq-server-generic-unix-*.tar.xz | awk -F 'PACKAGES/rabbitmq-server-generic-unix-|.tar.xz' '{print $2}')
6262
RABBITMQ_DOCKER_IMAGE=pivotalrabbitmq/rabbitmq:$IMAGE_TAG \
6363
${SELENIUM_DIR}/run-suites.sh short-suite-management-ui
64+
65+
- name: Prepare logs for upload
66+
if: ${{ failure() && steps.tests.outcome == 'failed' }}
67+
run: |
6468
mkdir -p /tmp/short-suite
6569
mv /tmp/selenium/* /tmp/short-suite
6670
6771
- name: Upload Test Artifacts
68-
if: always()
69-
uses: actions/upload-artifact@v4.3.2
72+
if: ${{ failure() && steps.tests.outcome == 'failed' }}
73+
uses: actions/upload-artifact@v4
7074
with:
7175
name: test-artifacts-${{ matrix.browser }}-${{ matrix.erlang_version }}
7276
path: |

.github/workflows/test-management-ui.yaml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,18 +69,22 @@ jobs:
6969
docker build -t mocha-test --target test .
7070
7171
- name: Run full UI suite on a 3-node rabbitmq cluster
72+
id: tests
7273
run: |
7374
IMAGE_TAG=$(find PACKAGES/rabbitmq-server-generic-unix-*.tar.xz | awk -F 'PACKAGES/rabbitmq-server-generic-unix-|.tar.xz' '{print $2}')
7475
RABBITMQ_DOCKER_IMAGE=pivotalrabbitmq/rabbitmq:$IMAGE_TAG \
7576
${SELENIUM_DIR}/run-suites.sh full-suite-management-ui
77+
78+
- name: Prepare logs for upload
79+
if: ${{ failure() && steps.tests.outcome == 'failed' }}
80+
run: |
7681
mkdir -p /tmp/full-suite
77-
mv /tmp/selenium/* /tmp/full-suite
82+
mv -v /tmp/selenium/* /tmp/full-suite
7883
7984
- name: Upload Test Artifacts
80-
if: always()
85+
if: ${{ failure() && steps.tests.outcome == 'failed' }}
8186
uses: actions/[email protected]
8287
with:
8388
name: test-artifacts-${{ matrix.browser }}-${{ matrix.erlang_version }}
8489
path: |
8590
/tmp/full-suite
86-
/tmp/short-suite

0 commit comments

Comments
 (0)