Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@applitools/docker-compose-mocha

Package Overview
Dependencies
Maintainers
0
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@applitools/docker-compose-mocha - npm Package Compare versions

Comparing version 2.0.5 to 3.0.0

.idea/codeStyles/codeStyleConfig.xml

9

index.js

@@ -21,2 +21,3 @@ // @flow

const getLogsForService = require('./lib/get-logs-for-service');
const { setUpGcsBuckets, getLocksBucket, getConfigsBucket } = require('./lib/setup-gcs-buckets')();

@@ -78,2 +79,4 @@ function replaceFunctionsWithTheirValues(envVars) {

beforeContainerCleanUp = () => {},
useConfigurationsBuckets = false,
gcStorage,
}

@@ -140,2 +143,6 @@ /* :DockerComposeToolOptions */ = {})/* : string */ {

}
if (useConfigurationsBuckets) {
await setUpGcsBuckets(gcStorage);
}
});

@@ -177,2 +184,4 @@

dockerUnpauseByServiceName,
getLocksBucket,
getConfigsBucket,
};

4

lib/docker-check-by-service-name.js

@@ -14,4 +14,4 @@ const { exec } = require('child-process-promise');

const exist = lines.find((element) => {
const containerName = `${runName}_${serviceName}`;
return element.indexOf(containerName) > -1 && element.indexOf('Up') > -1;
const containerName = `${runName}-${serviceName}`;
return element.indexOf(containerName) > -1 && element.indexOf('Up') > -1 && element.indexOf('Paused') === -1;
});

@@ -18,0 +18,0 @@ return Boolean(exist);

@@ -5,4 +5,16 @@ // @flow

module.exports = function dockerKillByContainerId(id/* : string */) {
return exec(`docker rm -f -v ${id}`);
module.exports = async function dockerKillByContainerId(id/* : string */) {
let res;
try {
res = await exec(`docker rm -f -v ${id}`);
} catch (e) {
if (e.message.includes('is not running')) {
console.log(`container ${id} is no longer running`);
} else {
throw e;
}
}
return res;
};

@@ -71,3 +71,11 @@ // @flow

await exec(`docker compose -p ${envName} -f "${pathToComposeFile}" ${brutallyKill ? 'kill' : 'down'}`, envVars ? { shell: getShell(), env: { PATH: process.env.PATH, ...envVars } } : { shell: getShell() });
try {
await exec(`docker compose -p ${envName} -f "${pathToComposeFile}" ${brutallyKill ? 'kill' : 'down'}`, envVars ? { shell: getShell(), env: { PATH: process.env.PATH, ...envVars } } : { shell: getShell() });
} catch (e) {
if (e.message.includes('is not running')) {
console.log(`env ${envName} is no longer running`);
} else {
throw e;
}
}

@@ -85,3 +93,12 @@ const consoleMessageDispose = `Disposing of ${envDisplayName} environment.. `;

await exec(`docker compose -p ${envName} -f "${pathToComposeFile}" down -v`, envVars ? { shell: getShell(), env: { PATH: process.env.PATH, ...envVars } } : { shell: getShell() });
try {
await exec(`docker compose -p ${envName} -f "${pathToComposeFile}" down -v`, envVars ? { shell: getShell(), env: { PATH: process.env.PATH, ...envVars } } : { shell: getShell() });
} catch (e) {
if (e.message.includes('is not running')) {
console.log(`env ${envName} is no longer running`);
} else {
throw e;
}
}
if (!process.env.NOSPIN) {

@@ -88,0 +105,0 @@ spinner2.stop();

@@ -8,3 +8,3 @@ // @flow

const { exec } = childProcess;
if (originalPort.toString().includes(':')) {
if (originalPort?.toString().includes(':')) {
// If the port is locked - we return it - no need to query for it with the code below

@@ -11,0 +11,0 @@ return `0.0.0.0:${originalPort.split(':')[0]}`;

{
"name": "@applitools/docker-compose-mocha",
"version": "2.0.5",
"version": "3.0.0",
"description": "Tool used for setting up an isolated environment for end to end testing / integration testing using Docker Compose",

@@ -31,2 +31,3 @@ "main": "index.js",

"@applitools/sample-web-app-testkit": "^1.3.85",
"@google-cloud/storage": "^7.12.1",
"chai": "^4.2.0",

@@ -37,5 +38,5 @@ "eslint": "^6.8.0",

"flow-bin": "^0.116.1",
"mocha": "^6.2.2",
"mocha": "^10.7.3",
"sinon": "^8.1.1"
}
}

@@ -131,3 +131,3 @@ const { expect } = require('chai');

expect(checkBefore).to.eql(true);
const address = await getAddressForService(generatedEnvName, pathToCompose, serviceName);
const address = await getAddressForService(generatedEnvName, pathToCompose, serviceName, 3001);
await dockerPauseByServiceName(generatedEnvName,

@@ -144,3 +144,3 @@ pathToCompose, serviceName);

const addressAfterPause = await getAddressForService(generatedEnvName,
pathToCompose, serviceName);
pathToCompose, serviceName, 3001);
expect(address).to.eql(addressAfterPause);

@@ -147,0 +147,0 @@ } catch (err) {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc