Dotnet Test Step
A dotnet test step to run .NET CLI command
Example. Runs dotnet test
command for all the solution files in the checkout directory. Does not try to build the project, assumes this is already done by some previous step.
buildType {
// Other Build Type settings ...
steps {
// Other Build Steps ...
dotnetTest {
projects = "*.sln"
skipBuild = true
}
Content copied to clipboard }
}
Example. Runs dotnet test
for the MyProject.sln solution file. Collects code coverage with help of JetBrains DotCover for the specified assemblies.
buildType {
// Other Build Type settings ...
steps {
// Other Build Steps ...
dotnetTest {
projects = "MyProject.sln"
skipBuild = true
coverage = dotcover {
toolPath = "%teamcity.tool.JetBrains.dotCover.CommandLineTools.DEFAULT%"
assemblyFilters = "build/*.dll"
}
}
Content copied to clipboard }
}
Example. Runs dotnet test
for the specified test assemblies.
buildType {
// Other Build Type settings ...
steps {
// Other Build Steps ...
dotnetTest {
projects = "tests/*.dll"
excludedProjects = "tests/ExcludedTests.dll"
skipBuild = true
}
Content copied to clipboard }
}
See also
Types
Properties
Optional collection of build step execution conditions
Target configuration to test for.
Specifies which Docker image to use for running this build step. I.e. the build step will be run inside specified docker image, using 'docker run' wrapper.
Specifies which Docker image platform will be used to run this build step.
If enabled, "pull image" command will be run before docker run.
Additional docker run command arguments
Specify paths to excluded projects. Wildcards are supported.
Build step execution mode
Rerun failed tests until they pass or until the maximum number of attempts is reached.
Run tests that match the given expression.
Whether TeamCity should run tests in a single session
Build working directory for script, specify it if it is different from the checkout * directory.
Functions
Deletes all configured build step conditions
Configures build step conditions
Copies parameters of this object to the specified target
Validates this object and reports found errors to the provided consumer