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

PITest 1.7.4, JUnit5 Plugin 0.14, NullPointerException #985

Closed
mschnayd opened this issue Feb 9, 2022 · 4 comments
Closed

PITest 1.7.4, JUnit5 Plugin 0.14, NullPointerException #985

mschnayd opened this issue Feb 9, 2022 · 4 comments

Comments

@mschnayd
Copy link

mschnayd commented Feb 9, 2022

        <plugin>
            <groupId>org.pitest</groupId>
            <artifactId>pitest-maven</artifactId>
            <version>1.7.4</version>

            <dependencies>
                <dependency>
                    <groupId>org.pitest</groupId>
                    <artifactId>pitest-junit5-plugin</artifactId>
                    <version>0.14</version>
                </dependency>
            </dependencies>

            <configuration>
                <failWhenNoMutations>false</failWhenNoMutations>
                <timestampedReports>false</timestampedReports>
                <verbose>true</verbose>
                <timeoutFactor>5.0</timeoutFactor>
                <timeoutConstant>10000</timeoutConstant>
                <mutators>DEFAULTS</mutators>
                <!-- <targetClasses>
                    <param>com.nice.wfm.esp.saas.calculations*</param>
                    <param>com.nice.wfm.esp.saas.domain*</param>
                    <param>com.nice.wfm.esp.saas.editors*</param>
                    <param>com.nice.wfm.esp.saas.services*</param>
                    <param>com.nice.wfm.esp.saas.utils*</param>
                </targetClasses>
                <targetTests>
                    <param>com.nice.wfm.esp.saas.calculations</param>
                    <param>com.nice.wfm.esp.saas.domain</param>
                    <param>com.nice.wfm.esp.saas.editors</param>
                    <param>com.nice.wfm.esp.saas.services</param>
                    <param>com.nice.wfm.esp.saas.utils</param>
                </targetTests> -->
            </configuration>

        </plugin>

[ERROR] Failed to execute goal org.pitest:pitest-maven:1.7.4:mutationCoverage (default-cli) on project esp-saas-ms-plan-calculator-impl: Execution default-cli of goal org.pitest:pitest-maven:1.7.4:mutationCoverage failed.: NullPointerException -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.pitest:pitest-maven:1.7.4:mutationCoverage (default-cli) on project esp-saas-ms-plan-calculator-impl: Execution default-cli of goal org.pitest:pitest-maven:1.7.4:mutationCoverage failed.
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:972)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:196)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:566)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution default-cli of goal org.pitest:pitest-maven:1.7.4:mutationCoverage failed.
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:148)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:972)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:196)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:566)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: java.lang.NullPointerException
at org.pitest.maven.SurefireConfigConverter.lambda$filenameToClassFilter$0 (SurefireConfigConverter.java:61)
at org.pitest.functional.FCollection.mapTo (FCollection.java:35)
at org.pitest.functional.FCollection.map (FCollection.java:43)
at org.pitest.maven.SurefireConfigConverter.convertExcludes (SurefireConfigConverter.java:54)
at org.pitest.maven.SurefireConfigConverter.update (SurefireConfigConverter.java:25)
at org.pitest.maven.MojoToReportOptionsConverter.updateFromSurefire (MojoToReportOptionsConverter.java:211)
at org.pitest.maven.MojoToReportOptionsConverter.convert (MojoToReportOptionsConverter.java:83)
at org.pitest.maven.AbstractPitMojo.analyse (AbstractPitMojo.java:488)
at org.pitest.maven.AbstractPitMojo.execute (AbstractPitMojo.java:419)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:972)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:196)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:566)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)

@hcoles
Copy link
Owner

hcoles commented Feb 9, 2022

@mschnayd if you can provide a complete minimal project that reproduces the issue I can take a look.

@mschnayd
Copy link
Author

mschnayd commented Feb 9, 2022

Will try to put something together, wander if there is some surefire plugin version incompatibilities. At least place where Excption is encountered seems to indicate that.

@mschnayd
Copy link
Author

Hello again @hcoles,

I found the issue, which was in one of the parent POMs.

In my case this had to do with surefire plugin configuration including empty "excludes" as a workaround for
some Surefire concern with "inner test classes". That to me is a smell; however, as a very low priority thing, PITest could deal with this sort of configuration.

		<plugin>
			<!-- TODO(dev-x) - move this higher in the hierarchy -->
			<!-- note: without the excluded exclusion, inner test classes don't get 
				run by surefire -->
			<groupId>org.apache.maven.plugins</groupId>
			<artifactId>maven-surefire-plugin</artifactId>
		        <configuration>
				<excludes>
					<exclude/>
				</excludes>
			</configuration>
		</plugin>

hcoles pushed a commit that referenced this issue Feb 10, 2022
hcoles added a commit that referenced this issue Feb 10, 2022
@hcoles
Copy link
Owner

hcoles commented Feb 10, 2022

Fix is merged and will be in the next release.

Thanks for the report.

@hcoles hcoles closed this as completed Feb 10, 2022
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

No branches or pull requests

2 participants