patrol icon indicating copy to clipboard operation
patrol copied to clipboard

Add support for running tagged test files

Open kostadin-damyanov-prime opened this issue 1 year ago • 5 comments

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.

kostadin-damyanov-prime avatar Jan 09 '24 10:01 kostadin-damyanov-prime

To view this pull requests documentation preview, visit the following URL:

patrol.leancode.co/~2052

Documentation is deployed and generated using docs.page.

docs-page[bot] avatar Jan 09 '24 10:01 docs-page[bot]

Hi @kostadin-damyanov-prime, thanks a lot for making this contribution! We have just discussed tags internally :)

I have a few questions:

  1. ~Should we lock the analyzer package version to some more specific than any?~ ok, solved
  2. 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 avatar Jan 09 '24 10:01 mateuszwojtczak

@mateuszwojtczak Hi.

  1. Done.
  2. 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.

kostadin-damyanov-prime avatar Jan 09 '24 10:01 kostadin-damyanov-prime

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.

mateuszwojtczak avatar Jan 09 '24 10:01 mateuszwojtczak

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 avatar Jan 09 '24 12:01 kostadin-damyanov-prime

@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 :)

mateuszwojtczak avatar Jun 14 '24 08:06 mateuszwojtczak