Skip to content
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

Option to retry tests #1515

Closed
kpheng opened this issue Jan 27, 2015 · 5 comments
Closed

Option to retry tests #1515

kpheng opened this issue Jan 27, 2015 · 5 comments

Comments

@kpheng
Copy link

kpheng commented Jan 27, 2015

Tests should be consistent. They should either always fail or always pass. Unit tests are generally pretty consistent. With functional tests, however, several factors outside of our control may cause a test to fail. For example, my functional testing stack consists of MochaJS, WebDriverJS, and BrowserStack. The tests usually pass. However, in some cases, like when the network is congested or BrowserStack is slow in creating a VM session, a test may fail.

Since mocha doesn't support retries yet, I have to re-run test suites in their entirety. With each suite taking a non-trivial amount of time (between 5 to 15 minutes) to complete, this solution isn't ideal.

It would be nice if mocha supported retries. If a test in a suite fails, then I could retry that test instead of of re-running the entire suite.

@dasilvacontin
Copy link
Contributor

👍 from me. Re-running all tests is a waste.

@keithamus
Copy link
Contributor

Just an FYI @kpheng there are a couple of libraries out there that already to this. mocha-retry is one - which allows you to specify a number of retries per describe or it. Another is mocha-extra-shot which plugs directly into the runner which is a bit lower level.

@boneskull
Copy link
Contributor

if this use case is covered by 3p projects, it doesn't need to be in mocha core

@jmnsf
Copy link

jmnsf commented Oct 20, 2016

In case you end up here as I did: http://mochajs.org/#retry-tests

@boneskull
Copy link
Contributor

3p = third party

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants