start-command 0.32.0 → 0.32.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/package.json +1 -1
- package/test/docker-network-integration.js +22 -14
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
|
-
/** Real-daemon integration coverage for Docker network isolation (issues #154, #156, #158). */
|
|
2
|
+
/** Real-daemon integration coverage for Docker network isolation (issues #154, #156, #158, #160). */
|
|
3
3
|
|
|
4
4
|
const { after, before, describe, it } = require('node:test');
|
|
5
5
|
const assert = require('assert');
|
|
@@ -10,6 +10,8 @@ const { runInDocker } = require('../src/lib/isolation');
|
|
|
10
10
|
// Bun's `node:test` shim ignores a `describe`-level timeout, so every `it`
|
|
11
11
|
// declares its own budget explicitly (issue #158).
|
|
12
12
|
const TEST_TIMEOUT = 120000;
|
|
13
|
+
const MULTI_NETWORK_PROBE =
|
|
14
|
+
"ping -c 1 formal-ai && ping -c 1 formal-db && ip route | grep -q '^default '";
|
|
13
15
|
|
|
14
16
|
const suffix = randomUUID().slice(0, 8);
|
|
15
17
|
const network = `start-network-${suffix}`;
|
|
@@ -84,6 +86,13 @@ describe('Docker named network integration', () => {
|
|
|
84
86
|
docker(['network', 'rm', network, secondNetwork]);
|
|
85
87
|
});
|
|
86
88
|
|
|
89
|
+
it('keeps the multi-network probe hermetic', () => {
|
|
90
|
+
assert.doesNotMatch(MULTI_NETWORK_PROBE, /https?:\/\//);
|
|
91
|
+
assert.match(MULTI_NETWORK_PROBE, /formal-ai/);
|
|
92
|
+
assert.match(MULTI_NETWORK_PROBE, /formal-db/);
|
|
93
|
+
assert.match(MULTI_NETWORK_PROBE, /ip route/);
|
|
94
|
+
});
|
|
95
|
+
|
|
87
96
|
it(
|
|
88
97
|
'reaches a private sidecar on each of two networks',
|
|
89
98
|
{ timeout: TEST_TIMEOUT },
|
|
@@ -95,19 +104,18 @@ describe('Docker named network integration', () => {
|
|
|
95
104
|
// Both endpoints are local, user-defined networks on purpose: probing a
|
|
96
105
|
// public endpoint (previously `https://api.github.com`) made this test
|
|
97
106
|
// fail whenever the shared runner IP hit the 60 requests/hour
|
|
98
|
-
// unauthenticated GitHub API rate limit
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
);
|
|
107
|
+
// unauthenticated GitHub API rate limit. Checking the route table keeps
|
|
108
|
+
// the original assertion that the default bridge route survived without
|
|
109
|
+
// making the test depend on any internet service (issues #158, #160).
|
|
110
|
+
const joined = await runInDocker(MULTI_NETWORK_PROBE, {
|
|
111
|
+
image: 'alpine:3.23',
|
|
112
|
+
session: connected,
|
|
113
|
+
network: 'bridge',
|
|
114
|
+
networks: ['bridge', network, secondNetwork],
|
|
115
|
+
detached: true,
|
|
116
|
+
shell: 'sh',
|
|
117
|
+
keepContainer: true,
|
|
118
|
+
});
|
|
111
119
|
assert.strictEqual(joined.success, true, joined.message);
|
|
112
120
|
const joinedExit = docker(['wait', connected]);
|
|
113
121
|
assert.strictEqual(joinedExit.status, 0, joinedExit.stderr);
|