Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Read Webpack stats file as stream to support very large projects #624
Read Webpack stats file as stream to support very large projects #624
Changes from 1 commit
44e3097
60eb472
3eb981d
de899d6
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added this check because I found that in the
upload.test.ts
test for traced files, it was erroring out because the file path does not return an existing file.I attempted to mock the file path but because we mock
fs-extra
it overrides all my mock tests and cannot find the file.The logic check ensures that we don't error out on a stats file with a directory that we cannot process.
However, once the trace or upload reaches the point where it's processing the stats file, we have already checked for a file path and that the file exists so we should be able to reasonably assume that the file exists and this is probably an indicator that the test needs to be refactored.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is strange is that when you include a combination of the
sourceDir
andstatsPath
the upload process builds a path that would most likely not exist in production.This is the path:
static/static/preview-stats.json
This is the existing test so I'm hesitant to change it but that file path does not seem like something that would ever exist in a real project.
So is the test incorrect, is the path join incorrect, or is this expected?
@ghengeveld @tmeasday
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ethriel3695 reading where
statsPath
comes from, it is relative to thesourceDir
:chromatic-cli/bin-src/tasks/upload.ts
Lines 77 to 117 in 0d1bd21
So I think that simply the test is wrong here.