Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Drupal
drupalizer
Commits
36444006
Commit
36444006
authored
Jun 21, 2016
by
Samuel Sirois
Browse files
Add a <tags> argument to the <test> command
We can now filter which scenarios are run by behat.
parent
e79b5bdf
Changes
3
Hide whitespace changes
Inline
Side-by-side
CHANGELOG.adoc
View file @
36444006
...
...
@@ -6,6 +6,8 @@ This project adheres to http://semver.org/[Semantic Versioning].
== [Unreleased]
* Add a "tags" argument to the "test" command in order to limit which scenarios are run by behat.
=== Fixed
* Site name can now have whitespaces without breaking the shell execution string
...
...
__init__.py
View file @
36444006
...
...
@@ -25,16 +25,19 @@ def init():
@
task
def
test
():
def
test
(
tags
=
''
):
"""
Setup Behat and run the complete tests suite. Default output formatters: pretty and JUnit.
The JUnit report file is specified in the Behat configuration file. Default: tests/behat/out/behat.junit.xml.
:param tag Specific Behat tests tags to run.
:param tag
s
Specific Behat tests tags to run.
"""
execute
(
behat
.
init
)
execute
(
behat
.
run
)
if
not
tags
:
execute
(
behat
.
run
)
else
:
execute
(
behat
.
run
,
tags
=
'{}'
.
format
(
tags
))
...
...
behat.py
View file @
36444006
...
...
@@ -51,7 +51,7 @@ def install():
@
task
@
roles
(
'docker'
)
def
run
():
def
run
(
tags
=
'~@wip&&~@disabled&&~@test'
):
"""
Execute the complete Behat tests suite.
:param role Default 'role' where to run the task
...
...
@@ -68,8 +68,5 @@ def run():
if
not
h
.
fab_exists
(
role
,
'{}/tests/behat/behat.yml'
.
format
(
workspace
)):
init
()
with
h
.
fab_cd
(
role
,
'{}/tests/behat'
.
format
(
workspace
)):
h
.
fab_run
(
role
,
'behat --format junit --format pretty --tags "~@wip&&~@disabled&&~@test" --colors'
)
# To run behat with only one test for example, comment previous line
# and uncomment next one
# fab_run(role, 'behat --format pretty --tags "~@wip&&~@disabled&&@yourTest" --colors')
h
.
fab_run
(
role
,
'behat --format junit --format pretty --tags "{}" --colors'
.
format
(
tags
))
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment