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

Do not skip tests in run-tests-zkasm.js #306

Merged
merged 4 commits into from
Oct 9, 2023

Conversation

MCJOHN974
Copy link
Contributor

Currently, if you run run-tests-zkasm.js with directory as an input, and one of files in directory fails, it skips all next tests and determining in which file it was failed is not very obvious. In code in this PR all tests are runned anyway and it is easy to understand which test failed.

@cla-bot
Copy link

cla-bot bot commented Sep 25, 2023

We require contributors/corporates @MCJOHN974 to read our Contributor License Agreement, please check the Individual CLA document/Corporate CLA document

Copy link

@aborg-dev aborg-dev left a comment

Choose a reason for hiding this comment

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

That's super useful, left a few comments!

// Run all zkasm files
// eslint-disable-next-line no-restricted-syntax
console.log(chalk.yellow('--> Start running zkasm files'));
for (const file of files) {
if (file.includes('ignore'))
continue;
await runTest(file, cmPols);
if (await runTest(file, cmPols) == 1) {
exit_code = 1;

Choose a reason for hiding this comment

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

Given that we don't really care about the exact exit code and we don't use it below, maybe we can change the meaning of this variable to make the code easier to read. E.g. we can name it failed_test_count and report, in the end, the number of failed tests or we can just track a boolean value have_failed_test.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed here

// Run all zkasm files
// eslint-disable-next-line no-restricted-syntax
console.log(chalk.yellow('--> Start running zkasm files'));
for (const file of files) {
if (file.includes('ignore'))
continue;
await runTest(file, cmPols);
if (await runTest(file, cmPols) == 1) {

Choose a reason for hiding this comment

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

From this like, it's not really clear what "1" means. We can either document the function runTest to describe which values it returns or rename the function to make it more obvious (e.g. testPasses).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed here

@cla-bot
Copy link

cla-bot bot commented Sep 26, 2023

We require contributors/corporates @MCJOHN974 to read our Contributor License Agreement, please check the Individual CLA document/Corporate CLA document

@MCJOHN974 MCJOHN974 changed the base branch from main to develop September 26, 2023 13:01
@krlosMata
Copy link
Contributor

@cla-bot check

@cla-bot cla-bot bot added the cla-signed label Oct 2, 2023
@cla-bot
Copy link

cla-bot bot commented Oct 2, 2023

The cla-bot has been summoned, and re-checked this pull request!

Copy link
Contributor

@krlosMata krlosMata left a comment

Choose a reason for hiding this comment

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

😸

@krlosMata krlosMata merged commit a4e9c3a into 0xPolygonHermez:develop Oct 9, 2023
3 checks passed
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.

3 participants