You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am testing a workflow, so if one test step fails, the test should not proceed. For example, if the login fails, there is no point in adding items to the cart. I am using assertions from the 'require' package. It works fine for a handful of tests, but as the number of tests grows, parallel execution seems to be the only option. However, when we made these tests run in parallel, they failed at very basic checks.
I understand that in "require," if an assertion fails, we call the FailNow method, which stops execution. Ideally, it should only stop the test/goroutine that failed this assertion and not affect other running tests/goroutines.
When tests are run in parallel, it's crucial that a required assertion failing does not disrupt other ongoing runs.
Use case
I'm phasing out parallel runs and considering switching to a native test framework. We're thinking of using Testify, and I may create a PR if time allows.
The text was updated successfully, but these errors were encountered:
Description
I am testing a workflow, so if one test step fails, the test should not proceed. For example, if the login fails, there is no point in adding items to the cart. I am using assertions from the 'require' package. It works fine for a handful of tests, but as the number of tests grows, parallel execution seems to be the only option. However, when we made these tests run in parallel, they failed at very basic checks.
I understand that in "require," if an assertion fails, we call the FailNow method, which stops execution. Ideally, it should only stop the test/goroutine that failed this assertion and not affect other running tests/goroutines.
Here is basic code snippet with testify
https://go.dev/play/p/7a8mh9eVO6r
Without testify (Using native go testing framework)
https://go.dev/play/p/9NxHqKpmPam
Proposed solution
When tests are run in parallel, it's crucial that a required assertion failing does not disrupt other ongoing runs.
Use case
I'm phasing out parallel runs and considering switching to a native test framework. We're thinking of using Testify, and I may create a PR if time allows.
The text was updated successfully, but these errors were encountered: