Skip to content

Fix #7949: sbt test discovery should not run traits #7950

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

Merged
merged 1 commit into from
Jan 9, 2020

Conversation

smarter
Copy link
Member

@smarter smarter commented Jan 9, 2020

Traits don't have the Abstract flag set, so we need to also check for
the Trait flag, otherwise
https://github.com/sbt/zinc/blob/cdd2a20f110e1eb4a713597b553d57b823466f75/internal/zinc-apiinfo/src/main/scala/xsbt/api/Discovery.scala#L74
will return true for traits, making them eligible for test discovery.

Also reorder checks to short-circuit checking for flags when possible.

Traits don't have the `Abstract` flag set, so we need to also check for
the `Trait` flag, otherwise
https://github.com/sbt/zinc/blob/cdd2a20f110e1eb4a713597b553d57b823466f75/internal/zinc-apiinfo/src/main/scala/xsbt/api/Discovery.scala#L74
will return true for traits, making them eligible for test discovery.

Also reorder checks to short-circuit checking for flags when possible.
@smarter smarter requested a review from sjrd January 9, 2020 17:13
Copy link
Member

@sjrd sjrd left a comment

Choose a reason for hiding this comment

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

Thanks for the quick fix!

@smarter smarter merged commit 31ce00c into scala:master Jan 9, 2020
@smarter smarter deleted the fix-trait-test branch January 9, 2020 19:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants