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

Capture stderr in e2e tests #5355

Closed
wants to merge 11 commits into from
Closed

Conversation

flotwig
Copy link
Contributor

@flotwig flotwig commented Oct 11, 2019

User facing changelog

N/A - not user facing

Additional details

This captures stderr from e2e tests in addition to stdout. Most specs don't produce any stderr, but this will allow us to keep track of unwanted stderr output in the future.

PR Tasks

  • Have tests been added/updated?

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Oct 11, 2019

Thanks for the contribution! Below are some guidelines Cypress uses when doing PR reviews.

  • Please write [WIP] in the title of your Pull Request if your PR is not ready for review - someone will review your PR as soon as the [WIP] is removed.
  • Please familiarize yourself with the PR Review Checklist and feel free to make updates on your PR based on these guidelines.

PR Review Checklist

If any of the following requirements can't be met, leave a comment in the review selecting 'Request changes', otherwise 'Approve'.

User Experience

  • The feature/bugfix is self-documenting from within the product.
  • The change provides the end user with a way to fix their problem (no dead ends).

Functionality

  • The code works and performs its intended function with the correct logic.
  • Performance has been factored in (for example, the code cleans up after itself to not cause memory leaks).
  • The code guards against edge cases and invalid input and has tests to cover it.

Maintainability

  • The code is readable (too many nested 'if's are a bad sign).
  • Names used for variables, methods, etc, clearly describe their function.
  • The code is easy to understood and there are relevant comments explaining.
  • New algorithms are documented in the code with link(s) to external docs (flowcharts, w3c, chrome, firefox).
  • There are comments containing link(s) to the addressed issue (in tests and code).

Quality

  • The change does not reimplement code.
  • There's not a module from the ecosystem that should be used instead.
  • There is no redundant or duplicate code.
  • There are no irrelevant comments left in the code.
  • Tests are testing the code’s intended functionality in the best way possible.

Internal

  • The original issue has been tagged with a release in ZenHub.

@brian-mann
Copy link
Member

This PR isn't necessary - all that's necessary is that we go through the CLI itself for e2e tests, which means we automatically get the logic from the CLI that does the filtering. This has been needed for a long time now - and with the advent of the --dev flag, it's made this possible for months.

Previously the CLI would always expect the raw built binary, but the --dev flag tells it to use the development non built binary. Several of our other npm commands use this flag.

The scripts/e2e file just needs to be updated to go through the CLI.

I'm closing but you can reopen if I'm missing something.

@brian-mann brian-mann closed this Oct 11, 2019
@flotwig
Copy link
Contributor Author

flotwig commented Oct 11, 2019

Even if the e2e test went through the CLI, it doesn't snapshot the stderr from the child process, only the stdout, which is the purpose of this PR. So I think this is still necessary.

I can try refactoring the e2e tests to go through the CLI so that I don't need to require that function directly. That would be a nice improvement for the robustness of the e2e tests as a whole as well.

@brian-mann
Copy link
Member

That's true - I'll reopen and we can rearchitect it.

@brian-mann brian-mann reopened this Oct 12, 2019
@flotwig
Copy link
Contributor Author

flotwig commented Oct 17, 2019

Been thinking about this, it probably makes more sense to have stderr interleaved with stdout in the snapshots, since it will help snapshot the visible output a user would get, and guarantee that the ordering of stderr vs. stdout does not change. Maybe stderr lines could get prefixed with stderr: or something to make the output clear.

@cypress
Copy link

cypress bot commented Nov 20, 2019



Test summary

3511 0 45 0


Run details

Project cypress
Status Passed
Commit 99ec5c7
Started Nov 20, 2019 10:40 PM
Ended Nov 20, 2019 10:44 PM
Duration 03:53 💡
OS Linux Debian - 9.8
Browser Multiple

View run in Cypress Dashboard ➡️


This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard

@flotwig flotwig force-pushed the issue-5269-e2e-snapshot-stderr branch from fd28ee7 to 99ec5c7 Compare November 20, 2019 22:35
@flotwig flotwig marked this pull request as draft April 20, 2020 15:13
@flotwig flotwig changed the title [WIP] Capture stderr in e2e tests Capture stderr in e2e tests Apr 20, 2020
@jennifer-shehane
Copy link
Member

Unfortunately we have to close this issue due to inactivity. Please comment if there is new information to provide concerning the original issue and we can reopen.

@flotwig flotwig deleted the issue-5269-e2e-snapshot-stderr branch January 24, 2022 18:19
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

Successfully merging this pull request may close these issues.

Snapshot stderr in e2e tests
3 participants