Skip to content
This repository has been archived by the owner on Jul 13, 2019. It is now read-only.

Mocha continue after failure #51

Closed
allen-tong opened this issue Dec 22, 2018 · 5 comments
Closed

Mocha continue after failure #51

allen-tong opened this issue Dec 22, 2018 · 5 comments

Comments

@allen-tong
Copy link
Collaborator

Is it just me, or does Mocha terminate completely once it fails a single test? This breaks the "run all diagnostics" functionality since it won't run any Amazon tests after failing any Google test. Mocha is supposed to run all tests and report numbers of passes and failures, right?

@allen-tong
Copy link
Collaborator Author

Attached screenshot of error, let me know if you also get this and/or know how to fix it!

image

@nmalkin
Copy link
Owner

nmalkin commented Dec 22, 2018

This is why:

(see --bail at https://mochajs.org/#usage)

This was the intended behavior because I assumed that, once an early test fails (e.g., you're logged out), the subsequent ones would fail too. You're totally right, though, that this assumption doesn't hold if we're trying to run both Amazon and Google tests.

I see the two easiest options as:

  1. Go ahead and allow subsequent tests, even if they'll probably fail
  2. Only allow you to run one of the test suites at a time
    • Then you'd have to refresh the page in-between. That's annoying, but not horrible, since most people will only be testing one or the other.
    • We could take this further and move the diagnostics to separate pages, so they don't interact at all.

@nmalkin
Copy link
Owner

nmalkin commented Dec 22, 2018

As a side note, the --bail flag on Jest behaves differently from Mocha: there it works across test suites, not individual tests. This threw me off for a bit.

@allen-tong
Copy link
Collaborator Author

Ahhh. Then I think we can just remove the "run all diagnostics" functionality and be done with it. Not sure if by having to refresh the page in-between you mean what was fixed in 252b668? You should be able to just click the appropriate button to run/rerun whichever test you want.

nmalkin added a commit that referenced this issue Dec 23, 2018
If both are run at the same time, they may interfere with each other
(as detailed in #51): the failure of one may block the other.

Instead, users have to explicitly start one or the other.
If they want to run both, they can just launch them sequentially.
@nmalkin
Copy link
Owner

nmalkin commented Dec 23, 2018

Ahhh. Then I think we can just remove the "run all diagnostics" functionality and be done with it.

Sounds good. Done in 8bc4704

Not sure if by having to refresh the page in-between you mean what was fixed in 252b668? You should be able to just click the appropriate button to run/rerun whichever test you want.

Cool! Yeah, I'm not sure exactly what I had in mind, but glad no further action is necessary. 😃

@nmalkin nmalkin closed this as completed Dec 23, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants