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

Suite setup and setup failures are poorly handled #104

Open
jamesagardner opened this issue Sep 20, 2019 · 5 comments
Open

Suite setup and setup failures are poorly handled #104

jamesagardner opened this issue Sep 20, 2019 · 5 comments

Comments

@jamesagardner
Copy link
Contributor

jamesagardner commented Sep 20, 2019

Repurposing this issue to capture the following behavior:

If a suiteSetup.sjs file throws an error, the tests still run and can pass successfully. But the suiteSetup error is reported as a failed test, which doesn't make sense.

If a setup.sjs file throws an error, the tests still run but will always be marked as having failed - even if all their assertions succeeded.

@rjrudin
Copy link
Contributor

rjrudin commented Aug 9, 2023

Keeping this open - I'm not sure the solution is the right approach here, but this behavior is definitely buggy in that the failed suite setup is reported as a failed test, which doesn't make sense.

I do agree with the approach of "If the suite setup or setup fails, mark every test as having failed". But that could be considered a breaking change.

@rjrudin rjrudin changed the title Fail Test when Setup Fails Suite setup and setup failures are poorly handled Aug 9, 2023
@rjrudin
Copy link
Contributor

rjrudin commented Aug 9, 2023

Needs a little more research to identify exactly what all should be changed.

@rjrudin
Copy link
Contributor

rjrudin commented Aug 10, 2023

For 1.4.0, I'm thinking we should at a minimum make sure that failures in setup/suiteSetup are not counted as test failures, as that's misleading.

At least for consistency with things like JUnit / pytest, I think that a failure in either should result in each associated test counting as a failure. So:

  • If suiteSetup fails, don't invoke setup or any test, and treat each test as a failure.
  • If setup fails, don't invoke any test, and treat each test as a failure.

That seems like the most expected behavior to me.

I'll find out what's up with teardown modules as well, though I believe that generally in other frameworks - if an error occurs there, it does not cause the test to fail, but is logged.

@jamesagardner
Copy link
Contributor Author

jamesagardner commented Aug 10, 2023 via email

@dmcassel
Copy link
Collaborator

This direction sounds good. An added note: when a setup or test script fails, I'd like to see the stack trace in the UI like we do for a test case. That would make it a lot easier to resolve those problems.

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

3 participants