Skip to content

Commit 55afd6d

Browse files
andypostdavidferlay
authored andcommitted
Allow Gitlab to parse behat results
1 parent 06c3025 commit 55afd6d

File tree

4 files changed

+13
-7
lines changed

4 files changed

+13
-7
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ docker/docker-compose.override.yml
1717
behat.yml
1818
features/*.html
1919
features/*.png
20+
features/junit/
2021
.cache/
2122
.editorconfig
2223
.gitattributes

.gitlab-ci.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,14 +257,15 @@ test:behat:
257257
script:
258258
- echo "Starting job script in ${BUILD_DIR}"
259259
- cd ${BUILD_DIR}
260-
- make behat
260+
- BEHAT_ARGS='--colors -f pretty -o std -f junit -o features/junit' make behat
261261
after_script:
262262
- cd ${BUILD_DIR}
263263
- make browser_driver_stop
264264
- rm -rf web/screenshots
265265
- mkdir web/screenshots
266266
- mv features/*.png web/screenshots/
267267
- echo "- Screenshots are available here :" && cd web/screenshots && ls -h *.png | xargs -i echo "${CI_ENVIRONMENT_URL}/screenshots/{}"
268+
- mv ${BUILD_DIR}/features/junit ${CI_PROJECT_DIR}
268269
retry:
269270
max: 2
270271
when: script_failure
@@ -273,6 +274,13 @@ test:behat:
273274
allow_failure: false
274275
<<: *runner_tag_selection
275276
<<: *only_branches
277+
artifacts:
278+
expire_in: 1 week
279+
when: always
280+
paths:
281+
- junit/*.xml
282+
reports:
283+
junit: junit/*.xml
276284

277285
test:cinsp:
278286
stage: tests

composer.json

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -183,15 +183,11 @@
183183
},
184184
"drupal/lb_ux": {
185185
"Cog icon not showing when Preview disabled": "https://www.drupal.org/files/issues/2020-05-22/3116402-8.patch",
186-
"Errors when using with modules that alter a section's contextual menu": "https://www.drupal.org/files/issues/2020-05-22/3106939-4.patch",
187-
"Indicate Drupal 8/9 compatibility via core_version_requirement": "https://www.drupal.org/files/issues/2020-05-22/d9_compatibility-3138698-4.patch"
186+
"Errors when using with modules that alter a section's contextual menu": "https://www.drupal.org/files/issues/2020-05-22/3106939-4.patch"
188187
},
189188
"drupal/menu_link_attributes": {
190189
"Add missing schema for menu_link_attributes": "https://patch-diff.githubusercontent.com/raw/yannickoo/menu_link_attributes/pull/52.patch"
191190
},
192-
"drupal/panels_everywhere": {
193-
"Drupal 9 compatibility fixes for Panels Everywhere": "https://www.drupal.org/files/issues/2020-05-14/d9-compatibility-3111407-7.patch"
194-
},
195191
"drupal/upgrade_status": {
196192
"Exclude node_modules from scan": "https://www.drupal.org/files/issues/2020-08-14/3162997-8.patch"
197193
}

scripts/makefile/tests.mk

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ else
125125
endif
126126

127127
## Validate Behat scenarios
128+
BEHAT_ARGS ?= --colors
128129
behat:
129130
@echo "Getting base url"
130131
ifdef REVIEW_DOMAIN
@@ -143,7 +144,7 @@ endif
143144
@echo "Running Behat scenarios against http://$(BASE_URL)"
144145
$(call php, composer install -o)
145146
$(call php, vendor/bin/behat -V)
146-
$(call php, vendor/bin/behat --colors) || $(call php, vendor/bin/behat --colors --rerun)
147+
$(call php, vendor/bin/behat $(BEHAT_ARGS)) || $(call php, vendor/bin/behat $(BEHAT_ARGS) --rerun)
147148
make browser_driver_stop
148149

149150
## List existing behat definitions

0 commit comments

Comments
 (0)