pest
pest copied to clipboard
[2.x] Skipping tests based on group parameter
This PR brings the possibility to skip or run tests based on stipulated groups via the command line using using the --groups=
parameter.
Motivation
I would like my tests to reach the API and endpoints during ONLY deployment. This could be achieved with phpunit.xml or with aliases or makefile, but this would need external configuration by my other team members. Also, I would like to avoid passing commands every time I run tests.
Usage
The test below will be skipped unless the group is explicitly called using the --groups=
parameter.
Runs the test: ./vendor/bin/pest --group=group1
Skips the test: ./vendor/bin/pest
it('runs this test when group is called', function () {
expect(true)->toBeTrue();
})
->group('group1') // it is not necessary
->skipUnlessGroup('group1');
Lgtm
I had to make an adjustment because it didn't work in parallel, since the behavior of ArgvInput in parallel is different.
No plans for this for now.