feat(native): add inspection primitives, dispatch traces and approved UI observation (#500)
* fix(hopper): normalize string-backed addresses and update verification * feat(native): add inspection primitives, dispatch traces and approved UI observation * test: prioritize real artifact E2E and captured golden regressions * fix(process): queue observed output before reactive rendering actions * test: prune redundant cases and strengthen boundary assertions * fix(cli): route native value tracing through shared workflows * test: replace synthetic success with real workflows and captured data * fix(catalog): separate portable metadata from native host availability
This commit is contained in:
@@ -0,0 +1,73 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import { assertLinuxPackageProviderFailure } from "../../../scripts/verify-package-platform.mjs";
|
||||
|
||||
const missingDisplay = {
|
||||
code: "provider_unavailable",
|
||||
details: {
|
||||
failure_code: "runtime_dependency_unavailable",
|
||||
exit_code: 79,
|
||||
diagnostics: {
|
||||
component: "hopper_private_display",
|
||||
operation: "probe",
|
||||
reason: "missing_xvfb",
|
||||
status: "error",
|
||||
failure_code: "runtime_dependency_unavailable",
|
||||
strategy: "unavailable",
|
||||
},
|
||||
},
|
||||
};
|
||||
const execution = (failure: unknown, status = 1) => ({
|
||||
status,
|
||||
stdout: JSON.stringify(failure),
|
||||
});
|
||||
|
||||
describe("packaged Linux failure verification", () => {
|
||||
it("accepts the unsupported fixture build or an exact missing display dependency", () => {
|
||||
expect(() =>
|
||||
assertLinuxPackageProviderFailure(execution(missingDisplay)),
|
||||
).not.toThrow();
|
||||
expect(() =>
|
||||
assertLinuxPackageProviderFailure(
|
||||
execution({
|
||||
code: "provider_unavailable",
|
||||
details: { failure_code: "unsupported_hopper_build", exit_code: 72 },
|
||||
}),
|
||||
),
|
||||
).not.toThrow();
|
||||
});
|
||||
|
||||
it.each([
|
||||
execution(missingDisplay, 0),
|
||||
execution({ code: "provider_unavailable" }),
|
||||
execution({
|
||||
...missingDisplay,
|
||||
details: {
|
||||
failure_code: "runtime_dependency_unavailable",
|
||||
exit_code: 79,
|
||||
},
|
||||
}),
|
||||
execution({
|
||||
...missingDisplay,
|
||||
details: {
|
||||
...missingDisplay.details,
|
||||
diagnostics: {
|
||||
...missingDisplay.details.diagnostics,
|
||||
reason: "ownership_mismatch",
|
||||
},
|
||||
},
|
||||
}),
|
||||
execution({
|
||||
...missingDisplay,
|
||||
details: { failure_code: "unsupported_hopper_build", exit_code: 75 },
|
||||
}),
|
||||
execution({ ...missingDisplay, code: "internal_error" }),
|
||||
])(
|
||||
"rejects success, unrelated failures, and incomplete diagnostics: %j",
|
||||
(result) => {
|
||||
expect(() => assertLinuxPackageProviderFailure(result)).toThrow(
|
||||
"did not fail closed",
|
||||
);
|
||||
},
|
||||
);
|
||||
});
|
||||
Reference in New Issue
Block a user