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
Using @depends to depend on classes #3519
Comments
@epdenouden Would be great to get your input on this. |
Just to give an example for where I think depending on a test class makes sense: in a project, I have integration tests covering each step of a process that the software implements. Each step is based on the result of the previous step, so expressing that by a test dependency seems appropriate. Rather than depending on a certain test method, however, I would want to depend on the whole test class responsible for a given process step. |
Completely missed this new issue being referenced in #3517 and fits right in with all the other thinking about what 'independent units of work' a test collection is made out of. The scenario @spriebsch mentions is a daily business in my work. I will have a good look at |
@sebastianbergmann you can just assign the issue to me if you want :) |
"I don't think this should be doable and safe" scares me. |
And rightfully so! I was doing github-before-coffee. Apologies @sebastianbergmann, I mixed two topics in one sentence:
|
As you might have seen there was some discussion around forcing dependencies to run. Basically that could work, seeing as the result returned simply comes from the
So yeah. Let's avoid such risks around the runner core :) |
What's the status of this, please? |
Bump #3449 |
As of today, the
@depends
annotation cannot be used to express that a test (or all tests of a test case class) depend on all the tests of another test case class to pass. This fact is not clear in the documentation (sebastianbergmann/phpunit-documentation-english#121 exists to remedy this). It is also not clear from the error output you get if you try to use@depend TestClassName
. Consider the two test case classes shown below:Executing the tests shown above results in the confusing output shown below:
Once #3517 is implemented this error output would be less confusing. But it would still not be clear that using
@depends
to depend on all tests of a test case class to pass is not possible.In the past I said that "[i]t does not make sense to me for a test to depend on all tests of a test case class". In a recent discussion, @spriebsch changed my mind. Especially in the context of integration tests, or larger tests in general, this makes a lot of sense.
What does not make sense, in my opinion, is to pass the results of all tests of a test case class to the test(s) that depend(s) on that test case class.
The text was updated successfully, but these errors were encountered: