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

Plugin is not compatible with junit5 junit.jupiter.execution.parallel.enabled true #73

Open
tyge68 opened this issue Dec 18, 2022 · 1 comment · May be fixed by #91
Open

Plugin is not compatible with junit5 junit.jupiter.execution.parallel.enabled true #73

tyge68 opened this issue Dec 18, 2022 · 1 comment · May be fixed by #91

Comments

@tyge68
Copy link
Contributor

tyge68 commented Dec 18, 2022

If your project uses a junit-platform.properties which enable parallel execution, PIT will compute wrong coverage.

As a solution this plugin should disable parallel mode from junit via junit.jupiter.execution.parallel.enabled property.

I suppose in the JUnit5TestPluginFactory createTestFrameworkConfiguration could be a good place to set it (at least it worked for me)

    public Configuration createTestFrameworkConfiguration(TestGroupConfig config, 
        ClassByteArraySource source, 
        Collection<String> excludedRunners,
        Collection<String> includedTestMethods) {
        System.setProperty("junit.jupiter.execution.parallel.enabled", "false"); <--- enforce to disable parallel mode
        return new JUnit5Configuration(config, includedTestMethods);
    }
tyge68 added a commit to tyge68/pitest-junit5-plugin that referenced this issue Dec 18, 2022
hcoles added a commit that referenced this issue Jan 3, 2023
#73 Force to disable junit5 parallel mode as PIT is not compatible wi…
Vampire added a commit to Vampire/pitest-junit5-plugin that referenced this issue May 12, 2023
This generically fixes hcoles/pitest#760 and pitest#73 for all platform engines,
removing the Jupiter specific work-around from pitest#74 and serializing test execution
during coverage calculation using locks. This way the tests can also properly run
in parallel later on during mutant hunting.
@Vampire Vampire linked a pull request May 12, 2023 that will close this issue
@Vampire
Copy link
Contributor

Vampire commented May 12, 2023

While #74 already worked-around this specifically for Jupiter engine, #91 provides a generic fix that should work with all test engines and was also tested with Spock. So latest when #91 gets merged, this issue can be closed.

Vampire added a commit to Vampire/pitest-junit5-plugin that referenced this issue May 13, 2023
This generically fixes hcoles/pitest#760 and pitest#73 for all platform engines,
removing the Jupiter specific work-around from pitest#74 and serializing test execution
during coverage calculation using locks. This way the tests can also properly run
in parallel later on during mutant hunting.
Vampire added a commit to Vampire/pitest-junit5-plugin that referenced this issue May 15, 2023
This generically fixes hcoles/pitest#760 and pitest#73 for all platform engines,
removing the Jupiter specific work-around from pitest#74 and serializing test execution
during coverage calculation using locks. This way the tests can also properly run
in parallel later on during mutant hunting.
Vampire added a commit to Vampire/pitest-junit5-plugin that referenced this issue May 15, 2023
This generically fixes hcoles/pitest#760 and pitest#73 for all platform engines,
removing the Jupiter specific work-around from pitest#74 and serializing test execution
during coverage calculation using locks. This way the tests can also properly run
in parallel later on during mutant hunting.
Vampire added a commit to Vampire/pitest-junit5-plugin that referenced this issue May 19, 2023
This generically fixes hcoles/pitest#760 and pitest#73 for all platform engines,
removing the Jupiter specific work-around from pitest#74 and serializing test execution
during coverage calculation using locks. This way the tests can also properly run
in parallel later on during mutant hunting.
Vampire added a commit to Vampire/pitest-junit5-plugin that referenced this issue May 19, 2023
This generically fixes hcoles/pitest#760 and pitest#73 for all platform engines,
removing the Jupiter specific work-around from pitest#74 and serializing test execution
during coverage calculation using locks. This way the tests can also properly run
in parallel later on during mutant hunting.
Vampire added a commit to Vampire/pitest-junit5-plugin that referenced this issue May 19, 2023
This generically fixes hcoles/pitest#760 and pitest#73 for all platform engines,
removing the Jupiter specific work-around from pitest#74 and serializing test execution
during coverage calculation using locks. This way the tests can also properly run
in parallel later on during mutant hunting.
Vampire added a commit to Vampire/pitest-junit5-plugin that referenced this issue Jun 9, 2023
This generically fixes hcoles/pitest#760 and pitest#73 for all platform engines,
removing the Jupiter specific work-around from pitest#74 and serializing test execution
during coverage calculation using locks. This way the tests can also properly run
in parallel later on during mutant hunting.
Vampire added a commit to Vampire/pitest-junit5-plugin that referenced this issue Jun 23, 2023
This generically fixes hcoles/pitest#760 and pitest#73 for all platform engines,
removing the Jupiter specific work-around from pitest#74 and serializing test execution
during coverage calculation using locks. This way the tests can also properly run
in parallel later on during mutant hunting.
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 a pull request may close this issue.

2 participants