Skip to content

Commit 259af30

Browse files
committed
use local version of install.sh in e2e tests
1 parent 8e08d7a commit 259af30

File tree

1 file changed

+15
-23
lines changed

1 file changed

+15
-23
lines changed

site/e2e/helpers.ts

+15-23
Original file line numberDiff line numberDiff line change
@@ -263,45 +263,37 @@ export const downloadCoderVersion = async (
263263
return binaryPath;
264264
}
265265

266-
// Runs our public install script using our options to
267-
// install the binary!
266+
// Run our official install script to install the binary
268267
await new Promise<void>((resolve, reject) => {
269268
const cp = spawn(
270-
"sh",
269+
path.join(__dirname, "../../install.sh"),
271270
[
272-
"-c",
273-
[
274-
"curl",
275-
"-L",
276-
"https://coder.com/install.sh",
277-
"|",
278-
"sh",
279-
"-s",
280-
"--",
281-
"--version",
282-
version,
283-
"--method",
284-
"standalone",
285-
"--prefix",
286-
tempDir,
287-
"--binary-name",
288-
binaryName,
289-
].join(" "),
271+
"--version",
272+
version,
273+
"--method",
274+
"standalone",
275+
"--prefix",
276+
tempDir,
277+
"--binary-name",
278+
binaryName,
290279
],
291280
{
292281
env: {
293282
...process.env,
294283
XDG_CACHE_HOME: "/tmp/coder-e2e-cache",
284+
TRACE: "1", // tells install.sh to `set -x`, helpful if something goes wrong
295285
},
296286
},
297287
);
298288
// eslint-disable-next-line no-console -- Needed for debugging
299-
cp.stderr.on("data", (data) => console.log(data.toString()));
289+
cp.stderr.on("data", (data) => console.error(data.toString()));
290+
// eslint-disable-next-line no-console -- Needed for debugging
291+
cp.stdout.on("data", (data) => console.log(data.toString()));
300292
cp.on("close", (code) => {
301293
if (code === 0) {
302294
resolve();
303295
} else {
304-
reject(new Error("curl failed with code " + code));
296+
reject(new Error("install.sh failed with code " + code));
305297
}
306298
});
307299
});

0 commit comments

Comments
 (0)