@happier-dev/stack 0.1.0-preview.81.1 → 0.1.0-preview.96.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/package.json
CHANGED
|
@@ -6,6 +6,23 @@ import { join, resolve } from 'node:path';
|
|
|
6
6
|
import test from 'node:test';
|
|
7
7
|
import { fileURLToPath } from 'node:url';
|
|
8
8
|
|
|
9
|
+
function formatSpawnSyncResult(result) {
|
|
10
|
+
const stdout = String(result.stdout || '').trim();
|
|
11
|
+
const stderr = String(result.stderr || '').trim();
|
|
12
|
+
const error = result.error ? String(result.error.stack || result.error.message || result.error) : '';
|
|
13
|
+
const status = typeof result.status === 'number' ? String(result.status) : '<null>';
|
|
14
|
+
const signal = result.signal ? String(result.signal) : '<null>';
|
|
15
|
+
return [
|
|
16
|
+
`status=${status}`,
|
|
17
|
+
`signal=${signal}`,
|
|
18
|
+
error ? `error=${error}` : '',
|
|
19
|
+
stdout ? `stdout:\n${stdout}` : '',
|
|
20
|
+
stderr ? `stderr:\n${stderr}` : '',
|
|
21
|
+
]
|
|
22
|
+
.filter(Boolean)
|
|
23
|
+
.join('\n');
|
|
24
|
+
}
|
|
25
|
+
|
|
9
26
|
function commandExists(cmd) {
|
|
10
27
|
return spawnSync('bash', ['-lc', `command -v ${cmd} >/dev/null 2>&1`], { stdio: 'ignore' }).status === 0;
|
|
11
28
|
}
|
|
@@ -63,9 +80,11 @@ test('compiled happier and server binaries execute from isolated cwd', async (t)
|
|
|
63
80
|
// `inherit` makes it easier to read interactively, but on CI failures we need the full output.
|
|
64
81
|
// Increase buffer because build logs can be large.
|
|
65
82
|
maxBuffer: 50 * 1024 * 1024,
|
|
83
|
+
// If this ever hangs on CI, fail with a clear timeout rather than blocking the entire suite.
|
|
84
|
+
timeout: 15 * 60 * 1000,
|
|
66
85
|
}
|
|
67
86
|
);
|
|
68
|
-
assert.equal(buildCli.status, 0,
|
|
87
|
+
assert.equal(buildCli.status, 0, formatSpawnSyncResult(buildCli));
|
|
69
88
|
|
|
70
89
|
const cliArtifactPath = join(repoRoot, 'dist', 'release-assets', 'cli', `happier-v${version}-${target}.tar.gz`);
|
|
71
90
|
const cliExtract = await extractBinaryFromArtifact({ artifactPath: cliArtifactPath, binaryName: 'happier' });
|
|
@@ -101,9 +120,11 @@ test('compiled happier and server binaries execute from isolated cwd', async (t)
|
|
|
101
120
|
encoding: 'utf-8',
|
|
102
121
|
env: { ...process.env },
|
|
103
122
|
maxBuffer: 50 * 1024 * 1024,
|
|
123
|
+
// If this ever hangs on CI, fail with a clear timeout rather than blocking the entire suite.
|
|
124
|
+
timeout: 15 * 60 * 1000,
|
|
104
125
|
}
|
|
105
126
|
);
|
|
106
|
-
assert.equal(buildServer.status, 0,
|
|
127
|
+
assert.equal(buildServer.status, 0, formatSpawnSyncResult(buildServer));
|
|
107
128
|
|
|
108
129
|
const serverArtifactPath = join(repoRoot, 'dist', 'release-assets', 'server', `happier-server-v${version}-${target}.tar.gz`);
|
|
109
130
|
const serverExtract = await extractBinaryFromArtifact({ artifactPath: serverArtifactPath, binaryName: 'happier-server' });
|
|
@@ -6,6 +6,23 @@ import { join, resolve } from 'node:path';
|
|
|
6
6
|
import test from 'node:test';
|
|
7
7
|
import { fileURLToPath } from 'node:url';
|
|
8
8
|
|
|
9
|
+
function formatSpawnSyncResult(result) {
|
|
10
|
+
const stdout = String(result.stdout || '').trim();
|
|
11
|
+
const stderr = String(result.stderr || '').trim();
|
|
12
|
+
const error = result.error ? String(result.error.stack || result.error.message || result.error) : '';
|
|
13
|
+
const status = typeof result.status === 'number' ? String(result.status) : '<null>';
|
|
14
|
+
const signal = result.signal ? String(result.signal) : '<null>';
|
|
15
|
+
return [
|
|
16
|
+
`status=${status}`,
|
|
17
|
+
`signal=${signal}`,
|
|
18
|
+
error ? `error=${error}` : '',
|
|
19
|
+
stdout ? `stdout:\n${stdout}` : '',
|
|
20
|
+
stderr ? `stderr:\n${stderr}` : '',
|
|
21
|
+
]
|
|
22
|
+
.filter(Boolean)
|
|
23
|
+
.join('\n');
|
|
24
|
+
}
|
|
25
|
+
|
|
9
26
|
function commandExists(cmd) {
|
|
10
27
|
return spawnSync('bash', ['-lc', `command -v ${cmd} >/dev/null 2>&1`], { stdio: 'ignore' }).status === 0;
|
|
11
28
|
}
|
|
@@ -44,9 +61,12 @@ test('compiled hstack binary runs self-host help outside repo checkout', async (
|
|
|
44
61
|
env: {
|
|
45
62
|
...process.env,
|
|
46
63
|
},
|
|
64
|
+
// If this ever hangs on CI, fail with a clear timeout rather than blocking the entire suite.
|
|
65
|
+
timeout: 15 * 60 * 1000,
|
|
66
|
+
maxBuffer: 50 * 1024 * 1024,
|
|
47
67
|
}
|
|
48
68
|
);
|
|
49
|
-
assert.equal(build.status, 0, build
|
|
69
|
+
assert.equal(build.status, 0, formatSpawnSyncResult(build));
|
|
50
70
|
|
|
51
71
|
const artifact = join(repoRoot, 'dist', 'release-assets', 'stack', `hstack-v${version}-${target}.tar.gz`);
|
|
52
72
|
const extractDir = await mkdtemp(join(tmpdir(), 'hstack-binary-smoke-'));
|