Skip to content

Commit 144700a

Browse files
authored
Merge pull request #291 from kabalin/faildump
Add step for Behat faildump storing as GHA artifact.
2 parents b9786ea + 5e7efd1 commit 144700a

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
@@ -176,9 +176,22 @@ jobs:
176176
run: moodle-plugin-ci phpunit
177177

178178
- name: Behat features
179+
id: behat
179180
if: ${{ !cancelled() }}
180181
run: moodle-plugin-ci behat --profile chrome
181182

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

gha.dist.yml

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

106106
- name: Behat features
107+
id: behat
107108
if: ${{ !cancelled() }}
108109
run: moodle-plugin-ci behat --profile chrome
109110

111+
- name: Upload Behat Faildump
112+
if: ${{ failure() && steps.behat.outcome == 'failure' }}
113+
uses: actions/upload-artifact@v4
114+
with:
115+
name: Behat Faildump (${{ join(matrix.*, ', ') }})
116+
path: ${{ github.workspace }}/moodledata/behat_dump
117+
retention-days: 7
118+
if-no-files-found: ignore
119+
110120
- name: Mark cancelled jobs as failed.
111121
if: ${{ cancelled() }}
112122
run: exit 1

0 commit comments

Comments
 (0)