-
-
Notifications
You must be signed in to change notification settings - Fork 365
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
Add new --ci option to pest bin #405
Add new --ci option to pest bin #405
Conversation
Can you refactor this, in a way that the option gets "setted" using a plugin class? https://github.com/pestphp/pest/tree/master/src/Plugins. |
Done, I've extracted environment informations in |
@nunomaduro there are some strange errors in tests, are there currently any issues with them? |
Not sure why, but can't resolve the conflicts. Can you do it please? |
…o-pest-bin # Conflicts: # tests/.snapshots/success.txt
@nunomaduro I've solved merge conflicts CI errors keep showing, I think they are related to the ones showing in #409 |
@fabio-ivona Can you add docs about this? |
Sure! It's already written, will open a PR this night |
Hi guys!
as already discussed on the discord channel with @nunomaduro , this PR wants to put a base for adding a new "environment aware" behaviour to pestphp
background
my main idea comes from my bad habit to forget to remove
->only
method from a test (maybe added when fixing a bug) and this results the pipeline to execute only a partial set of my test suite, with the risk to deploy some other bug in production.the idea
Pestphp could be able to detect the environment it is running into and sligthing changing its behaviour according to it.
to hint pest it is running in a CI pipeline, it could be launched with the
--ci
option:vendor/bin/pest --colors=always --ci
and it would ignore all
->only()
directives given to itthe implementation
I added a new
$workingEnv
attribute to theTestSuite
class that holds the current working environment. Its default value is 'local' and it is set toci
if the pest binary is called with the--ci
optionthis way the
->only()
behaviour can be disabled when in a CI environment:future uses
the
TestSuite::getInstance()->workingEnv
attribute could be used in future implementation to fine tuning pest behaviour when in a continuous integration environment (or other ones, defined as necessary)