-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
test_runner: remove problematic uses of parseCommandLine() #54353
Conversation
This commit updates parseCommandLine() to use the names supported by run(). This removes some unnecessary renaming code, and allows node:test and run() to more easily share code.
This commit initializes the root harness object before the root test and passes the harness as an option to the root test constructor. This commit also attaches the global configuration to the harness. This will allow the parseCommandLine() call in test.js to be removed, as those values are now available via the root test.
The global configuration should already be known when createTestTree() is called. This commit updates that function to take the global configuration as an input.
Now that parseCommandLine() returns run() compatible arguments, it makes sense to return setupTestReporters() as the setup() argument to run(). This also removes another problematic use of parseCommandLine() in setupTestReporters().
This commit makes hook creation more consistent by always passing in a reference to the test that owns the hook. It also removes some unnecessary validation on internal API.
The lib/internal/test_runner/test.js should not use the parseCommandLine() function. This commit refactors the code to avoid doing so.
Review requested:
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #54353 +/- ##
==========================================
+ Coverage 87.09% 87.10% +0.01%
==========================================
Files 648 648
Lines 182213 182244 +31
Branches 34961 34958 -3
==========================================
+ Hits 158703 158751 +48
+ Misses 16794 16784 -10
+ Partials 6716 6709 -7
|
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.
lgtm
Landed in e020dd8...48d63c4 |
This commit updates parseCommandLine() to use the names supported by run(). This removes some unnecessary renaming code, and allows node:test and run() to more easily share code. PR-URL: #54353 Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
This commit initializes the root harness object before the root test and passes the harness as an option to the root test constructor. This commit also attaches the global configuration to the harness. This will allow the parseCommandLine() call in test.js to be removed, as those values are now available via the root test. PR-URL: #54353 Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
The global configuration should already be known when createTestTree() is called. This commit updates that function to take the global configuration as an input. PR-URL: #54353 Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
Now that parseCommandLine() returns run() compatible arguments, it makes sense to return setupTestReporters() as the setup() argument to run(). This also removes another problematic use of parseCommandLine() in setupTestReporters(). PR-URL: #54353 Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
This commit makes hook creation more consistent by always passing in a reference to the test that owns the hook. It also removes some unnecessary validation on internal API. PR-URL: #54353 Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
The lib/internal/test_runner/test.js should not use the parseCommandLine() function. This commit refactors the code to avoid doing so. PR-URL: #54353 Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
Nice 👍🏻 thanks for the effort |
This commit updates parseCommandLine() to use the names supported by run(). This removes some unnecessary renaming code, and allows node:test and run() to more easily share code. PR-URL: #54353 Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
This commit initializes the root harness object before the root test and passes the harness as an option to the root test constructor. This commit also attaches the global configuration to the harness. This will allow the parseCommandLine() call in test.js to be removed, as those values are now available via the root test. PR-URL: #54353 Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
The global configuration should already be known when createTestTree() is called. This commit updates that function to take the global configuration as an input. PR-URL: #54353 Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
Now that parseCommandLine() returns run() compatible arguments, it makes sense to return setupTestReporters() as the setup() argument to run(). This also removes another problematic use of parseCommandLine() in setupTestReporters(). PR-URL: #54353 Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
This commit makes hook creation more consistent by always passing in a reference to the test that owns the hook. It also removes some unnecessary validation on internal API. PR-URL: #54353 Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
The lib/internal/test_runner/test.js should not use the parseCommandLine() function. This commit refactors the code to avoid doing so. PR-URL: #54353 Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
This commit updates parseCommandLine() to use the names supported by run(). This removes some unnecessary renaming code, and allows node:test and run() to more easily share code. PR-URL: #54353 Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
This commit initializes the root harness object before the root test and passes the harness as an option to the root test constructor. This commit also attaches the global configuration to the harness. This will allow the parseCommandLine() call in test.js to be removed, as those values are now available via the root test. PR-URL: #54353 Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
The global configuration should already be known when createTestTree() is called. This commit updates that function to take the global configuration as an input. PR-URL: #54353 Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
Now that parseCommandLine() returns run() compatible arguments, it makes sense to return setupTestReporters() as the setup() argument to run(). This also removes another problematic use of parseCommandLine() in setupTestReporters(). PR-URL: #54353 Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
This commit makes hook creation more consistent by always passing in a reference to the test that owns the hook. It also removes some unnecessary validation on internal API. PR-URL: #54353 Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
The lib/internal/test_runner/test.js should not use the parseCommandLine() function. This commit refactors the code to avoid doing so. PR-URL: #54353 Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
This PR removes uses of
parseCommandLine()
throughout the test runner. This work is related to #53867, as it reduces the use of process global state in the test runner where it should not be used.test_runner: use
run()
argument names inparseCommandLine()
This commit updates
parseCommandLine()
to use the names supportedby
run()
. This removes some unnecessary renaming code, and allowsnode:test
andrun()
to more easily share code.test_runner: pass harness object as option to root test
This commit initializes the root harness object before the root
test and passes the harness as an option to the root test
constructor. This commit also attaches the global configuration
to the harness. This will allow the
parseCommandLine()
call intest.js
to be removed, as those values are now available viathe root test.
test_runner: pass global options to
createTestTree()
The global configuration should already be known when
createTestTree()
is called. This commit updates that functionto take the global configuration as an input.
test_runner: return
setup()
fromparseCommandLine()
Now that
parseCommandLine()
returnsrun()
compatible arguments,it makes sense to return
setupTestReporters()
as thesetup()
argument to
run()
. This also removes another problematic use ofparseCommandLine()
insetupTestReporters()
.test_runner: refactor hook creation
This commit makes hook creation more consistent by always
passing in a reference to the test that owns the hook. It also
removes some unnecessary validation on internal API.
test_runner: remove
parseCommandLine()
fromtest.js
The
lib/internal/test_runner/test.js
file should not use theparseCommandLine()
function. This commit refactors the code toavoid doing so.