-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(test): Clean up docker containers with script (#10454)
This PR adds a script to cleanup any docker containers left over from the node integration tests. - It uses `globby@11` since that is already installed for a couple of our dependencies. - It finds all the `docker-compose.yml` files and runs `docker compose down --volumes` in those directories. - It catches all errors for when docker is not running
- Loading branch information
Showing
3 changed files
with
25 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
const { execSync } = require('child_process'); | ||
const globby = require('globby'); | ||
const { dirname, join } = require('path'); | ||
|
||
const cwd = join(__dirname, '..'); | ||
const paths = globby.sync(['suites/**/docker-compose.yml'], { cwd }).map(path => join(cwd, dirname(path))); | ||
|
||
// eslint-disable-next-line no-console | ||
console.log('Cleaning up docker containers and volumes...'); | ||
|
||
for (const path of paths) { | ||
try { | ||
// eslint-disable-next-line no-console | ||
console.log(`docker compose down @ ${path}`); | ||
execSync('docker compose down --volumes', { stdio: 'inherit', cwd: path }); | ||
} catch (_) { | ||
// | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters