Skip to content
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

Add support for running tagged test files #2052

Conversation

kostadin-damyanov-prime
Copy link

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.

Copy link

docs-page bot commented Jan 9, 2024

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

patrol.leancode.co/~2052

Documentation is deployed and generated using docs.page.

@github-actions github-actions bot added the package: patrol_cli Related to the patrol_cli package label Jan 9, 2024
@mateuszwojtczak
Copy link
Contributor

mateuszwojtczak commented Jan 9, 2024

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?

@kostadin-damyanov-prime
Copy link
Author

@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.

@mateuszwojtczak
Copy link
Contributor

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.

@kostadin-damyanov-prime
Copy link
Author

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.

@mateuszwojtczak
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package: patrol_cli Related to the patrol_cli package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants