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

Migrate all tests to JUnit5 #9796

Merged
merged 19 commits into from
Aug 23, 2023
Merged

Migrate all tests to JUnit5 #9796

merged 19 commits into from
Aug 23, 2023

Conversation

poikilotherm
Copy link
Contributor

@poikilotherm poikilotherm commented Aug 18, 2023

What this PR does / why we need it:
To modernize testing and extend with helpers, etc, we need to move the test base to JUnit 5. Slow migration didn't happen, so let's get this over with.

Which issue(s) this PR closes:

Closes #9782

Special notes for your reviewer:
None. Basically, all tests have not been changed in meaning, but in JUnit API syntax. (As all tests were passing before and are passing now, it's the same state. However, there is a remote chance this change can introduce a testing regression.)

Here are some details on what changes were necessary to complete the task: https://junit.org/junit5/docs/current/user-guide/#migrating-from-junit4

Suggestions on how to test this:
Run all the tests.

Does this PR introduce a user interface change? If mockups are available, please link/include them here:
No

Is there a release notes update needed for this change?:
Probably.

Additional documentation:
Will be included.

@coveralls
Copy link

coveralls commented Aug 18, 2023

Coverage Status

coverage: 19.968% (-0.4%) from 20.37% when pulling 494624b on 9782-migrate-junit5 into 45a3936 on develop.

@github-actions

This comment has been minimized.

2 similar comments
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@poikilotherm poikilotherm marked this pull request as ready for review August 21, 2023 13:21
@github-actions

This comment has been minimized.

@pdurbin pdurbin self-assigned this Aug 21, 2023
@github-actions

This comment has been minimized.

@poikilotherm
Copy link
Contributor Author

@pdurbin done - the enforcer takes care of this. If someone accidentally re-introduces JUnit 4, their Maven will fail to execute tests.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

The old Mockito is outdated. Some day Mockito 2 might no longer
be compatible with newer Java versions, so let's update now.
Replace the following API usages no longer available:

- Mockito.verifyZeroInteractions() does not exist anymore since Mockito 4
- Mockito.any() does no longer match varargs since Mockito 5
- org.mockito.Matcher does no longer exist since Mockito 4
@github-actions
Copy link

📦 Pushed preview images as

ghcr.io/gdcc/dataverse:9782-migrate-junit5
ghcr.io/gdcc/configbaker:9782-migrate-junit5

🚢 See on GHCR. Use by referencing with full name as printed above, mind the registry name.

@pdurbin
Copy link
Member

pdurbin commented Aug 22, 2023

This failed on Jenkins with this:

TASK [dataverse : build warfile with specified tests using custom maven. tail /tmp/dataverse/mvn.out for gory details.] ***
fatal: [localhost]: FAILED! => {"changed": true, "cmd": "source /etc/profile.d/maven.sh && mvn -DcompilerArgument=-Xlint:unchecked test -P all-unit-tests -Djacoco.skip.instrument=false -T 2C clean package > mvn.out", "delta": "0:02:58.046746", "end": "2023-08-22 06:54:18.219668", "msg": "non-zero return code", "rc": 1, "start": "2023-08-22 06:51:20.172922", "stderr": "", "stderr_lines": [], "stdout": "", "stdout_lines": []}

@pdurbin
Copy link
Member

pdurbin commented Aug 22, 2023

I kicked off another Jenkins run: https://jenkins.dataverse.org/job/IQSS-Dataverse-Develop-PR/job/PR-9796/10/

I also kicked off https://github.com/gdcc/api-test-runner/actions/runs/5940755754 (the new "manual" workflow added by @poikilotherm )

@pdurbin
Copy link
Member

pdurbin commented Aug 22, 2023

I know Jenkins is failing but we have a Slack thread about it: https://iqss.slack.com/archives/C010LA04BCG/p1692718312562289

https://github.com/gdcc/api-test-runner/actions/runs/5940755754 passed so I'm going to approve this PR. Here's where you can see that the correct branch was tested:

Screen Shot 2023-08-22 at 11 56 23 AM

Copy link
Member

@pdurbin pdurbin left a comment

Choose a reason for hiding this comment

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

Looks good!

@pdurbin pdurbin removed their assignment Aug 22, 2023
@poikilotherm poikilotherm added the Size: 3 A percentage of a sprint. 2.1 hours. label Aug 22, 2023
@pdurbin
Copy link
Member

pdurbin commented Aug 23, 2023

As discussed at standup, I just kicked off a Jenkins run: https://jenkins.dataverse.org/job/IQSS-Dataverse-Develop-PR/job/PR-9796/12/

It should pass now that Jenkins has been updated to Java 17.

@kcondon kcondon merged commit 497c578 into develop Aug 23, 2023
18 checks passed
@poikilotherm
Copy link
Contributor Author

Woo-hoo! As always, thanks y'all for taking the time and getting it merged! Much appreciated!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Code Infrastructure formerly "Feature: Code Infrastructure" Feature: Developer Guide Feature: Performance & Stability Size: 3 A percentage of a sprint. 2.1 hours.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Payara 6: migrate all test cases to use JUnit 5
4 participants