Skip to content

Commit bfb8cbf

Browse files
committed
fix: integration test now uses podman-compose (the actually-installed tool)
Every CI integration run for the past 3+ months has failed with: unable to get image 'python:3.12-alpine': Cannot connect to the Docker daemon at unix:///run/user/1001/podman/podman.sock Error: executing /usr/libexec/docker/cli-plugins/docker-compose up --detach --build: exit status 1 Root cause: the script invoked `podman compose` (the built-in subcommand on Podman 4.x), which on Linux delegates to whichever external compose provider it finds in /usr/libexec/docker/cli-plugins/. That provider expects a Docker- compatible daemon socket, which rootless podman on ubuntu-latest doesn't activate by default. Meanwhile the workflow already installs `podman-compose` (the Python wrapper) via pip. That tool shells out to the podman CLI directly and needs no socket - it just wasn't being used. Switching the three call sites in integration-test.js to `podman-compose` resolves the failure with no further runner setup, and works equally on macOS dev (where `podman-compose` is also installed via Homebrew). The CI yaml's comment claiming the test was non-blocking because "Schneider download is flaky" was misdiagnosis - the failures never reached the C-Gate download step. Removing `continue-on-error: true` so future regressions actually gate merges, and updating the prereq check + comments in the script to reflect what's actually called.
1 parent 6f4f735 commit bfb8cbf

2 files changed

Lines changed: 23 additions & 10 deletions

File tree

.github/workflows/ci.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,6 @@ jobs:
7070
runs-on: ubuntu-latest
7171
# Only run on push to main branches — not on PRs — to avoid long waits during review.
7272
if: github.event_name == 'push'
73-
# Network download of C-Gate can be slow; mark non-blocking so a flaky
74-
# Schneider download does not gate merges.
75-
continue-on-error: true
7673
timeout-minutes: 20
7774
needs: test
7875

test-env/integration-test.js

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,13 @@
33
* Integration test for cgateweb managed mode.
44
*
55
* Validates the full managed-mode stack:
6-
* podman compose → C-Gate install → C-Gate start → cgateweb → MQTT ready
6+
* podman-compose → C-Gate install → C-Gate start → cgateweb → MQTT ready
7+
*
8+
* Uses `podman-compose` (the Python wrapper, installed via pip / brew) rather
9+
* than `podman compose` (the built-in subcommand). `podman compose` on Linux
10+
* delegates to an external docker-compose plugin that expects a daemon socket
11+
* which isn't activated on rootless CI runners; `podman-compose` shells out
12+
* to the podman CLI directly and works in both environments without setup.
713
*
814
* Usage:
915
* node test-env/integration-test.js # full lifecycle (build → test → teardown)
@@ -12,7 +18,8 @@
1218
* node test-env/integration-test.js --attach # stack already up, just run assertions
1319
*
1420
* Prerequisites:
15-
* podman machine start
21+
* podman machine start (macOS/Windows only)
22+
* pip install podman-compose OR brew install podman-compose
1623
* cp test-env/options-managed-download.json test-env/active-options.json
1724
*/
1825

@@ -56,7 +63,7 @@ function fail(label) { log(` ${RED}✘${RESET} ${label}`); }
5663
function section(h) { log(`\n${BOLD}${h}${RESET}`); }
5764

5865
function compose(...args) {
59-
const result = spawnSync('podman', ['compose', ...args], {
66+
const result = spawnSync('podman-compose', args, {
6067
cwd: TEST_ENV_DIR,
6168
stdio: ['ignore', 'pipe', 'pipe'],
6269
encoding: 'utf8',
@@ -66,18 +73,18 @@ function compose(...args) {
6673

6774
function composeUp(build) {
6875
const buildArgs = build ? ['--build'] : [];
69-
info(`podman compose up${build ? ' --build' : ''} (this may take a few minutes on first run)`);
70-
const result = spawnSync('podman', ['compose', 'up', '--detach', ...buildArgs], {
76+
info(`podman-compose up${build ? ' --build' : ''} (this may take a few minutes on first run)`);
77+
const result = spawnSync('podman-compose', ['up', '--detach', ...buildArgs], {
7178
cwd: TEST_ENV_DIR,
7279
stdio: 'inherit',
7380
encoding: 'utf8',
7481
});
75-
if (result.status !== 0) throw new Error('podman compose up failed');
82+
if (result.status !== 0) throw new Error('podman-compose up failed');
7683
}
7784

7885
function composeDown() {
7986
info('Stopping compose stack...');
80-
spawnSync('podman', ['compose', 'down'], {
87+
spawnSync('podman-compose', ['down'], {
8188
cwd: TEST_ENV_DIR,
8289
stdio: 'inherit',
8390
});
@@ -94,6 +101,15 @@ function checkPrereqs() {
94101
}
95102
pass(`podman ${pv.stdout.trim().split('\n')[0]}`);
96103

104+
// podman-compose (the Python wrapper) available?
105+
const pcv = spawnSync('podman-compose', ['--version'], { encoding: 'utf8' });
106+
if (pcv.status !== 0) {
107+
fail('podman-compose not found — install with: pip install podman-compose (or: brew install podman-compose)');
108+
process.exit(1);
109+
}
110+
const firstLine = pcv.stdout.trim().split('\n')[0] || 'podman-compose';
111+
pass(firstLine);
112+
97113
// podman machine running? (macOS/Windows only — Linux runs containers natively)
98114
if (process.platform !== 'linux') {
99115
const pm = spawnSync('podman', ['machine', 'list', '--format', '{{.Running}}'], { encoding: 'utf8' });

0 commit comments

Comments
 (0)