Implement PR branch workflow#15
Merged
nicolo-ribaudo merged 10 commits intobabel:masterfrom Oct 20, 2019
Merged
Conversation
lib/compare-results/index.js
Outdated
| const prArtifactFilePath = path.resolve(process.cwd(), prArtifactFileArg); | ||
|
|
||
| const masterTests = await parseTestResults(masterArtifactFilePath); | ||
| const prTests = await parseTestResults(prArtifactFilePath); |
Member
There was a problem hiding this comment.
Can we to this in parallel?
const [masterTests, prTests] = await Promise.all([
parseTestResults(masterArtifactFilePath),
parseTestResults(prArtifactFilePath),
]);
Collaborator
Author
There was a problem hiding this comment.
I always forget to do this
lib/compare-results/index.js
Outdated
| function parseTestResults(filePath) { | ||
| return new Promise((resolve) => { | ||
| _(fs.createReadStream(filePath).pipe(parser.stream())).toArray(results => resolve(results.map(buffer => JSON.parse(buffer.toString())))); | ||
| }); |
Member
There was a problem hiding this comment.
Can this be rewritten as follows, to process results as they come from the stream rather than waiting?
return _(fs.createReadStream(filePath).pipe(parser.stream()))
.map(buffer => JSON.parse(buffer.toString()))
.toPromise();
Collaborator
Author
There was a problem hiding this comment.
This will produce the same net result? Promise of Array?
lib/compare-results/index.js
Outdated
| for (let i = 0; i < masterTests.length; i++) { | ||
| const prTest = prTests[i]; | ||
| const masterTest = masterTests[i]; | ||
| if (prTest.title !== masterTest.title) { |
Member
There was a problem hiding this comment.
Are these guaranteed to always be in the same order? Or it could differ because the time needed to run each test is non-deterministic?
Member
There was a problem hiding this comment.
If you have tried running a bunch of tests a few times and it works, it's ok.
Collaborator
Author
There was a problem hiding this comment.
This I am confident it comes in sorted order.
|
|
||
| async function findTest262Artifact(buildNums) { | ||
| for (buildNum of buildNums) { | ||
| const buildArtfifacts = await getJSONData(`${CIRCLECI_BABEL_API}/${buildNum}/artifacts`); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary of changes