-
-
Notifications
You must be signed in to change notification settings - Fork 124
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
Feature Request: Conditional Skip #442
Comments
That sounds like a reasonable approach. Something like Another solution may be to use the |
Depending on the situation the filter might be a "painful" solution, because it can end up in a lot of trail and error and could be quite extensive :-) But it can solve this issue as well. |
Yeah, its not a good solution, just something that might work in some cases. Feel free to make a PR or I can try and have a look in the coming days/weeks as its quite trivial. |
Would |
In our special case groups won't help a lot. But thnx for the hint. |
It would be quite useful to skip benchmarks similar to PHPUnit: if (! $missingFeature) {
$this->skipBenchmark('Missing a requirement.');
} |
That won't work as the benchmark doesn't know anything about PHPBench ... so |
A static method would work 👌 |
@dantleech: |
Is there any way to skip a class or method based on conditions?
We are writing some benchmarks for PHP functions themselves to actually compare/test servers and setups. The issue we have is, that some environments do not support all of the benchmark subjects. E.g. not all of them have a DB installed, so i would like to automatically skip those tests.
Would it be possible to add a parameter to the "@Skip()"? e.g. a method which will be called and its return value decides about the skip? so "@Skip(noDatabaseAvailable)" would call the method $this->noDatabaseAvailable() and if it returns true, it will be skipped otherwise executed.
The text was updated successfully, but these errors were encountered: