Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions src/test/cli.podman.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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`);
Expand All @@ -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}`);
});
});
});
});
Loading