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

[SUREFIRE-1876] Added support for skipping unit test execution not affecting integration test execution #331

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import java.util.List;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
import org.apache.maven.plugin.surefire.booterclient.ChecksumCalculator;
import org.apache.maven.plugins.annotations.LifecyclePhase;
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.Parameter;
Expand Down Expand Up @@ -53,6 +54,15 @@ public class SurefirePlugin
@Parameter( defaultValue = "${project.build.outputDirectory}" )
private File classesDirectory;

/**
* Set this to "true" to skip running unit tests, but still compile them. Its use is NOT RECOMMENDED, but
* quite convenient on occasion.
*
* @since 3.0.0-M6
*/
@Parameter( property = "skipUTs" )
private boolean skipUTs;

/**
* Set this to "true" to ignore a failure during testing. Its use is NOT RECOMMENDED, but quite convenient on
* occasion.
Expand Down Expand Up @@ -472,7 +482,7 @@ protected void handleSummary( RunResult summary, Exception firstForkException )
@Override
protected boolean isSkipExecution()
{
return isSkip() || isSkipTests() || isSkipExec();
return isSkip() || isSkipTests() || isSkipUTs() || isSkipExec();
}

@Override
Expand Down Expand Up @@ -520,6 +530,16 @@ public void setSkipTests( boolean skipTests )
this.skipTests = skipTests;
}

public boolean isSkipUTs()
{
return skipUTs;
}

public void setSkipUTs( boolean skipUTs )
{
this.skipUTs = skipUTs;
}

@Override
public boolean isSkipExec()
{
Expand Down Expand Up @@ -880,4 +900,10 @@ protected final ForkNodeFactory getForkNode()
{
return forkNode;
}

@Override
protected void addPluginSpecificChecksumItems( ChecksumCalculator checksum )
{
checksum.add( skipUTs );
}
}