Improve BDD with new testing command #420
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Using Behat for BDD and BDT is really impressive and useful. For new features I create a temporary tag
@wip
and rundocker compose exec php composer behat -- --tags=wip
. To test the feature on a specific redmine version I rundocker compose exec php composer behat -- --tags=issue,group --suite=redmine=50103
. If the feature is ready I run all behat tests on all redmine versions usingdocker compose exec php composer behat
.However the tests are becoming bigger and that leads to 1.) higher usage of time and memory to execute all tests at once. And 2.) it is not possible to change the format of the output using CLI (because the
--output=progress
is already declared incomposer.json
).This PR solves these problems by creating a new
bdt
composer command for tests grouped by Redmine versions (aka behat suites). The output there is always formatted asprogress
. If one test fails it is now easier to find the Redmine version, where the test has failed thanks to the separation by behat suite.Test-run: docker compose exec php composer bdt
The
behat
command will be changed to have no output format (defaults to--format=pretty
). So if I rundocker compose exec php composer behat -- --tags=wip
I will get the pretty format that helps me with debugging. If I want to have theprogress
output I can declare it withdocker compose exec php composer behat -- --tags=wip --format=progress
.This PR also improves the test docs explaining the different commands. I've tested theses new commands while working on #419.