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
[API-10] Improve unit tests #3873
Open
Yeregorix
wants to merge
19
commits into
SpongePowered:api-10
Choose a base branch
from
Yeregorix:api10/improve-tests
base: api-10
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gabizou
force-pushed
the
api-10
branch
2 times, most recently
from
January 16, 2024 13:39
5825843
to
1c4ba14
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Continuing from #3815.
This PR adds the ability to run JUnit 5 tests in a ModLauncher context where Sponge and a DedicatedServer is initialized (but not ticking). This is done using modlauncher-injector-junit the successor of LaunchWrapperTestSuite.
I also added JaCoCo so we can measure code coverage. This should help us improve the test suite in the future.
Some of the launch logic is shared between SpongeVanilla and Sponge.test. Sponge.test is depending on SpongeVanilla.launch and SpongeVanilla.applaunch-base
The only issues identified so far with this setup are:
@ParameterizedTest
cannot be executed in a ModLauncher context. However@TestFactory
is a wonderful alternative and is working perfectly.I have updated all tests in the
invalid/
directory.Some tests are failing and need fixes but this it out of the scope of this PR, so these tests are currently
@Disabled
. Anyone willing to fix the implementation to make pass these tests is welcome.