Public dry run dryrun-1714a9eedd5b
Source commit: 1714a9eedd5b1e30c6c9aceb7a999f2f695ba83c Public tree identity: sha256:e5daffad23fa7c7f1822adccd3c3b4ee0bc7f1a45e0d321eb9a6fb8282b269db
This commit is contained in:
commit
20c72e6066
102 changed files with 32054 additions and 0 deletions
58
scripts/cli-install-smoke.js
Executable file
58
scripts/cli-install-smoke.js
Executable file
|
|
@ -0,0 +1,58 @@
|
|||
#!/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(), "disasmer-cli-install-"));
|
||||
const installRoot = path.join(temp, "install");
|
||||
const targetDir = path.join(temp, "target");
|
||||
const project = path.join(repo, "examples/launch-build-demo");
|
||||
const binName = process.platform === "win32" ? "disasmer.exe" : "disasmer";
|
||||
const installedBin = path.join(installRoot, "bin", binName);
|
||||
|
||||
try {
|
||||
cp.execFileSync(
|
||||
"cargo",
|
||||
[
|
||||
"install",
|
||||
"--path",
|
||||
"crates/disasmer-cli",
|
||||
"--bin",
|
||||
"disasmer",
|
||||
"--root",
|
||||
installRoot,
|
||||
"--debug"
|
||||
],
|
||||
{
|
||||
cwd: repo,
|
||||
env: {
|
||||
...process.env,
|
||||
CARGO_TARGET_DIR: targetDir
|
||||
},
|
||||
stdio: "inherit"
|
||||
}
|
||||
);
|
||||
|
||||
assert(fs.existsSync(installedBin), "installed disasmer binary must exist");
|
||||
|
||||
const inspection = JSON.parse(
|
||||
cp.execFileSync(
|
||||
installedBin,
|
||||
["bundle", "inspect", "--project", project],
|
||||
{ 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