-
Notifications
You must be signed in to change notification settings - Fork 68
Add a way to run a test multiple times in a row #832
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
Comments
Using swift-testing you could do that. @Test(arguments: 0..<100)
func testMultiple(attempt: Int){
...
} |
I was thinking XCTest ;-) |
This seems quite niche. Is there any reason you can't wrap the test in a for loop that runs it multiple times. |
I could. I just found the Xcode feature to run a test repeatedly useful quite regularly because it also gives you a few things out of the box like logging which iteration it’s currently on. |
I've used this a few times in Xcode to diagnose flakey XCTests that have setUp/tearDown |
I didn't know this was an option in Xcode. |
Adds two new items to the context menu when you right click a test in the test explorer: - Run Multiple Times - Run Until Failure Selecting either of these promts with a text input where the user can input how many times they want to run the test(s). If the user selected Run Until Failure the tests will be run a maximum number of times, stopping at the first iteration that produces a failure. A current limitation in VS Code is if you have multiple tests selected in the Test Explorer (by shift or ctrl clicking them) only the first is passed to the command. Issue: swiftlang#832
Adds two new items to the context menu when you right click a test in the test explorer: - Run Multiple Times - Run Until Failure Selecting either of these promts with a text input where the user can input how many times they want to run the test(s). If the user selected Run Until Failure the tests will be run a maximum number of times, stopping at the first iteration that produces a failure. A current limitation in VS Code is if you have multiple tests selected in the Test Explorer (by shift or ctrl clicking them) only the first is passed to the command. Issue: swiftlang#832
Adds two new items to the context menu when you right click a test in the test explorer: - Run Multiple Times - Run Until Failure Selecting either of these promts with a text input where the user can input how many times they want to run the test(s). If the user selected Run Until Failure the tests will be run a maximum number of times, stopping at the first iteration that produces a failure. A current limitation in VS Code is if you have multiple tests selected in the Test Explorer (by shift or ctrl clicking them) only the first is passed to the command. Issue: swiftlang#832
Adds two new items to the context menu when you right click a test in the test explorer: - Run Multiple Times - Run Until Failure Selecting either of these promts with a text input where the user can input how many times they want to run the test(s). If the user selected Run Until Failure the tests will be run a maximum number of times, stopping at the first iteration that produces a failure. A current limitation in VS Code is if you have multiple tests selected in the Test Explorer (by shift or ctrl clicking them) only the first is passed to the command. Issue: #832
Verified |
Sometimes, when debugging a non-deterministic test, it is useful if you can run it multiple times in a row until it fails. It would be great if the Swift Extension offered that ability.
The text was updated successfully, but these errors were encountered: