Public dry run dryrun-2a68aa98149e
Source commit: 2a68aa98149e9042b7975736e002699a0118ece6 Public tree identity: sha256:8aa9c852dc87a3e5469c13fda3134ad19dbc626c8712bb7e019e062616d4a52e
This commit is contained in:
commit
0779e3ecc8
111 changed files with 35316 additions and 0 deletions
108
scripts/wasmtime-node-smoke.js
Normal file
108
scripts/wasmtime-node-smoke.js
Normal file
|
|
@ -0,0 +1,108 @@
|
|||
#!/usr/bin/env node
|
||||
|
||||
const assert = require("assert");
|
||||
const cp = require("child_process");
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
|
||||
const repo = path.resolve(__dirname, "..");
|
||||
const wasmTarget = path.join(
|
||||
repo,
|
||||
"target",
|
||||
"wasm32-unknown-unknown",
|
||||
"debug",
|
||||
"launch_build_demo.wasm"
|
||||
);
|
||||
|
||||
cp.execFileSync(
|
||||
"cargo",
|
||||
["build", "-p", "launch-build-demo", "--target", "wasm32-unknown-unknown"],
|
||||
{ cwd: repo, stdio: "inherit" }
|
||||
);
|
||||
|
||||
assert(fs.existsSync(wasmTarget), `missing compiled Wasm module at ${wasmTarget}`);
|
||||
|
||||
const output = cp.execFileSync(
|
||||
"cargo",
|
||||
[
|
||||
"run",
|
||||
"-q",
|
||||
"-p",
|
||||
"disasmer-node",
|
||||
"--bin",
|
||||
"disasmer-wasmtime-smoke",
|
||||
"--",
|
||||
wasmTarget,
|
||||
"task_add_one",
|
||||
"41",
|
||||
"42",
|
||||
],
|
||||
{ cwd: repo, encoding: "utf8" }
|
||||
);
|
||||
|
||||
const report = JSON.parse(output);
|
||||
assert.strictEqual(report.type, "wasmtime_task_smoke");
|
||||
assert.strictEqual(report.export, "task_add_one");
|
||||
assert.strictEqual(report.arg, 41);
|
||||
assert.strictEqual(report.result, 42);
|
||||
|
||||
const debugOutput = cp.execFileSync(
|
||||
"cargo",
|
||||
[
|
||||
"run",
|
||||
"-q",
|
||||
"-p",
|
||||
"disasmer-node",
|
||||
"--bin",
|
||||
"disasmer-wasmtime-smoke",
|
||||
"--",
|
||||
"--debug-freeze-resume",
|
||||
wasmTarget,
|
||||
"task_add_one",
|
||||
"41",
|
||||
"42",
|
||||
],
|
||||
{ cwd: repo, encoding: "utf8" }
|
||||
);
|
||||
const debugReport = JSON.parse(debugOutput);
|
||||
assert.strictEqual(debugReport.type, "wasmtime_debug_freeze_resume_smoke");
|
||||
assert.strictEqual(debugReport.export, "task_add_one");
|
||||
assert.strictEqual(debugReport.task, "task_add_one");
|
||||
assert.strictEqual(debugReport.frozen_state, "Frozen");
|
||||
assert.strictEqual(debugReport.resumed_state, "Running");
|
||||
assert.deepStrictEqual(debugReport.stack_frames, ["task_add_one::wasm_export"]);
|
||||
assert.strictEqual(debugReport.result, 42);
|
||||
assert.strictEqual(debugReport.node_runtime_reached_wasm_task, true);
|
||||
|
||||
const hostCommandOutput = cp.execFileSync(
|
||||
"cargo",
|
||||
[
|
||||
"run",
|
||||
"-q",
|
||||
"-p",
|
||||
"disasmer-node",
|
||||
"--bin",
|
||||
"disasmer-wasmtime-smoke",
|
||||
"--",
|
||||
"--host-command",
|
||||
],
|
||||
{ cwd: repo, encoding: "utf8" }
|
||||
);
|
||||
const hostCommandReport = JSON.parse(hostCommandOutput);
|
||||
assert.strictEqual(hostCommandReport.type, "wasmtime_host_command_smoke");
|
||||
assert.strictEqual(hostCommandReport.export, "compile-linux");
|
||||
assert.strictEqual(hostCommandReport.export_result, 0);
|
||||
assert.strictEqual(hostCommandReport.virtual_thread, "compile-linux");
|
||||
assert.strictEqual(hostCommandReport.stdout, "linux-build-artifact");
|
||||
assert.strictEqual(
|
||||
hostCommandReport.staged_artifact.path,
|
||||
"/vfs/artifacts/linux/app.tar.zst"
|
||||
);
|
||||
assert.strictEqual(hostCommandReport.large_bytes_uploaded, false);
|
||||
assert.strictEqual(hostCommandReport.manifest_objects, 1);
|
||||
assert.strictEqual(hostCommandReport.node_host_import, "disasmer.cmd_run");
|
||||
assert.strictEqual(hostCommandReport.flagship_linux_build_task, true);
|
||||
assert.strictEqual(hostCommandReport.node_executed_host_command, true);
|
||||
assert.strictEqual(hostCommandReport.hosted_control_plane_ran_command, false);
|
||||
|
||||
console.log("Wasmtime node smoke passed");
|
||||
Loading…
Add table
Add a link
Reference in a new issue