Public release release-6d1a121b0a8a
Source commit: 6d1a121b0a8a636aac95998fe5d15c24c78eb7d0 Public tree identity: sha256:2bc22807f5b838286678b65d3f550b8ae4714ae673622041d4c2516a7c5b7926
This commit is contained in:
commit
21f097d9a8
210 changed files with 78649 additions and 0 deletions
61
scripts/cli-install-smoke.js
Executable file
61
scripts/cli-install-smoke.js
Executable file
|
|
@ -0,0 +1,61 @@
|
|||
#!/usr/bin/env node
|
||||
|
||||
const assert = require("assert");
|
||||
const cp = require("child_process");
|
||||
const fs = require("fs");
|
||||
const os = require("os");
|
||||
const path = require("path");
|
||||
|
||||
const repo = path.resolve(__dirname, "..");
|
||||
const temp = fs.mkdtempSync(path.join(os.tmpdir(), "clusterflux-cli-install-"));
|
||||
const installRoot = path.join(temp, "install");
|
||||
const targetDir =
|
||||
process.env.CLUSTERFLUX_CLI_INSTALL_CARGO_TARGET_DIR ||
|
||||
process.env.CARGO_TARGET_DIR ||
|
||||
path.join(repo, "target");
|
||||
const project = path.join(repo, "examples/launch-build-demo");
|
||||
const binName = process.platform === "win32" ? "clusterflux.exe" : "clusterflux";
|
||||
const installedBin = path.join(installRoot, "bin", binName);
|
||||
|
||||
try {
|
||||
cp.execFileSync(
|
||||
"cargo",
|
||||
[
|
||||
"install",
|
||||
"--path",
|
||||
"crates/clusterflux-cli",
|
||||
"--bin",
|
||||
"clusterflux",
|
||||
"--root",
|
||||
installRoot,
|
||||
"--debug"
|
||||
],
|
||||
{
|
||||
cwd: repo,
|
||||
env: {
|
||||
...process.env,
|
||||
CARGO_TARGET_DIR: targetDir
|
||||
},
|
||||
stdio: "inherit"
|
||||
}
|
||||
);
|
||||
|
||||
assert(fs.existsSync(installedBin), "installed clusterflux binary must exist");
|
||||
|
||||
const inspection = JSON.parse(
|
||||
cp.execFileSync(
|
||||
installedBin,
|
||||
["bundle", "inspect", "--project", project, "--json"],
|
||||
{ cwd: repo, encoding: "utf8" }
|
||||
)
|
||||
);
|
||||
|
||||
assert.strictEqual(inspection.project, project);
|
||||
assert.strictEqual(inspection.metadata.embeds_full_container_images, false);
|
||||
assert(inspection.metadata.environments.some((env) => env.name === "linux"));
|
||||
assert(inspection.metadata.selected_inputs.some((input) => input.path === "src/build.rs"));
|
||||
} finally {
|
||||
fs.rmSync(temp, { recursive: true, force: true });
|
||||
}
|
||||
|
||||
console.log("CLI install smoke passed");
|
||||
Loading…
Add table
Add a link
Reference in a new issue