mongodb-memory-server-core
Advanced tools
Comparing version 8.14.0 to 8.15.0
@@ -17,3 +17,3 @@ /// <reference types="node" /> | ||
_downloadingUrl?: string; | ||
/**These options are kind of raw, they are not run through DryMongoBinary.generateOptions */ | ||
/** These options are kind of raw, they are not run through DryMongoBinary.generateOptions */ | ||
binaryOpts: Required<MongoBinaryOpts>; | ||
@@ -20,0 +20,0 @@ get checkMD5(): boolean; |
@@ -42,2 +42,6 @@ import { AnyOS, LinuxOS } from './getos'; | ||
/** | ||
* Parse and apply config option DISTRO | ||
*/ | ||
protected overwriteDistro(): void; | ||
/** | ||
* Get the version string (with distro) | ||
@@ -44,0 +48,0 @@ * @param os LinuxOS Object |
@@ -130,5 +130,8 @@ "use strict"; | ||
if (this.arch !== 'i686') { | ||
if (!this.os) { | ||
if (!this.os && (0, resolveConfig_1.resolveConfig)(resolveConfig_1.ResolveConfigVariables.DISTRO)) { | ||
this.os = yield (0, getos_1.getOS)(); | ||
} | ||
if ((0, resolveConfig_1.resolveConfig)(resolveConfig_1.ResolveConfigVariables.DISTRO)) { | ||
this.overwriteDistro(); | ||
} | ||
osString = this.getLinuxOSVersionString(this.os); | ||
@@ -146,2 +149,25 @@ } | ||
/** | ||
* Parse and apply config option DISTRO | ||
*/ | ||
overwriteDistro() { | ||
const env = (0, resolveConfig_1.resolveConfig)(resolveConfig_1.ResolveConfigVariables.DISTRO); | ||
if ((0, utils_1.isNullOrUndefined)(env)) { | ||
return; | ||
} | ||
const split = env.split('-'); | ||
const distro = split[0]; | ||
const release = split[1]; | ||
if ((0, utils_1.isNullOrUndefined)(distro)) { | ||
throw new errors_1.GenericMMSError('Expected DISTRO option to have a distro like "ubuntu-18.04"'); | ||
} | ||
if ((0, utils_1.isNullOrUndefined)(release)) { | ||
throw new errors_1.GenericMMSError('Expected DISTRO option to have a release like "ubuntu-18.04" (delimited by "-")'); | ||
} | ||
this.os = { | ||
os: 'linux', | ||
dist: distro, | ||
release: release, | ||
}; | ||
} | ||
/** | ||
* Get the version string (with distro) | ||
@@ -148,0 +174,0 @@ * @param os LinuxOS Object |
@@ -19,3 +19,4 @@ /** Enum of all possible config options */ | ||
USE_ARCHIVE_NAME_FOR_BINARY_NAME = "USE_ARCHIVE_NAME_FOR_BINARY_NAME", | ||
MAX_REDIRECTS = "MAX_REDIRECTS" | ||
MAX_REDIRECTS = "MAX_REDIRECTS", | ||
DISTRO = "DISTRO" | ||
} | ||
@@ -22,0 +23,0 @@ /** The Prefix for Environmental values */ |
@@ -32,2 +32,3 @@ "use strict"; | ||
ResolveConfigVariables["MAX_REDIRECTS"] = "MAX_REDIRECTS"; | ||
ResolveConfigVariables["DISTRO"] = "DISTRO"; | ||
})(ResolveConfigVariables = exports.ResolveConfigVariables || (exports.ResolveConfigVariables = {})); | ||
@@ -34,0 +35,0 @@ /** The Prefix for Environmental values */ |
{ | ||
"name": "mongodb-memory-server-core", | ||
"version": "8.14.0", | ||
"version": "8.15.0", | ||
"description": "MongoDB Server for testing (core package, without autodownload). The server will allow you to connect your favourite ODM or client library to the MongoDB Server and run parallel integration tests isolated from each other.", | ||
@@ -5,0 +5,0 @@ "main": "lib/index", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
384146
5545