Class Test
java.lang.Object
hudson.tasks.BuildStepCompatibilityLayer
hudson.tasks.Builder
io.jenkins.plugins.dotnet.commands.Command
io.jenkins.plugins.dotnet.commands.msbuild.MSBuildCommand
io.jenkins.plugins.dotnet.commands.msbuild.Test
- All Implemented Interfaces:
ExtensionPoint,Describable<Builder>,BuildStep,SimpleBuildStep
A build step to run "
dotnet test", running unit tests for a project, using its configured runner.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classA descriptor for "dotnet test" build steps.Nested classes/interfaces inherited from interface hudson.tasks.BuildStep
BuildStep.PublisherListNested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudsonNested classes/interfaces inherited from interface jenkins.tasks.SimpleBuildStep
SimpleBuildStep.LastBuildAction, SimpleBuildStep.LastBuildActionFactory -
Field Summary
Fields inherited from class io.jenkins.plugins.dotnet.commands.msbuild.MSBuildCommand
configuration, nologo, options, outputDirectory, project, properties, verbosityFields inherited from class io.jenkins.plugins.dotnet.commands.Command
sdk, showSdkInfo, shutDownBuildServers, unstableIfErrors, unstableIfWarnings, workDirectoryFields inherited from interface hudson.tasks.BuildStep
BUILDERS, PUBLISHERS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidAdds command line arguments for this "dotnet test" invocation.Gets the type of dump to collect when the test host terminates unexpectedly.Gets the type of dump to collect when a test times out.Gets the timeout (in milliseconds) to use for hang detection.Gets the data collector to use.getDiag()Gets the path to the diagnostics file to use.Gets the filter expression to use.Gets the target framework moniker to use.Gets the logger to use.Gets the directory to store test results in.Gets the inline run settings to use.Gets the inline run settings to use.Gets the runtime identifier to use.Gets the.runsettingsfile to use.Gets the path to search for test adapters.booleanisBlame()Determines whether tests should be run in blame mode, to diagnose test host crashes.booleanDetermines whether crash dumps should be collected in blame mode.booleanDetermines whether crash dumps should be collected in blame mode even for expected test host termination.booleanDetermines whether test timeouts should result in termination.booleanDetermines whether discovered tests should be listed.booleanDetermines whether a build should be performed before running tests.booleanDetermines whether an implicit restore should be executed as part of this command.voidsetBlame(boolean blame) Determines whether tests should be run in blame mode, to diagnose test host crashes.voidsetBlameCrash(boolean blameCrash) Determines whether crash dumps should be collected in blame mode.voidsetBlameCrashCollectAlways(boolean blameCrashCollectAlways) Determines whether crash dumps should be collected in blame mode even for expected test host termination.voidsetBlameCrashDumpType(String blameCrashDumpType) Sets the type of dump to collect when the test host terminates unexpectedly.voidsetBlameHang(boolean blameHang) Determines whether test timeouts should result in termination.voidsetBlameHangDumpType(String blameHangDumpType) Sets the type of dump to collect when a test times out.voidsetBlameHangTimeout(Integer blameHangTimeout) Sets the timeout (in milliseconds) to use for hang detection.voidsetCollect(String collect) Sets the data collector to use.voidSets the path to the diagnostics file to use.voidSets the filter expression to use.voidsetFramework(String framework) Sets the target framework moniker to use.voidsetListTests(boolean listTests) Determines whether discovered tests should be listed.voidSets the logger to use.voidsetNoBuild(boolean noBuild) Determines whether a build should be performed before running tests.voidsetNoRestore(boolean noRestore) Determines whether an implicit restore should be executed as part of this command.voidsetResultsDirectory(String resultsDirectory) Sets the directory to store test results in.voidsetRunSettings(Map<String, String> runSettings) Sets the inline run settings to use.voidsetRunSettingsString(String runSettings) Sets the inline run settings to use.voidsetRuntime(String runtime) Sets the runtime identifier to use.voidsetSettings(String settings) Sets the.runsettingsfile to use.voidsetTestAdapterPath(String testAdapterPath) Sets the path to search for test adapters.Methods inherited from class io.jenkins.plugins.dotnet.commands.msbuild.MSBuildCommand
getConfiguration, getOption, getOptions, getOptionsString, getOutputDirectory, getProject, getProperties, getPropertiesString, getVerbosity, isNologo, isShutDownBuildServers, isUnstableIfErrors, isUnstableIfWarnings, setConfiguration, setNologo, setOption, setOptions, setOptionsString, setOutputDirectory, setProject, setProperties, setPropertiesString, setShutDownBuildServers, setUnstableIfErrors, setUnstableIfWarnings, setVerbosityMethods inherited from class io.jenkins.plugins.dotnet.commands.Command
getCharset, getDescriptor, getSdk, getSdkDescriptor, getWorkDirectory, isContinueOnError, isShowSdkInfo, isSpecificSdkVersion, perform, setCharset, setContinueOnError, setSdk, setShowSdkInfo, setSpecificSdkVersion, setWorkDirectoryMethods inherited from class hudson.tasks.Builder
all, getRequiredMonitorService, prebuildMethods inherited from class hudson.tasks.BuildStepCompatibilityLayer
getProjectAction, getProjectAction, getProjectActions, perform, perform, prebuildMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface hudson.tasks.BuildStep
getProjectAction, getProjectActions, getRequiredMonitorService, perform, prebuildMethods inherited from interface jenkins.tasks.SimpleBuildStep
perform, perform, requiresWorkspace
-
Constructor Details
-
Test
@DataBoundConstructor public Test()Creates a new "dotnet test" build step.
-
-
Method Details
-
addCommandLineArguments
Adds command line arguments for this "dotnet test" invocation.This adds:
- Any arguments added by
MSBuildCommand.addCommandLineArguments(DotNetArguments). -f:xxx, if a target framework moniker has been specified viasetFramework(String).-r:xxx, if a runtime identifier has been specified viasetRuntime(String).--blame, if requested viasetBlame(boolean).--blame-crash, if requested viasetBlameCrash(boolean).--blame-crash-collect-always, if requested viasetBlameCrashCollectAlways(boolean).--blame-crash-dump-type xxx, if requested viasetBlameCrashDumpType(String).--blame-hang, if requested viasetBlameHang(boolean).--blame-hang-dump-type xxx, if requested viasetBlameHangDumpType(String).--blame-hang-timeout nnn, if requested viasetBlameHangTimeout(Integer).--collect xxx, if a data collector has been specified viasetCollect(String).--diag xxx, if a diagnostics file has been specified viasetDiag(String).--filter xxx, if a filter expression has been specified viasetFilter(String).--list-tests, if requested viasetListTests(boolean).--logger xxx, if a logger has been specified viasetLogger(String).--no-build, if requested viasetNoBuild(boolean).--no-restore, if requested viasetNoRestore(boolean).--results-directory xxx, if a results directory has been specified viasetResultsDirectory(String).--settings xxx, if a.runsettingsfile has been specified viasetSettings(String).--test-adapter-path xxx, if a test adapter path has been specified viasetTestAdapterPath(String).-
-- name=value [name=value], for all settings specified viasetRunSettings(Map)orsetRunSettingsString(String).
- Overrides:
addCommandLineArgumentsin classMSBuildCommand- Parameters:
args- The current set of arguments.
- Any arguments added by
-
isBlame
public boolean isBlame()Determines whether tests should be run in blame mode, to diagnose test host crashes.- Returns:
truewhen tests are run in blame mode;falseotherwise.
-
setBlame
@DataBoundSetter public void setBlame(boolean blame) Determines whether tests should be run in blame mode, to diagnose test host crashes.- Parameters:
blame-trueto run tests in blame mode;falseotherwise.
-
isBlameCrash
public boolean isBlameCrash()Determines whether crash dumps should be collected in blame mode.- Returns:
truewhen crash dumps are collected;falseotherwise.
-
setBlameCrash
@DataBoundSetter public void setBlameCrash(boolean blameCrash) Determines whether crash dumps should be collected in blame mode.- Parameters:
blameCrash-trueto collect crash dumps;falseotherwise.
-
isBlameCrashCollectAlways
public boolean isBlameCrashCollectAlways()Determines whether crash dumps should be collected in blame mode even for expected test host termination.- Returns:
truewhen crash dumps are collected even for expected test host termination;falseotherwise.
-
setBlameCrashCollectAlways
@DataBoundSetter public void setBlameCrashCollectAlways(boolean blameCrashCollectAlways) Determines whether crash dumps should be collected in blame mode even for expected test host termination.- Parameters:
blameCrashCollectAlways-trueto collect crash dumps even for expected test host termination;falseotherwise.
-
getBlameCrashDumpType
Gets the type of dump to collect when the test host terminates unexpectedly.- Returns:
- The type of dump to collect when the test host terminates unexpectedly.
-
setBlameCrashDumpType
Sets the type of dump to collect when the test host terminates unexpectedly.- Parameters:
blameCrashDumpType- The type of dump to collect when the test host terminates unexpectedly.
-
isBlameHang
public boolean isBlameHang()Determines whether test timeouts should result in termination.- Returns:
truewhen test timeouts result in termination;falseotherwise.
-
setBlameHang
@DataBoundSetter public void setBlameHang(boolean blameHang) Determines whether test timeouts should result in termination.- Parameters:
blameHang-trueto terminate execution when a test times out;falseotherwise.
-
getBlameHangDumpType
Gets the type of dump to collect when a test times out.- Returns:
- The type of dump to collect when a test times out.
-
setBlameHangDumpType
Sets the type of dump to collect when a test times out.- Parameters:
blameHangDumpType- The type of dump to collect when a test times out.
-
getBlameHangTimeout
Gets the timeout (in milliseconds) to use for hang detection.- Returns:
- The timeout (in milliseconds) to use for hang detection.
-
setBlameHangTimeout
Sets the timeout (in milliseconds) to use for hang detection.- Parameters:
blameHangTimeout- The timeout (in milliseconds) to use for hang detection.
-
getCollect
Gets the data collector to use.- Returns:
- The data collector to use.
-
setCollect
Sets the data collector to use.- Parameters:
collect- The data collector to use.
-
getDiag
Gets the path to the diagnostics file to use.- Returns:
- The path to the diagnostics file to use.
-
setDiag
Sets the path to the diagnostics file to use.- Parameters:
diag- The path to the diagnostics file to use.
-
getFilter
Gets the filter expression to use.- Returns:
- The filter expression to use.
-
setFilter
Sets the filter expression to use.- Parameters:
filter- The filter expression to use.
-
getFramework
Gets the target framework moniker to use.- Returns:
- The target framework moniker to use.
-
setFramework
Sets the target framework moniker to use.- Parameters:
framework- The target framework moniker to use.
-
isListTests
public boolean isListTests()Determines whether discovered tests should be listed.- Returns:
truewhen discovered tests are listed;falseotherwise.
-
setListTests
@DataBoundSetter public void setListTests(boolean listTests) Determines whether discovered tests should be listed.- Parameters:
listTests-trueto list discovered tests;falseotherwise.
-
getLogger
Gets the logger to use.- Returns:
- The logger to use.
-
setLogger
Sets the logger to use.- Parameters:
logger- The logger to use.
-
isNoBuild
public boolean isNoBuild()Determines whether a build should be performed before running tests.- Returns:
truewhen neither a restore nor a build will be performed before running tests;falseotherwise.
-
setNoBuild
@DataBoundSetter public void setNoBuild(boolean noBuild) Determines whether a build should be performed before running tests.- Parameters:
noBuild-trueto perform neither a restore nor a build before running tests;falseotherwise.
-
isNoRestore
public boolean isNoRestore()Determines whether an implicit restore should be executed as part of this command.- Returns:
truewhen the implicit restore is disabled;falseotherwise.
-
setNoRestore
@DataBoundSetter public void setNoRestore(boolean noRestore) Determines whether an implicit restore should be executed as part of this command.- Parameters:
noRestore-trueto disable the implicit restore;falseotherwise.
-
getResultsDirectory
Gets the directory to store test results in.- Returns:
- The directory to store test results in.
-
setResultsDirectory
Sets the directory to store test results in.- Parameters:
resultsDirectory- The directory to store test results in.
-
getRunSettings
Gets the inline run settings to use.- Returns:
- The inline run settings to use.
- Throws:
IOException- When there is a problem loading the run settings into a JavaPropertiesobject.
-
setRunSettings
@DataBoundSetter public void setRunSettings(@CheckForNull Map<String, String> runSettings) throws IOExceptionSets the inline run settings to use.- Parameters:
runSettings- The inline run settings to use.- Throws:
IOException- When there is a problem using aPropertiesobject to generate a string form for the map.
-
getRunSettingsString
Gets the inline run settings to use.- Returns:
- The inline run settings to use.
-
setRunSettingsString
Sets the inline run settings to use.- Parameters:
runSettings- The inline run settings to use.
-
getRuntime
Gets the runtime identifier to use.- Returns:
- The runtime identifier to use.
-
setRuntime
Sets the runtime identifier to use.- Parameters:
runtime- The runtime identifier to use.
-
getSettings
Gets the.runsettingsfile to use.- Returns:
- The
.runsettingsfile to use.
-
setSettings
Sets the.runsettingsfile to use.- Parameters:
settings- The.runsettingsfile to use.
-
getTestAdapterPath
Gets the path to search for test adapters.- Returns:
- The path to search for test adapters.
-
setTestAdapterPath
Sets the path to search for test adapters.- Parameters:
testAdapterPath- The path to search for test adapters.
-