patrol
patrol copied to clipboard
Add support for running tagged test files
Hello.
This PR adds support for --tags
option for the test
command.
This way we can tag test files with the @Tags
annotation like dart's test suite does.
Using this option we can now run only the test files matching a given tag or a list of tags.
To view this pull requests documentation preview, visit the following URL:
Documentation is deployed and generated using docs.page.
Hi @kostadin-damyanov-prime, thanks a lot for making this contribution! We have just discussed tags internally :)
I have a few questions:
- ~Should we lock the
analyzer
package version to some more specific thanany
?~ ok, solved - When I initially considered tags, I was thinking about somehow connecting to the official
test_api
way of doing that. I can see you implemented a separate mechanism for that. WDYT?
@mateuszwojtczak Hi.
- Done.
- I am not too familiar with test_api. Do they use a different approach? If there is some code that we can reuse I am all for it.
Yes, look at this information in their readme.
They also support dart_test.yaml
file. Your implementation is really fine with most cases and it's simple which is very beneficial.
I'm just worried that the community would assume that Patrol uses the same tags as Dart/Flutter tests. This is a very frequent assumption that ends with people filing issues, because they assume Patrol uses the same approach. Although we can't always be 100% compatible with that approach, we still at least try to do so.
I agree that mplementation based on test_api
will be more feature-rich. Maybe even supporting stuff like --exclude-tags
and boolean selectors. Unfortunately we do not have the time to implement it now. You can either merge this PR or do implementation based on test_api
yourself. We (and anyone else) can use this fork in the meantime.
@kostadin-damyanov-prime We decided to implement tags and skips by passing them as arguments to the patrolTest
function. This means we are no longer in need of annotations / other analyzer pre-processing work.
Thus, I'm closing this PR and we're gonna solve #492 with another approach :)