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

[Feature] Add extractSummary to test infrastructure #672

Closed
evenstensberg opened this issue Nov 3, 2018 · 4 comments · Fixed by #683
Closed

[Feature] Add extractSummary to test infrastructure #672

evenstensberg opened this issue Nov 3, 2018 · 4 comments · Fixed by #683

Comments

@evenstensberg
Copy link
Member

Is your feature request related to a problem? Please describe.
It would be good to have more granular assertions using extractSummary similar to Jest

Describe the solution you'd like

Implement a utility to use extractSummary like this:

https://github.com/jbdemonte/jest/blob/9a90cfee8779ead918d1379a8a9fa33f25030d76/e2e/__tests__/test_name_pattern_skipped.test.js#L19

Describe alternatives you've considered
N/A

Additional context
N/A

@hemal7735
Copy link
Member

@evenstensberg what is the expectation here?

@evenstensberg
Copy link
Member Author

More granular test assertions on stdout, look at how jest did it and try to mimic the same behaviour

@hemal7735
Copy link
Member

So, the idea is to have only summary, trimming all stacktraces and individual test group results?

Test Suites: 2 failed, 23 passed, 25 total
Tests:       215 passed, 215 total
Snapshots:   94 passed, 94 total
Time:        126.065s, estimated 141s

What is the plan for integrating this with current infra? Are we going to have proxy which can accept params and then run tests, giving results based on params ?

@ematipico
Copy link
Contributor

@hemal7735 Let me give you some context

We recently re rewrote our test suite for the bin cases. Now it's faster, more maintainable and we also have some snapshot tests.
In these tests we basically run webpack in a sub process and we grab it's output and we remove some information that are not needed. Everything is done in this function

https://github.com/webpack/webpack-cli/blob/master/test/testUtils.js#L67-L77

As you can see it is a dumb function and sometimes we don't want to remove of the information that we need (like the hash). This was done poorly but contributors can enhance it.

Instead of stripping out the output before passing it to the test, we'd like to have some functions that we can call inside the single tests like:

  • extractSummary
  • extractHash
  • etc.

That will give us the outupt that we want and make sure that the snapshots pass (still) and enlarge the what we can assert.

ematipico pushed a commit that referenced this issue Nov 13, 2018
<!-- Thanks for submitting a pull request! Please provide enough information so that others can review your pull request. -->

**What kind of change does this PR introduce?**
<!-- E.g. a bugfix, feature, refactoring, build related change, etc… -->
This PR adds support for extracting hash after running test. [Jest](https://github.com/facebook/jest/blob/master/e2e/__tests__/test_name_pattern_skipped.test.js#L19) is already doing it. We are trying to mimic it here, for our needs.
**Did you add tests for your changes?** Yes

**If relevant, did you update the documentation?** NA

**Summary**

<!-- Explain the **motivation** for making this change. What existing problem does the pull request solve? -->
<!-- Try to link to an open issue for more information. -->
This PR tries to address the feature-request issue #672 
Closes #672 

**Does this PR introduce a breaking change?** No
<!-- If this PR introduces a breaking change, please describe the impact and a migration path for existing applications. -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants