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
Issue #6916: migrate tests to junit5 for annotation package #7303
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am fine with static import in tests.
item
config/import-control-test.xml
Outdated
<subpackage name="checks"> | ||
<subpackage name="annotation"> | ||
<allow pkg="org.junit.jupiter.api"/> | ||
<disallow pkg="org.junit"/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does it make sense to do this on top level, and explicitly allow junit in packages that are not converted yet?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, this is a temporary config. I will add processed packages here so that no one accidentally adds a junit4 test during the migration. Once all tests will use juni5, this section will be removed. Junit4 package annotations will not be available because the junit4 module will be removed from the pom.xml and this section will not be needed any more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I meant something like:
https://github.com/checkstyle/checkstyle/blob/master/config/import-control.xml#L15
https://github.com/checkstyle/checkstyle/blob/master/config/import-control.xml#L70
and it will works same during migration, and in each commit/PR , you will remove allow
for certain package so so at the end config will self cleanup.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done. Now Junit4 globally forbidden and explicitly enabled for every test except tests in checks/annotation
package. During migration, the allowed package list will shrink until it is empty.
IDEA inspections fails to recognize It's upsetting. I'll try to use Google Truth assertions instead. |
@pbludov @romani It is more concerning that pitest does not like junit5. This may be a bigger deal breaker than TC complaining.
Pitest says we lost all coverage. Looks like we might need a new dependency for pitest. https://github.com/pitest/pitest-junit5-plugin |
de5ccf9
to
4862daa
Compare
It works, thank you. |
Done. |
4862daa
to
e85ef90
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
last item:
e85ef90
to
f2123af
Compare
Shippable still hasn't finished. TC can be ignored. |
It is better to not ignore, but recheck that violations are same as in master |
f2123af
to
6e37b71
Compare
Issue #6916
Auto converted to Junit5 with IDEA inspections.
As a side effect, some imports replaced with static imports.