diff --git a/src/test/cli.podman.test.ts b/src/test/cli.podman.test.ts index 932d9a358..4541eadb9 100644 --- a/src/test/cli.podman.test.ts +++ b/src/test/cli.podman.test.ts @@ -14,6 +14,11 @@ describe('Dev Containers CLI using Podman', function () { const tmp = path.relative(process.cwd(), path.join(__dirname, 'tmp')); const cli = `npx --prefix ${tmp} devcontainer`; + const podman = 'podman'; + // Buildah 1.42+ can reset /tmp permissions after RUN --mount when layers are enabled. + const cliEnvironment = process.env.GITHUB_ACTIONS === 'true' + ? { ...process.env, BUILDAH_LAYERS: 'false' } + : process.env; before('Install', async () => { await shellExec(`rm -rf ${tmp}/node_modules`); @@ -24,21 +29,21 @@ describe('Dev Containers CLI using Podman', function () { describe('Command up using Podman', () => { it('should execute successfully with valid config with features', async () => { - const res = await shellExec(`${cli} up --docker-path podman --workspace-folder ${__dirname}/configs/image-with-features`); + const res = await shellExec(`${cli} up --docker-path ${podman} --workspace-folder ${__dirname}/configs/image-with-features`, { env: cliEnvironment }); const response = JSON.parse(res.stdout); assert.equal(response.outcome, 'success'); const containerId: string = response.containerId; assert.ok(containerId, 'Container id not found.'); - await shellExec(`podman rm -f ${containerId}`); + await shellExec(`${podman} rm -f ${containerId}`); }); it('should execute successfully with valid config with features', async () => { - const res = await shellExec(`${cli} up --docker-path podman --workspace-folder ${__dirname}/configs/dockerfile-with-features`); + const res = await shellExec(`${cli} up --docker-path ${podman} --workspace-folder ${__dirname}/configs/dockerfile-with-features`, { env: cliEnvironment }); const response = JSON.parse(res.stdout); assert.equal(response.outcome, 'success'); const containerId: string = response.containerId; assert.ok(containerId, 'Container id not found.'); - await shellExec(`podman rm -f ${containerId}`); + await shellExec(`${podman} rm -f ${containerId}`); }); }); -}); \ No newline at end of file +});