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

feat: add excludeTags flag #231

Merged
merged 1 commit into from
Mar 29, 2024
Merged

Conversation

paullatzelsperger
Copy link
Member

What this PR changes/adds

This PR adds a flag excludeTags to exclude certain test tags, analogous to the includeTags flag. That way
we can execute ./gradlew test -DrunAllTests -DexcludeTags="foo,bar", effectively blacklisting certain tags.

Why it does that

Sometimes its easier to blacklist certain tags, than whitelist all the others.

Further notes

List other areas of code that have changed but are not necessarily linked to the main feature. This could be method
signature changes, package declarations, bugs that were encountered and were fixed inline, etc.

Linked Issue(s)

Closes # <-- insert Issue number if one exists

Please be sure to take a look at the contributing guidelines and our etiquette for pull requests.

@paullatzelsperger paullatzelsperger added the enhancement New feature or request label Mar 29, 2024
Copy link

github-actions bot commented Mar 29, 2024

Test Results

49 tests  ±0   49 ✅ ±0   17s ⏱️ -1s
20 suites ±0    0 💤 ±0 
20 files   ±0    0 ❌ ±0 

Results for commit c79d9d1. ± Comparison against base commit c63ddb5.

♻️ This comment has been updated with latest results.

if (includedTags.length > 0) {
testTask.useJUnitPlatform(platform -> platform.includeTags(includedTags));
//... and possibly black-list excluded tags
if (excludedTags.length > 0) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is the case where someone wants to include and exclude tags in the same execution?
I see two cases:

  • default (no tags included) -> possibility to include
  • runAllTests (all tags included) -> possibility to exclude

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this could happen on "derived" tags, e.g. someone includes ComponentTest but wants to exclude AVerySpecialComponentTest

@paullatzelsperger paullatzelsperger merged commit f4c194c into main Mar 29, 2024
17 checks passed
@paullatzelsperger paullatzelsperger deleted the feat/add_excludeTags_flag branch March 29, 2024 11:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants