test/install: Use separate runDir for each test

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
This commit is contained in:
Paweł Gronowski 2024-11-08 16:44:41 +01:00
parent 37b0f81ca2
commit 4980de30fc
No known key found for this signature in database
GPG Key ID: B85EFCFE26DEF92A

View File

@ -23,7 +23,7 @@ import {Install, InstallSourceArchive, InstallSourceImage} from '../../src/docke
import {Docker} from '../../src/docker/docker';
import {Exec} from '../../src/exec';
const tmpDir = fs.mkdtempSync(path.join(process.env.TEMP || os.tmpdir(), 'docker-install-itg-'));
const tmpDir = () => fs.mkdtempSync(path.join(process.env.TEMP || os.tmpdir(), 'docker-install-itg-'));
describe('install', () => {
const originalEnv = process.env;
@ -51,7 +51,7 @@ aarch64:https://cloud.debian.org/images/cloud/bookworm/20231013-1532/debian-12-g
await ensureNoSystemContainerd();
const install = new Install({
source: source,
runDir: tmpDir,
runDir: tmpDir(),
contextName: 'foo',
daemonConfig: `{"debug":true,"features":{"containerd-snapshotter":true}}`
});
@ -74,7 +74,7 @@ describe('rootless', () => {
await ensureNoSystemContainerd();
const install = new Install({
source: source,
runDir: tmpDir,
runDir: tmpDir(),
contextName: 'foo',
daemonConfig: `{"debug":true}`,
rootless: true