(cliHost: CLIHost)
| 79 | } |
| 80 | |
| 81 | async function cleanup(cliHost: CLIHost) { |
| 82 | // Delete any containers that have the 'devcontainer.is_test_run=true' label set. |
| 83 | const filterForContainerIdArgs = ['ps', '-a', '--filter', 'label=devcontainer.is_test_run=true', '--format', '{{.ID}}']; |
| 84 | const { stdout } = (await runCommandNoPty({ cmd: 'docker', args: filterForContainerIdArgs, output: nullLog, exec: cliHost.exec })); |
| 85 | const containerIds = stdout.toString().split('\n').filter(id => id !== '').map(s => s.trim()); |
| 86 | log(`Cleaning up ${containerIds.length} test containers...`, { prefix: '🧹', info: true }); |
| 87 | for (const containerId of containerIds) { |
| 88 | log(`Removing container ${containerId}...`, { prefix: '🧹', info: true }); |
| 89 | await cliHost.exec({ cmd: 'docker', args: ['rm', '-f', containerId], output: nullLog }); |
| 90 | } |
| 91 | } |
| 92 | |
| 93 | async function runGlobalFeatureTests(args: FeaturesTestCommandInput, testResults: TestResult[] = []): Promise<TestResult[]> { |
| 94 | const { collectionFolder } = args; |
no test coverage detected