Skip to content
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

Can't run mongodb-memory-server on Linux Mint #38

Closed
yurtsiv opened this issue Jan 5, 2018 · 6 comments
Closed

Can't run mongodb-memory-server on Linux Mint #38

yurtsiv opened this issue Jan 5, 2018 · 6 comments

Comments

@yurtsiv
Copy link

yurtsiv commented Jan 5, 2018

The same as #32 but for Linux Mint.

Was trying just to make like this

if (/ubuntu|mint/i.test(os.dist)) {
      return this.getUbuntuVersionString(os);
}

But tests are failing
image

@nodkz
Copy link
Collaborator

nodkz commented Jan 5, 2018

Please run following code on your machine:

import getos from 'getos';
import os from 'os';

getos((e, os) => {
  console.log(
     {
        platform: os.platform(),
        arch: os.arch(),
        version: '3.4.4',
        os,
      }
  );
});

Don't forget to install required packages:

npm install os getos

The problem somewhere in https://github.com/nodkz/mongodb-memory-server/blob/master/src/util/MongoBinaryDownloadUrl.js it does not understand params provided from the code above.

It quite simple to fix, just look at tests https://github.com/nodkz/mongodb-memory-server/blob/master/src/util/__tests__/MongoBinaryDownloadUrl-test.js and add your test case for MINT.

PS. How I understand MINT uses Ubuntu packages and should return such link 'https://downloads.mongodb.org/linux/mongodb-linux-x86_64-ubuntu1404-3.4.4.tgz' for your OS.

@nodkz
Copy link
Collaborator

nodkz commented Jan 5, 2018

Will be cool if you make PR.
Thanx.

@yurtsiv
Copy link
Author

yurtsiv commented Jan 11, 2018

Thanks! I've fixed the problem, but don't have access to the repo.

P.S. sorry for the delay

@nodkz
Copy link
Collaborator

nodkz commented Jan 11, 2018

  1. You should fork my repo. It will became avaliable under your github user.

  2. You clone repo under your user name. Make proper changes. Commit snd push to github to your forked repo.

  3. After push, you open github site with your repo and can find button "create pull request". Just press it, and your changes will be submited to my repo as PullRequest.


Or you may publish here your changes as comment, and I put them manually.

Tnx.

@yurtsiv
Copy link
Author

yurtsiv commented Jan 12, 2018

Ok, I think it would be faster to publish here because changes are quite small

/src/util/MongoBinaryDownloadUrl.js

  getLinuxOSVersionString(os: OS): string {
     ...
     } else if (/mint/i.test(os.dist)) {
      return this.getMintVersionString(os);
    }
  }

  // eslint-disable-next-line no-unused-vars
  getMintVersionString(os: OS): string {
    // unfortunately getos doesn't return version for Mint
    return 'ubuntu1404';
  }

/src/util/tests/MongoBinaryDownloadUrl-test.js

describe('getMintVersionString', () => {
    const downloadUrl = new MongoBinaryDownloadUrl({
      platform: 'linux',
      arch: 'x64',
      version: '3.4.4',
    });

    it('should return an archive name for Linux Mint', () => {
      expect(
        downloadUrl.getMintVersionString({ dist: 'Linux Mint' })
      ).toBe('ubuntu1404');
    })
  });

@nodkz
Copy link
Collaborator

nodkz commented Jan 13, 2018

Tnx!
Added your changes manually.
Already landed in the new version.

@nodkz nodkz closed this as completed Jan 13, 2018
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

No branches or pull requests

2 participants