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

feat(tests): add extractHash support in test-infra #683

Merged
merged 4 commits into from Nov 13, 2018

Conversation

hemal7735
Copy link
Member

@hemal7735 hemal7735 commented Nov 5, 2018

What kind of change does this PR introduce?

This PR adds support for extracting hash after running test. Jest 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

This PR tries to address the feature-request issue #672
Closes #672

Does this PR introduce a breaking change? No

Copy link
Contributor

@ematipico ematipico left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The extractSummary has to work on the output given by webpack, not jest.

I think there's been some confusion/misunderstanding about what this function should do.

The input of the function will be the stdout of a generic webpack output.
The function will extract information that we want.

I left some comments here #672 where I explain better the issue. Let me know if you have any questions

@hemal7735
Copy link
Member Author

👍 thanks, @ematipico for the clarification. I will revisit the problem here.

@hemal7735 hemal7735 changed the title feat(tests): add extractSummary support in test-infra feat(tests): add extractHash support in test-infra Nov 6, 2018
@hemal7735
Copy link
Member Author

I've added support for extractHash. I'm kinda confused regarding the return value of extractSummary functionality. Implementation purely depends upon what info we want to extract to validate.
Can you folks guide me here?

@ematipico
Copy link
Contributor

Yes, the original PR lacks of spec and I do apologize for that.

As extract summary we can do basically what that function I pointed out does.

We should strip out any timestamp, hash and information that is dynamic.

@hemal7735
Copy link
Member Author

We should strip out any timestamp, hash and information that is dynamic.

The existing removeTimeStrings function is already doing it. So do we want to make it parameterized so that it gets only the info we passed?
It would really help me if I can get some examples.

PR contains extractHash functionality.

@ematipico
Copy link
Contributor

Yes it already does that but it's not optimal, it can have parameters for instance.
Also, this function is applied to the source of the stdout and we do want to change that. We would want to use this function in the test itself, not before.

We can do this change later. In this PR we can do copy paste for now and doing another PR where we change all the tests.

@hemal7735
Copy link
Member Author

@ematipico any thoughts over extractHash functionality presented in the PR?

@ematipico
Copy link
Contributor

It would be nice to have some test on some mock string, to make sure it will work

@hemal7735
Copy link
Member Author

@ematipico added relevant tests

Copy link
Contributor

@ematipico ematipico left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Copy link
Member

@evenstensberg evenstensberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left some questions :)

@webpack-bot
Copy link

@hemal7735 Thanks for your update.

I labeled the Pull Request so reviewers will review it again.

@evenstensberg Please review the new changes.

@webpack-bot
Copy link

Thank you for your pull request! The most important CI builds succeeded, we’ll review the pull request soon.

Copy link
Member

@evenstensberg evenstensberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add JSDocs for the rest of the functions getting exported? looking good, a few things left!

@hemal7735
Copy link
Member Author

@evenstensberg I would love to do that, however not here, in the separate PR. 💯
I believe each PR should have single reversible logical change, which can define what is done in the PR. This was regarding adding extractHash support, so we should stick to it.
I can create an issue to track this.
Again, these are my thoughts. I would leave it up to the rest of the community. 😄

@ematipico
Copy link
Contributor

@evenstensberg: I think @hemal7735 he's right. That's not part of the scope of the PR. He did a great job here!

@evenstensberg
Copy link
Member

lgtm here

@ematipico ematipico merged commit 7295fe8 into webpack:master Nov 13, 2018
@hemal7735 hemal7735 deleted the feat/extractSummary-support branch January 19, 2019 14:46
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.

[Feature] Add extractSummary to test infrastructure
5 participants