Skip to content

Commit 5e7efd1

Browse files
committed
Add step for Behat faildump storing as GHA artifact.
1 parent 7b22048 commit 5e7efd1

File tree

3 files changed

+27
-0
lines changed

3 files changed

+27
-0
lines changed

docs/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ This project adheres to [Semantic Versioning](http://semver.org/).
99
The format of this change log follows the advice given at [Keep a CHANGELOG](http://keepachangelog.com).
1010

1111
## [Unreleased]
12+
13+
- Added GHA step to store Behat faildump as workflow artefact, so it can be
14+
[inspected](https://docs.github.com/en/actions/managing-workflow-runs/downloading-workflow-artifacts). Documentation has been updated as well to reflect the purpose of the step.
15+
1216
## [4.4.1] - 2024-03-08
1317
### Added
1418
- New `--no-plugin-node` option added to the `install` command, to be able to skip the installation of any NodeJS stuff that the plugin may include. The previous default has not changed and both Moodle's and plugin's NodeJS installation continues happening normally.

docs/GHAFileExplained.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,9 +181,22 @@ jobs:
181181
run: moodle-plugin-ci phpunit
182182

183183
- name: Behat features
184+
id: behat
184185
if: ${{ !cancelled() }}
185186
run: moodle-plugin-ci behat --profile chrome
186187

188+
# This step allows to upload Behat faildump (screenshots) as workflow artifact
189+
# so it can be downloaded and inspected. You don't need this step if you
190+
# are not running Behat test. Artifact will be retained for 7 days.
191+
- name: Upload Behat Faildump
192+
if: ${{ failure() && steps.behat.outcome == 'failure' }}
193+
uses: actions/upload-artifact@v4
194+
with:
195+
name: Behat Faildump (${{ join(matrix.*, ', ') }})
196+
path: ${{ github.workspace }}/moodledata/behat_dump
197+
retention-days: 7
198+
if-no-files-found: ignore
199+
187200
- name: Mark cancelled jobs as failed.
188201
if: ${{ cancelled() }}
189202
run: exit 1

gha.dist.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,19 @@ jobs:
109109
run: moodle-plugin-ci phpunit --fail-on-warning
110110

111111
- name: Behat features
112+
id: behat
112113
if: ${{ !cancelled() }}
113114
run: moodle-plugin-ci behat --profile chrome
114115

116+
- name: Upload Behat Faildump
117+
if: ${{ failure() && steps.behat.outcome == 'failure' }}
118+
uses: actions/upload-artifact@v4
119+
with:
120+
name: Behat Faildump (${{ join(matrix.*, ', ') }})
121+
path: ${{ github.workspace }}/moodledata/behat_dump
122+
retention-days: 7
123+
if-no-files-found: ignore
124+
115125
- name: Mark cancelled jobs as failed.
116126
if: ${{ cancelled() }}
117127
run: exit 1

0 commit comments

Comments
 (0)