Public release release-01875e88a3e2
Source commit: 01875e88a3e25379c309489f9f057dd97c0d37de Public tree identity: sha256:8f37a1aa0cc8f408975daf9cabbe193f8f4c169c6d25e8795e67a3ed5083c76b
This commit is contained in:
commit
c1769967c1
210 changed files with 78680 additions and 0 deletions
48
scripts/sdk-spawn-runtime-smoke.js
Executable file
48
scripts/sdk-spawn-runtime-smoke.js
Executable file
|
|
@ -0,0 +1,48 @@
|
|||
#!/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 sdk = fs.readFileSync(path.join(repo, "crates/clusterflux-sdk/src/lib.rs"), "utf8");
|
||||
const productRuntime = fs.readFileSync(
|
||||
path.join(repo, "crates/clusterflux-sdk/src/sdk_runtime.rs"),
|
||||
"utf8"
|
||||
);
|
||||
|
||||
assert.match(sdk, /pub struct RuntimeSpawnEvent/);
|
||||
assert.match(sdk, /pub debugger_visible: bool/);
|
||||
assert.match(sdk, /fn register_runtime_thread/);
|
||||
assert.match(sdk, /register_runtime_thread\(id, self\.name, self\.env\)/);
|
||||
assert.match(sdk, /pub fn debugger_visible\(&self\) -> bool/);
|
||||
assert.match(sdk, /ProductRuntimeConfig::from_env\(\)/);
|
||||
assert.match(sdk, /start_remote_task\(\s*config,\s*task_id/);
|
||||
assert.match(sdk, /start_guest_host_task/);
|
||||
assert.match(sdk, /join_remote_task\(remote\)/);
|
||||
assert.doesNotMatch(productRuntime, /"type": "launch_task"/);
|
||||
assert.match(productRuntime, /native SDK task spawning requires coordinator EntrypointV1 execution/);
|
||||
assert.match(productRuntime, /task_start_v1/);
|
||||
assert.match(productRuntime, /task_join_v1/);
|
||||
assert.match(productRuntime, /command_run_v1/);
|
||||
assert.match(productRuntime, /remote_completion_observed/);
|
||||
assert.match(productRuntime, /TaskJoinState::Pending/);
|
||||
assert.doesNotMatch(
|
||||
productRuntime,
|
||||
/entry\s*\(/,
|
||||
"product runtime must not invoke the submitted local Rust closure"
|
||||
);
|
||||
|
||||
cp.execFileSync(
|
||||
"cargo",
|
||||
[
|
||||
"test",
|
||||
"-p",
|
||||
"clusterflux-sdk",
|
||||
"spawn_task_start_registers_debugger_visible_runtime_thread",
|
||||
],
|
||||
{ cwd: repo, stdio: "inherit" }
|
||||
);
|
||||
|
||||
console.log("SDK spawn runtime smoke passed");
|
||||
Loading…
Add table
Add a link
Reference in a new issue