Skip to content

Conversation

@onurtemizkan
Copy link
Collaborator

@onurtemizkan onurtemizkan commented Mar 28, 2022

  • Added conditionalTest helper to skip tests depending on node versions.
  • Downgraded mongodb-memory-server to version 7


import { assertSentryTransaction, getEnvelopeRequest, runServer } from '../../../../utils';

// mongodb-memory-server may download a MongoDB binary in different Node versions
Copy link
Member

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?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also - lol

Copy link
Collaborator Author

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.

Copy link
Member

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

@github-actions
Copy link
Contributor

github-actions bot commented Mar 28, 2022

size-limit report 📦

Path Size
@sentry/browser - ES5 CDN Bundle (gzipped + minified) 20.01 KB (+1.8% 🔺)
@sentry/browser - ES5 CDN Bundle (minified) 63.98 KB (+1.98% 🔺)
@sentry/browser - ES6 CDN Bundle (gzipped + minified) 18.66 KB (+1.81% 🔺)
@sentry/browser - ES6 CDN Bundle (minified) 57.39 KB (+2.01% 🔺)
@sentry/browser - Webpack (gzipped + minified) 23.14 KB (+1.5% 🔺)
@sentry/browser - Webpack (minified) 81.92 KB (+1.53% 🔺)
@sentry/react - Webpack (gzipped + minified) 23.18 KB (+1.51% 🔺)
@sentry/nextjs Client - Webpack (gzipped + minified) 48.12 KB (+0.72% 🔺)
@sentry/browser + @sentry/tracing - ES5 CDN Bundle (gzipped + minified) 25.91 KB (+1.44% 🔺)
@sentry/browser + @sentry/tracing - ES6 CDN Bundle (gzipped + minified) 24.29 KB (+1.5% 🔺)


const NODE_VERSION = parseSemver(process.versions.node);

// Skipping on Node versions below 12 as `mongo-memory-server`
Copy link
Member

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;
Copy link
Member

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.

@AbhiPrasad AbhiPrasad merged commit 0cf3014 into master Mar 29, 2022
@AbhiPrasad AbhiPrasad deleted the onur/fix-mongodb-tests-on-ci branch March 29, 2022 11:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants