Public dry run dryrun-750f29790fe2
Source commit: 750f29790fe2046599fbe5b5d06fdb63d92fabff Public tree identity: sha256:02326e08850bb287585789733ea5f3f153e1f7f3fd88afcc24e249107df91506
This commit is contained in:
commit
de66658961
102 changed files with 31669 additions and 0 deletions
76
scripts/flagship-demo-smoke.js
Normal file
76
scripts/flagship-demo-smoke.js
Normal file
|
|
@ -0,0 +1,76 @@
|
|||
#!/usr/bin/env node
|
||||
|
||||
const assert = require("assert");
|
||||
const cp = require("child_process");
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
|
||||
const extension = require("../vscode-extension/extension");
|
||||
|
||||
const repo = path.resolve(__dirname, "..");
|
||||
const project = path.join(repo, "examples/launch-build-demo");
|
||||
const source = fs.readFileSync(path.join(project, "src/build.rs"), "utf8");
|
||||
const forbiddenSourceAssumptions =
|
||||
/\b(?:std::fs|std::process|Command::new|git|podman|docker|localhost|127\.0\.0\.1)|\/home\/|\/Users\/|C:\\Users\\/i;
|
||||
|
||||
const envs = extension.discoverEnvironmentNames(project);
|
||||
assert.deepStrictEqual(envs, ["linux", "windows"]);
|
||||
assert.deepStrictEqual(extension.diagnoseEnvReferences(source, envs), []);
|
||||
assert.doesNotMatch(
|
||||
source,
|
||||
forbiddenSourceAssumptions,
|
||||
"flagship build source must not rely on coordinator-side filesystem, Git, shell, container, or machine-local assumptions"
|
||||
);
|
||||
|
||||
const inspection = JSON.parse(
|
||||
cp.execFileSync(
|
||||
"cargo",
|
||||
[
|
||||
"run",
|
||||
"-q",
|
||||
"-p",
|
||||
"disasmer-cli",
|
||||
"--bin",
|
||||
"disasmer",
|
||||
"--",
|
||||
"bundle",
|
||||
"inspect",
|
||||
"--project",
|
||||
project
|
||||
],
|
||||
{ cwd: repo, encoding: "utf8" }
|
||||
)
|
||||
);
|
||||
|
||||
assert.strictEqual(inspection.project, project);
|
||||
assert.strictEqual(
|
||||
inspection.source_provider_manifest.coordinator_requires_checkout_access,
|
||||
false
|
||||
);
|
||||
assert.strictEqual(
|
||||
inspection.source_provider_manifest.transfer_policy.local_source_bytes_remain_node_local,
|
||||
true
|
||||
);
|
||||
assert.strictEqual(
|
||||
inspection.source_provider_manifest.transfer_policy.coordinator_receives_source_bytes_by_default,
|
||||
false
|
||||
);
|
||||
assert.strictEqual(
|
||||
inspection.source_provider_manifest.transfer_policy.default_full_repo_tarball,
|
||||
false
|
||||
);
|
||||
assert.deepStrictEqual(
|
||||
inspection.source_provider_manifest.transfer_policy.allowed_remote_transfer.sort(),
|
||||
["ExplicitSnapshotChunks", "RequiredContent"]
|
||||
);
|
||||
assert.strictEqual(inspection.metadata.embeds_full_container_images, false);
|
||||
assert(inspection.metadata.environments.some((env) => env.name === "linux"));
|
||||
assert(inspection.metadata.environments.some((env) => env.name === "windows"));
|
||||
assert(inspection.metadata.selected_inputs.some((input) => input.path === "src/build.rs"));
|
||||
|
||||
cp.execFileSync("cargo", ["test", "-p", "launch-build-demo"], {
|
||||
cwd: repo,
|
||||
stdio: "inherit"
|
||||
});
|
||||
|
||||
console.log("Flagship demo smoke passed");
|
||||
Loading…
Add table
Add a link
Reference in a new issue