Skip to content

Commit 2932b23

Browse files
chrmartiCopilot
andcommitted
Test Podman Feature builds with chroot isolation
Use Buildah chroot isolation for the hosted runner's rootless Podman Feature builds while retaining the Docker-in-Docker Feature coverage. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 978a508 commit 2932b23

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

‎src/test/cli.podman.test.ts‎

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@ describe('Dev Containers CLI using Podman', function () {
1515

1616
const tmp = path.relative(process.cwd(), path.join(__dirname, 'tmp'));
1717
const cli = `npx --prefix ${tmp} devcontainer`;
18+
const podmanBuildOptions = {
19+
env: {
20+
...process.env,
21+
BUILDAH_ISOLATION: 'chroot',
22+
},
23+
};
1824

1925
before('Install', async () => {
2026
await shellExec(`rm -rf ${tmp}/node_modules`);
@@ -57,7 +63,7 @@ describe('Dev Containers CLI using Podman', function () {
5763
' && echo "Build RUN _apt write check: succeeded"',
5864
'',
5965
].join('\n'));
60-
const buildProbe = await shellExec(`podman buildx build --no-cache -f ${probeDockerfile} ${path.dirname(probeDockerfile)}`);
66+
const buildProbe = await shellExec(`podman buildx build --no-cache -f ${probeDockerfile} ${path.dirname(probeDockerfile)}`, podmanBuildOptions);
6167
console.log(buildProbe.stdout);
6268
console.error(buildProbe.stderr);
6369
}
@@ -67,7 +73,7 @@ describe('Dev Containers CLI using Podman', function () {
6773
describe('Command up using Podman', () => {
6874

6975
it('should execute successfully with valid config with features', async () => {
70-
const res = await shellExec(`${cli} up --docker-path podman --workspace-folder ${__dirname}/configs/image-with-features`);
76+
const res = await shellExec(`${cli} up --docker-path podman --workspace-folder ${__dirname}/configs/image-with-features`, podmanBuildOptions);
7177
const response = JSON.parse(res.stdout);
7278
assert.equal(response.outcome, 'success');
7379
const containerId: string = response.containerId;
@@ -76,7 +82,7 @@ describe('Dev Containers CLI using Podman', function () {
7682
});
7783

7884
it('should execute successfully with valid config with features', async () => {
79-
const res = await shellExec(`${cli} up --docker-path podman --workspace-folder ${__dirname}/configs/dockerfile-with-features`);
85+
const res = await shellExec(`${cli} up --docker-path podman --workspace-folder ${__dirname}/configs/dockerfile-with-features`, podmanBuildOptions);
8086
const response = JSON.parse(res.stdout);
8187
assert.equal(response.outcome, 'success');
8288
const containerId: string = response.containerId;

0 commit comments

Comments
 (0)