-
Notifications
You must be signed in to change notification settings - Fork 50
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
Conversation
We require contributors/corporates @MCJOHN974 to read our Contributor License Agreement, please check the Individual CLA document/Corporate CLA document |
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.
That's super useful, left a few comments!
tools/run-tests-zkasm.js
Outdated
// 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; |
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.
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
.
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.
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) { |
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.
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
).
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.
Fixed here
We require contributors/corporates @MCJOHN974 to read our Contributor License Agreement, please check the Individual CLA document/Corporate CLA document |
@cla-bot check |
The cla-bot has been summoned, and re-checked this pull request! |
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.
😸
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.