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

Don't start the server for the failure screenshot #43836

Merged
merged 1 commit into from Dec 15, 2021
Merged

Don't start the server for the failure screenshot #43836

merged 1 commit into from Dec 15, 2021

Conversation

donv
Copy link
Contributor

@donv donv commented Dec 11, 2021

Summary

When before_setup fails, for example with fixture errors, the failure is stored, setup is skipped, and take_failed_screenshot is called. Taking a screenshot triggers starting the server which will probably fail since fixtures are not properly loaded. This generates another failure and makes it harder to debug the fixture failure.

If the server was not already started, it makes no sense to take a screenshot since it is not relevant.

This commit skips taking a failure screenshot if no browser session has been started.

Other Information

Tested with Rails 6.1.4.1.

When `before_setup` fails, for example with fixture errors, the failure is stored, `setup` is skipped, and `take_failed_screenshot` is called.  Taking a screenshot triggers starting the server which will probably fail since fixtures are not properly loaded.  This generates another failure and makes it harder to debug the fixture failure.

If the server was not already started, it makes no sense to take a screenshot since it is not relevant.

This commit skips taking a failure screenshot if no browser session has been started.
@rails-bot rails-bot bot added the actionpack label Dec 11, 2021
@rafaelfranca rafaelfranca merged commit 8d982a7 into rails:main Dec 15, 2021
rafaelfranca added a commit that referenced this pull request Dec 15, 2021
Don't start the server for the failure screenshot
@donv donv deleted the patch-1 branch December 15, 2021 12:49
@donv
Copy link
Contributor Author

donv commented Dec 15, 2021

Thank you!

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

Successfully merging this pull request may close these issues.

None yet

2 participants