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

chore: Migrating third-party parser tests to MakeJS #15431

Merged
merged 4 commits into from
Feb 18, 2023

Conversation

liuxingbaoyu
Copy link
Member

@liuxingbaoyu liuxingbaoyu commented Feb 16, 2023

Q                       A
License MIT

@@ -389,6 +389,73 @@ target["test-cov"] = function () {
);
};

function getParserTestsCommit(id) {
const content = readFileSync("./Makefile", "utf8");
const commit = content.match(new RegExp(`${id}_COMMIT = (\\w{40})`))[1];
Copy link
Member

Choose a reason for hiding this comment

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

Do we still need to store these commits in Makefile?

Copy link
Member Author

Choose a reason for hiding this comment

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

I tend to keep them so that we don't need to regenerate Makefile.js.

@babel-bot
Copy link
Collaborator

babel-bot commented Feb 16, 2023

Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/53935/

Comment on lines 440 to 456
const dir = "./build/flow";

shell.rm("-rf", dir);
shell.mkdir("-p", "build");

exec("git", [
"clone",
"--filter=blob:none",
"--sparse",
"--single-branch",
"--shallow-since=2021-05-01",
"https://github.com/facebook/flow.git",
dir,
]);

exec("git", ["sparse-checkout", "set", "src/parser/test/flow"], dir);
exec("git", ["checkout", "-q", getParserTestsCommit("FLOW")], dir);
Copy link
Member

Choose a reason for hiding this comment

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

Since the contents of these three commands is almost the same, could we extract them to a bootstrapParserTests(dir, repoURL, repoDir, commit) function?

Copy link
Member Author

Choose a reason for hiding this comment

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

I ignored the --shallow-since difference, it doesn't matter.

Makefile.source.mjs Outdated Show resolved Hide resolved
liuxingbaoyu and others added 2 commits February 17, 2023 09:03
Co-authored-by: Huáng Jùnliàng <jlhwung@gmail.com>
@nicolo-ribaudo nicolo-ribaudo merged commit 1004037 into babel:main Feb 18, 2023
@github-actions github-actions bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label May 21, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated A closed issue/PR that is archived due to age. Recommended to make a new issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants