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

Upgrade to junit 5 #6916

Closed
rnveach opened this issue Jul 23, 2019 · 23 comments
Closed

Upgrade to junit 5 #6916

rnveach opened this issue Jul 23, 2019 · 23 comments

Comments

@rnveach
Copy link
Member

rnveach commented Jul 23, 2019

As discussed at #6914 (comment),

We should try to upgrade to junit 5.
https://junit.org/junit5/docs/current/user-guide/#migrating-from-junit4

@strkkk
Copy link
Member

strkkk commented Jul 24, 2019

Migration plan, in my vision

@strkkk
Copy link
Member

strkkk commented Aug 7, 2019

I checked and these changes are actually huge.
Probably it should be split into some smaller subtasks.
For example, if we can run both junit4 and junit5 tests simultaneously, upgrade can be applied per-package basis.

@romani
Copy link
Member

romani commented Aug 7, 2019

Please suggest plan for sequential upgrade, it is preferable, as it will simplify review.

We can upgrade to junit5 binaries, but still use old junit4 classes ? and when think about how to migrate to new junit classes.
You can update description of issue and define list of sub task to be done, so this issue will be some sort of umbrella.
You can see example at #6726 .

@pbludov
Copy link
Member

pbludov commented Aug 8, 2019

IntelliJ IDEA has an inspection to perform migration to JUnit5 automagically:
https://blog.jetbrains.com/idea/2017/11/intellij-idea-2017-3-junit-support/

@strkkk
Copy link
Member

strkkk commented Aug 8, 2019

IntelliJ IDEA has an inspection to perform migration to JUnit5 automagically:
https://blog.jetbrains.com/idea/2017/11/intellij-idea-2017-3-junit-support/

Thanks, this one will definitely help here. I will check what things it cannot solve.

@strkkk
Copy link
Member

strkkk commented Aug 10, 2019

Please suggest plan for sequential upgrade, it is preferable, as it will simplify review

Done, see second post in this issue.

IntelliJ IDEA has an inspection to perform migration to JUnit5 automagically

If it will be helpful for someone, this item can be found in "inspections" section and was disabled by default on my machine.

@romani
Copy link
Member

romani commented Aug 10, 2019

We have config for inspections, if it is useful in long run , we can activate it now

pbludov pushed a commit to pbludov/checkstyle that referenced this issue Nov 30, 2019
pbludov pushed a commit to pbludov/checkstyle that referenced this issue Nov 30, 2019
pbludov pushed a commit to pbludov/checkstyle that referenced this issue Nov 30, 2019
pbludov pushed a commit to pbludov/checkstyle that referenced this issue Nov 30, 2019
pbludov pushed a commit to pbludov/checkstyle that referenced this issue Nov 30, 2019
pbludov pushed a commit to pbludov/checkstyle that referenced this issue Dec 2, 2019
pbludov pushed a commit to pbludov/checkstyle that referenced this issue Dec 2, 2019
pbludov pushed a commit to pbludov/checkstyle that referenced this issue Dec 3, 2019
pbludov pushed a commit to pbludov/checkstyle that referenced this issue Dec 3, 2019
@romani
Copy link
Member

romani commented Dec 3, 2019

fist step is merged.

@pbludov
Copy link
Member

pbludov commented Dec 4, 2019

Minor related issue: #7305
As a workaround it is possible to add the annotation to the check config.

@pbludov
Copy link
Member

pbludov commented Dec 4, 2019

Another issue for DesignForExtension check and @BeforeEach annotation.

pbludov added a commit to pbludov/checkstyle that referenced this issue Aug 29, 2020
pbludov added a commit to pbludov/checkstyle that referenced this issue Aug 29, 2020
pbludov added a commit to pbludov/checkstyle that referenced this issue Aug 29, 2020
pbludov added a commit to pbludov/checkstyle that referenced this issue Aug 29, 2020
pbludov added a commit to pbludov/checkstyle that referenced this issue Aug 29, 2020
pbludov added a commit to pbludov/checkstyle that referenced this issue Aug 30, 2020
pbludov added a commit to pbludov/checkstyle that referenced this issue Aug 30, 2020
pbludov added a commit to pbludov/checkstyle that referenced this issue Aug 30, 2020
pbludov added a commit to pbludov/checkstyle that referenced this issue Aug 30, 2020
pbludov added a commit to pbludov/checkstyle that referenced this issue Aug 30, 2020
pbludov added a commit to pbludov/checkstyle that referenced this issue Aug 31, 2020
@pbludov
Copy link
Member

pbludov commented Sep 5, 2020

Status update: @Isolated annotation works fine except for OSX builds on 64+ core hosts. They may fail with
java.util.concurrent.RejectedExecutionException: java.util.concurrent.RejectedExecutionException: Thread limit exceeded replacing blocked worker somewhere in the surefire executor.

Failed build example: https://travis-ci.org/github/checkstyle/checkstyle/jobs/722516044

It looks like this is a bug in surefire or even in JDK. It is possible that somewhere the number of physical cores is taken instead of the number of logical cores. It's hard to say for sure yet. I will research this issue further.

pbludov added a commit to pbludov/checkstyle that referenced this issue Sep 20, 2020
@rnveach
Copy link
Member Author

rnveach commented Oct 10, 2020

@pbludov Is all that is left on the upgrade to do parallel execution? (Noted at #6916 (comment))
If so, maybe we should move it to a new issue and close this?

pbludov added a commit to pbludov/checkstyle that referenced this issue Oct 11, 2020
@pbludov
Copy link
Member

pbludov commented Oct 11, 2020

If so, maybe we should move it to a new issue and close this?

I'll re-check how stable the OSX parallel tests now. Perhaps the reason is that we need to update the JDK for the OSX CI. This is the only build that has problems with parallel execution. Or may be just disable parallel execution of tests for this setup.

If It fail, I'll make this a separate issue, and close this one.

@pbludov
Copy link
Member

pbludov commented Oct 11, 2020

I must admit that OSX build is stable now. I restarted the build 10 times. None of them had any problems.

pbludov added a commit to pbludov/checkstyle that referenced this issue Oct 11, 2020
pbludov added a commit to pbludov/checkstyle that referenced this issue Oct 11, 2020
pbludov added a commit to pbludov/checkstyle that referenced this issue Oct 11, 2020
@pbludov
Copy link
Member

pbludov commented Oct 11, 2020

Finally, make it fail
https://travis-ci.org/github/checkstyle/checkstyle/jobs/734693767#L437

ERROR] Errors: 

[ERROR]   java.util.concurrent.RejectedExecutionException: Thread limit exceeded replacing blocked worker

I'll start a new issue for this

@pbludov
Copy link
Member

pbludov commented Oct 11, 2020

This bug does not affect local OSX builds.

pbludov added a commit to pbludov/checkstyle that referenced this issue Oct 15, 2020
@pbludov
Copy link
Member

pbludov commented Oct 31, 2020

The issue is done. Powermock tests will be updated in #7368

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants