-
Notifications
You must be signed in to change notification settings - Fork 3.8k
feat(test): Miscellaneous improvements to test_tasks.js
#6615
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
Conversation
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.
Slightly confused about the decision to make a Tester class. Otherwise generally LGTM, but want to understand that before approving.
@@ -32,48 +32,84 @@ const BOLD_GREEN = '\x1b[1;32m'; | |||
const BOLD_RED = '\x1b[1;31m'; | |||
const ANSI_RESET = '\x1b[0m'; | |||
|
|||
let failerCount = 0; | |||
class Tester { |
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's the advantage of encapsulating these in a class?
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.
Mainly just to remove the failerCount
global variable, and allow us to also count successes without adding a second global.
Modify runTestBlock so that it can run any async task, not just ones that return a Promise, by using the async-done package (part of Gulp, and already an indirect dependency) to detect task completion. Celebrate by renaming it to runTestTask.
- Create Tester class to encapsulate the runTestTask, and reportTestResult and runAll functions. - Remove the unnecessary id parameter from runTestTask (code was already using the .name of the task function object). - Remove --silent flag from npm scripts so as not to suppress syntax error in gulpfiles.
Have the test task invoke the buildAdvancedCompilationTest (via onlyBuildAdvancedCompilationTest, to skip already-run prerequisites) directly, rather than by running npm.
b8da89a
to
868cc74
Compare
There were merge conflicts, and it seems like I forgot a needed Just awaiting approval, assuming you think my justification for the |
The basics
npm run format
andnpm run lint
The details
Proposed Changes
runTestBlock
so that it can run any async task, not just ones that return aPromise
, by using theasync-done
package (part of Gulp, and already an indirect dependency) to detect task completion. Celebrate by renaming it to runTestTask.Tester
class to encapsulate therunTestTask
,reportTestResult
andrunAll
functions.--silent
flag from npm scripts so as not to suppress syntax error in gulpfiles.test
task invoke thebuildAdvancedCompilationTest
task (viaonlyBuildAdvancedCompilationTest
, to skip already-run prerequisites) directly, rather than by runningnpm
.Reason for Changes