Skip to content

ricardofslp/dotnet-test-rerun

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dotnet-test-rerun

Status

1 6 3 5

Description

Unfortunately, there isn't a way with plain dotnet test to automatically rerun failed tests.
This tool is wrapper for the dotnet test that automatically reruns any tests with the outcome "Failed" until they pass or a maximum number of attempts has been reached. This is useful, for cases where tests may fail intermittently due to external factors such as network connectivity, database availability, or race conditions.

📦 Installation

dotnet tool install --global dotnet-test-rerun

⌨️ Usage

test-rerun [somepathtodll] [OPTIONS]

▶️ Arguments

argument description
path Path to a test project .dll file.

▶️ Options

option description
--filter Run tests that match the given expression.
--settings, -s The run settings file to use when running tests.
--logger, -l Specifies a logger for test results. (default: trx)
--results-directory, -r The directory where the test results are going to be placed. If the specified directory doesn't exist, it's created.
--rerunMaxAttempts Maximum # of attempts. (default: 3)
--loglevel Log Level. (default: Verbose)
--no-build Do not build the project before testing. Implies --no-restore.
--no-restore Do not restore the project before building.*
--delay, -d Delay between test runs in seconds.
--blame Run the tests in blame mode.
--configuration, -c Defines the build configuration. The default for most projects is Debug, but you can override the build configuration settings in your project.
--verbosity, -v Sets the verbosity level of the command. Allowed values are quiet, minimal, normal, detailed, and diagnostic.
--deleteReports Delete the generated report files.
--collect Enables data collector for the test run. Example: --collect "Code Coverage" or --collect "XPlat Code Coverage"
--mergeCoverageFormat Output coverage format. Possible values: Coverage, Cobertura or Xml. It requires dotnet coverage tool to be installed.

Note: Sending /p: instructions to set property values is also allowed.

👤 Author & Contributors

👤 João Pereira

👥 Contributors

Contributors

🤝 Contributing

Contributions, issues and feature requests are welcome!
Feel free to check the issues page.

Show your support

Give a ⭐ if this project helped you!

📝 License

Copyright © 2023 João Pereira.
This tool is licensed under GNU General Public License v3.0. See the LICENSE file for details.

About

automatic rerun dotnet failed tests

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 99.0%
  • Shell 1.0%