Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move phpunit/behat initialisation from install step #36

Open
kabalin opened this issue Sep 15, 2020 · 0 comments
Open

Move phpunit/behat initialisation from install step #36

kabalin opened this issue Sep 15, 2020 · 0 comments
Labels
task Some task to complete

Comments

@kabalin
Copy link
Member

kabalin commented Sep 15, 2020

Currently the plugin works in a way that behat/phpunit initialisation happens as part of install step irrespective whether ci script contains those tests or not. The logic is based on test files presence:

if ($this->plugin->hasBehatFeatures() || $this->plugin->hasUnitTests()) {
If files are there, test suit will be initialised (either or both). As behat/phpunit initialisation is time consuming, current logic might not be super efficient for the reasons:

  • Developer might need just one type of test or none in CI scenario.
  • Developer might want to split test in more than one stages (or run time consuming Behat test in parallel with others), and again does not need to initialise both at install step at each stage

There is --no-init param in install step that may partially help if behat and phpunit tests are not planned at all, but if either is required, initialisation will need to be triggered outside plugin (e.g. by explicit calling php admin/tool/behat/cli/init.php .... as part of CI scenario that you can spot some developers use already)

Suggested option is to move initialisation routines to respective steps, so that init is triggered only if this type of test is used in the scenario. What would be required:

  • Make behat/phpunit init calls a part of respective steps, don't output init process to test log (unless -vvv option is passed).
  • Add --no-init option to behat and phpunit step (in case one need to skip init, e.g. multiple calls of same step in scenario although init will be quick on consequent runs even without this option).
  • Install step --no-init should propagate no-init to both behat/phpunit so that it works the same in existing scenarios that use this param (alternatively we can deprecate it and fail install step with error message if used, so people would have to make changes in scripts and likely remove obsolete custom init runs?)
@kabalin kabalin added the task Some task to complete label Sep 15, 2020
@kabalin kabalin changed the title Improve phpunit/behat initialisation Move phpunit/behat initialisation from install step Sep 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
task Some task to complete
Projects
None yet
Development

No branches or pull requests

1 participant