typegoose / mongodb-memory-server

Manage & spin up mongodb server binaries with zero(or slight) configuration for tests.
https://typegoose.github.io/mongodb-memory-server/
MIT License
2.56k stars 185 forks source link

Invalid version reported for version strings ending in -latest #841

Closed DABH closed 8 months ago

DABH commented 8 months ago

Versions

package: mongo-memory-server(-core)

What is the Problem?

My CI pipeline refers to MongoDB versions like "v6.0-latest". This worked with mongodb-memory-server(-core) 8.x, but it seems like it no longer works in 9.x (9.1.3, at least).

Code Example

Here's where we define the MongoDB version strings in our repo, for our CI pipeline: https://github.com/winstonjs/winston-mongodb/blob/master/.github/workflows/ci.yml

Debug Output

Please see the GitHub Actions output here: https://github.com/winstonjs/winston-mongodb/pull/259

Do you know why it happens?

No, but my guess is it may be something similar to https://github.com/nodkz/mongodb-memory-server/issues/734, where some code maybe slipped in between 8.x and 9.x that adds some semver comparison that doesn't sanitize for -latest?

Thanks so much for helping track this down, let me know if there's any other info you need from me!

hasezoey commented 8 months ago

thanks for reporting, issue is quite obvious: v6.0-latest is not a valid semver version and was not coerced to one beforehand, and since 9.0 there are checks against the version to decide the default storage-engine to use, because mongodb 7.0 removed the ephermeralForTest(in-memory) engine, which is faster than wiredTiger and so is still used as a default for lower versions

github-actions[bot] commented 8 months ago

:tada: This issue has been resolved in version 9.1.4 :tada:

The release is available on:

Your semantic-release bot :package::rocket: