-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
fix(test): Fix MongoDB integration tests on CI. #4810
Conversation
@@ -2,6 +2,9 @@ import { MongoMemoryServer } from 'mongodb-memory-server'; | |||
|
|||
import { assertSentryTransaction, getEnvelopeRequest, runServer } from '../../../../utils'; | |||
|
|||
// mongodb-memory-server may download a MongoDB binary in different Node versions |
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.
which node versions does this apply to?
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.
also - lol
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.
Thought it was just 16
, but it looks like it installs for 12
, 14
and 16
. Maybe it's better to move this out to pre-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.
Maybe it's better to move this out to pre-test.
I think thats a good idea
size-limit report 📦
|
|
||
const NODE_VERSION = parseSemver(process.versions.node); | ||
|
||
// Skipping on Node versions below 12 as `mongo-memory-server` |
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.
Need to finish this comment?
process.env.MONGO_URL = mongoServer.getUri(); | ||
}, 30000); | ||
// Skipping on Node versions below 12 as `mongo-memory-server` supports >= 12 | ||
const conditionalTest = NODE_VERSION.major && NODE_VERSION.major < 12 ? describe.skip : describe; |
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.
Let’s extract this into a helper, turn it into a function, and give the node version as the function argument. That way we can re-use this in other places.
conditionalTest
helper to skip tests depending on node versions.mongodb-memory-server
to version 7