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

System binary #119

Merged
merged 12 commits into from
Dec 19, 2018
Merged

System binary #119

merged 12 commits into from
Dec 19, 2018

Conversation

jtbairdsr
Copy link
Contributor

No description provided.

this also updates tests to use a mocked version of the
MongoBinaryDownloader so that we have a truelly issolated unit test...
@jtbairdsr
Copy link
Contributor Author

jtbairdsr commented Dec 18, 2018

I have pushed changes in response to your comments #32 (comment). I look forward to your feedback...

@AJRdev AJRdev requested review from AJRdev and nodkz December 19, 2018 10:18
}

debug(`MongoBinary: Mongod binary path: ${this.cache[version]}`);
return this.cache[version];
if (version !== 'latest' && systemBinary) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

We should not show the message if versions are the same ;)

And I think that better to move this code inside if (systemBinary) { at line 149
right after binaryPath = await this.getSystemPath(systemBinary);

Copy link
Collaborator

Choose a reason for hiding this comment

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

All rest parts are good! Code became much cleaner! Thanks!

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ouch! And don't forget to add new option to README.md

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, I appreciate the feedback and agree. I have updated the code and the README.md. let me know if there is anything else.

this is a fairly simple check and doesn't attempt to do any complex
version matching or resolution.  It simply takes the value provided by
the system and checks strict equality with the version requested.
also added a section explaining how to use mongodb-memory-server on a
system not officially supported by mongodb
@@ -148,6 +148,21 @@ export default class MongoBinary {

if (systemBinary) {
binaryPath = await this.getSystemPath(systemBinary);
const binaryVersion = execSync('mongod --version')
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should be

const binaryVersion = execSync(`${binaryPath} --version`)

And need to add check that binaryPath is not empty ;)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oh yeah, good catch totally missed that.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I've just merged with the master (there was a conflict).
Pull changes before commit.

Copy link
Collaborator

Choose a reason for hiding this comment

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

There were updated packages in master.
Maybe it helps to resolve #120

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👌 I made that fix and pushed.

@nodkz nodkz merged commit 89a6b73 into typegoose:master Dec 19, 2018
@nodkz
Copy link
Collaborator

nodkz commented Dec 19, 2018

Thanks a lot! 👍

@nodkz
Copy link
Collaborator

nodkz commented Dec 19, 2018

I'll fix
const binaryVersion = execSync(${binaryPath} --version)
myself

@jtbairdsr
Copy link
Contributor Author

No problem! It was a pleasure to participate.

@jtbairdsr
Copy link
Contributor Author

when will these changes be published to npm?

@nodkz
Copy link
Collaborator

nodkz commented Dec 19, 2018

🎉 This PR is included in version 2.9.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@nodkz nodkz added the released Pull Request released | Issue is fixed label Dec 19, 2018
@jtbairdsr
Copy link
Contributor Author

@nodkz thank you again for the awesome package! It was a pleasure to contribute!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
released Pull Request released | Issue is fixed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants