Skip to content

Fix #11276: Scala.js: Take JUnit tests from superclasses/traits into account. #11382

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

Conversation

sjrd
Copy link
Member

@sjrd sjrd commented Feb 11, 2021

The Scala 2 code uses

owner.info.members.filter(m => m.isMethod && m.hasAnnotation(annot))

for the equivalent operation.

The code in Scala 3 used decls instead of members, which is
clearly incorrect. This commit fixes the discrepancy.

This was tested manually by making sure that

> sjsJUnitTests/testOnly org.scalajs.testsuite.javalib.util.ArrayListTest

runs 40 tests, and not just 1. It is not clear how to write
automated tests for this fix.

…into account.

The Scala 2 code uses

    owner.info.members.filter(m => m.isMethod && m.hasAnnotation(annot))

for the equivalent operation.

The code in Scala 3 used `decls` instead of `members`, which is
clearly incorrect. This commit fixes the discrepancy.

This was tested manually by making sure that

    > sjsJUnitTests/testOnly org.scalajs.testsuite.javalib.util.ArrayListTest

runs 40 tests, and not just 1. It is not clear how to write
automated tests for this fix.
@sjrd sjrd added this to the 3.0.0-RC1 milestone Feb 11, 2021
@sjrd sjrd requested a review from nicolasstucki February 11, 2021 09:34
@sjrd
Copy link
Member Author

sjrd commented Feb 11, 2021

Tentatively assigning this to the RC1 milestone. Assuming the CI passes, this should be a no-brainer. Without this fix, there are potentially a lot of tests in the wild that are silently ignored.

@anatoliykmetyuk anatoliykmetyuk modified the milestones: 3.0.0-RC1, 3.0.0-RC2 Feb 11, 2021
@nicolasstucki nicolasstucki merged commit a898baf into scala:master Feb 17, 2021
@nicolasstucki nicolasstucki deleted the sjs-fix-junit-tests-from-supertypes branch February 17, 2021 08:45
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.

3 participants