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
Nice GQL tests config #854
Nice GQL tests config #854
Conversation
packages/core-graphql/package.json
Outdated
@@ -9,7 +9,7 @@ | |||
"main": "lib/index.js", | |||
"scripts": { | |||
"build:docs": "../../node_modules/.bin/jsdoc -c jsdoc.json", | |||
"test": "cross-env ARK_ENV=test jest --runInBand --detectOpenHandles", | |||
"test": "cross-env ARK_ENV=test jest --forceExit --runInBand --detectOpenHandles", |
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.
detectOpenHandles
replaces forceExit
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.
Thanks
Ok, sorry I'll read some jest, I'll remove detectOpenHandles too |
Also please use |
packages/core-graphql/package.json
Outdated
@@ -9,7 +9,7 @@ | |||
"main": "lib/index.js", | |||
"scripts": { | |||
"build:docs": "../../node_modules/.bin/jsdoc -c jsdoc.json", | |||
"test": "cross-env ARK_ENV=test jest --forceExit --runInBand --detectOpenHandles", | |||
"test": "cross-env ARK_ENV=test jest --runInBand --forceExit", |
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.
This is still wrong, forceExit
is replaced by detectOpenHandles
.
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 do you suggest?
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.
As I said, use --detectOpenHandles
instead of --forceExit
.
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.
works locally now with proper plugin management (doesnt hang with detectopenhandles
)
Codecov Report
@@ Coverage Diff @@
## master #854 +/- ##
==========================================
- Coverage 43.96% 43.94% -0.02%
==========================================
Files 426 426
Lines 7033 7033
Branches 894 894
==========================================
- Hits 3092 3091 -1
- Misses 3398 3399 +1
Partials 543 543
Continue to review full report at Codecov.
|
Proposed changes
Goal was to optimize the tests to remove unrelated plugins, the required ones are Logger, Logger-Winston and I've found it easier to set a local variable with the require('../lib').register(container, options) as the graphql plugin rather than include it into the config/plugins.js copied from core/config/testnet/* (I was getting undefined issues cause I suck at async) -- now tests pass in a few seconds.
There's an issue with tests running indefinitely if you don't use forceExit which I think the core-container causes (can't see why most plugins would return the same error without --detectOpenHandles and no --forceExit) so I've changed the package.json file to use both and --runInBand (don't know what --rIB does, saw it in some other plugins, thought it was "good").
Tried to remove as much redundancy and will be working on this further.
Types of changes
Checklist
In line with #816