-
Notifications
You must be signed in to change notification settings - Fork 821
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: split test script into test/test:coverage #3633
chore: split test script into test/test:coverage #3633
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #3633 +/- ##
==========================================
- Coverage 93.63% 92.34% -1.30%
==========================================
Files 265 160 -105
Lines 7417 3773 -3644
Branches 1511 765 -746
==========================================
- Hits 6945 3484 -3461
+ Misses 472 289 -183 |
@@ -24,7 +24,8 @@ | |||
"lint:fix": "eslint . --ext .ts --fix", | |||
"lint": "eslint . --ext .ts", | |||
"test:browser": "nyc karma start --single-run", | |||
"test": "nyc ts-mocha -p tsconfig.json 'test/**/*.test.ts'", | |||
"test": "ts-mocha -p tsconfig.json 'test/**/*.test.ts'", | |||
"test:coverage": "nyc npm run 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.
Personally, I "like" having the test coverage when compiling locally as a guide to what I'm missing....
eg. My preference would be to flip these around
test
=> full test run (with coverage)test:no-coverage
=> just run the tests
But I may just be a bit weird 🤷♂️
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.
Actually, I may be the weird one having different workflow than most, as I'm running JetBrains WebStorm as an IDE. It may make sense to flip it around. 🙂
pinging @open-telemetry/javascript-approvers, wdyt?
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 if we run the coverage by default when a single package is tested, but no coverage by default when all packages are tested? I doubt anyone is looking through coverage information when they test all 36 packages.
/package.json
{
"scripts": {
"test": "lerna run test:nocov",
"test:cov": "lerna run test"
}
}
somepackage/package.json
{
"scripts": {
"test": "<test command with coverage>",
"test:nocov": "<test command without coverage"
}
}
I investigated a bit further, and have come up with an alternative that (I think) tackles the cause of the excessive memory use instead and enables us to keep the scripts as-is. 🙂 |
Which problem is this PR solving?
Tests in windows are running out of heap space while running the
@opentelemetry/instrumentation-http
tests. On Linux slightly less memory is used, thus preventing the crash. As it seems likenyc
is the culprit, and coverage is not reported in Windows tests in CI, this PR splits the node test script into two:test
which now does not runnyc
test:coverage
which does runnyc
Workflows have been adjusted to run
test:coverage
when needed. We may have to increase--max-old-space-size
for the tests collecting coverage in the future if this also becomes a problem on Linux. This change also has the added benefit of reducing overall memory usage while running tests and speeding up thetest
script in cases where collecting coverage is not needed.Fixes #3628
Short description of the changes
Type of change
How Has This Been Tested?
Checklist: