-
-
Notifications
You must be signed in to change notification settings - Fork 186
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
Doesn't check that binaries have been already downloaded #84
Comments
It looks like you are using some exact mongodb version in your tests. Please add Related to #76 |
By default downloaded |
I am using the env variable in my
I took a look on code and seems like in |
Can you make PR? |
@nodkz Is the env variable MONGOMS_DOWNLOAD_DIR not enough for this specific use case ? The code in the getPath function of MongoBinary class using this env variable : const defaultOptions = {
downloadDir:
process.env?.MONGOMS_DOWNLOAD_DIR || path.resolve(os.homedir(), '.mongodb-binaries'),
platform: process.env?.MONGOMS_PLATFORM || os.platform(),
arch: process.env?.MONGOMS_ARCH || os.arch(),
version: process.env?.MONGOMS_VERSION || 'latest',
debug:
typeof process.env.MONGOMS_DEBUG === 'string'
? ['1', 'on', 'yes', 'true'].indexOf(process.env.MONGOMS_DEBUG.toLowerCase()) !== -1
: false,
}; |
Need to meet MONGOMS_DOWNLOAD_DIR and MONGOMS_VERSION. These vars are used for storing binaries in some path. So by default with npm install will be downloaded What I think, that this lib should have some bin script, which can be used in docker file:
|
@nodkz I've been trying to cache as well the mongdb binary download with Gitlab CI as well. stages:
- functionnal_tests
functionnal_tests:
image: node:8
stage: functionnal_tests
variables:
MONGOMS_DOWNLOAD_DIR: 'mongobinary'
cache:
paths:
- mongobinary
- node_modules
script:
- npm install
- npm test I've suceeded to cache the npm test command where the mongodb binary is downloaded to the path specified by MONGOMS_DOWNLOAD_DIR. $ npm install
> mongodb-memory-server@2.4.3 postinstall /builds/api/node_modules/mongodb-memory-server
> node ./postinstall.js
mongodb-memory-server: checking MongoDB binaries cache...
Downloading MongoDB latest: 0 % (0mb / 84.5mb)
Downloading MongoDB latest: 52.2 % (44.1mb / 84.5mb)
mongodb-memory-server: binary path is /builds/api/node_modules/mongodb-memory-server/mongobinary/latest/mongod Is this behaviour normal ? |
I found out the source of the problem it was because of the path I gave to MONGOMS_DOWNLOAD_DIR that was incorrect and using the current directory, I specified the path of the build directory of the gitlab pipeline and I suceeded to cache the But still why do we need to download two times the mongodb binary in |
Sorry for delay, I've investigated it deeper and when I set version as |
Fix already on npm. |
Can I add one more PR for |
It should download binary automatically on post install, cause many users don't know how to increase timeout limit for test runners. So better to download binaries on package install. Why do you need to add |
I found one more situation that I need to don't download in |
Another words I have 2 cases when I need to download in |
So it can be named MONGOMS_DISABLE_POSTINSTALL Open PR! |
Hi,
I got an issue that it is downloading binaries twice: after
npm install
and when instance is going to run.I have a problem in this case:
In my CI/CD job I run inside docker container
npm i
andnpm test
commands and it always download binaries at least 1 time.Please add checking that binaries have been already downloaded.
The text was updated successfully, but these errors were encountered: