Files
git.stella-ops.org/src/Bench/StellaOps.Bench/Graph/ui_bench_driver.test.mjs
StellaOps Bot 47168fec38 feat: Add VEX compact fixture and implement offline verifier for Findings Ledger exports
- Introduced a new VEX compact fixture for testing purposes.
- Implemented `verify_export.py` script to validate Findings Ledger exports, ensuring deterministic ordering and applying redaction manifests.
- Added a lightweight stub `HarnessRunner` for unit tests to validate ledger hashing expectations.
- Documented tasks related to the Mirror Creator.
- Created models for entropy signals and implemented the `EntropyPenaltyCalculator` to compute penalties based on scanner outputs.
- Developed unit tests for `EntropyPenaltyCalculator` to ensure correct penalty calculations and handling of edge cases.
- Added tests for symbol ID normalization in the reachability scanner.
- Enhanced console status service with comprehensive unit tests for connection handling and error recovery.
- Included Cosign tool version 2.6.0 with checksums for various platforms.
2025-12-02 21:08:01 +02:00

43 lines
1.8 KiB
JavaScript

import assert from "node:assert";
import { test } from "node:test";
import fs from "node:fs";
import path from "node:path";
import { fileURLToPath } from "node:url";
import { spawnSync } from "node:child_process";
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
test("ui bench driver emits overlay + seed metadata", () => {
const tmp = fs.mkdtempSync(path.join(process.cwd(), "tmp-ui-bench-"));
const fixtureDir = path.join(tmp, "fixture");
fs.mkdirSync(fixtureDir, { recursive: true });
// minimal fixture files
fs.writeFileSync(path.join(fixtureDir, "manifest.json"), JSON.stringify({ hashes: { nodes: "abc" } }));
fs.writeFileSync(path.join(fixtureDir, "overlay.ndjson"), "{\"source\":\"a\",\"target\":\"b\"}\n");
const scenariosPath = path.join(tmp, "scenarios.json");
fs.writeFileSync(
scenariosPath,
JSON.stringify({ version: "1.0.0", scenarios: [{ id: "load", name: "Load", steps: ["navigate"] }] })
);
const outputPath = path.join(tmp, "plan.json");
const env = { ...process.env, UI_BENCH_SEED: "1337", UI_BENCH_TRACE_ID: "trace-test" };
const driverPath = path.join(__dirname, "ui_bench_driver.mjs");
const result = spawnSync(process.execPath, [driverPath, fixtureDir, scenariosPath, outputPath], { env });
assert.strictEqual(result.status, 0, result.stderr?.toString());
const plan = JSON.parse(fs.readFileSync(outputPath, "utf-8"));
assert.strictEqual(plan.fixture, "fixture");
assert.strictEqual(plan.seed, "1337");
assert.strictEqual(plan.traceId, "trace-test");
assert.ok(plan.overlay);
assert.ok(plan.overlay.path.endsWith("overlay.ndjson"));
assert.ok(plan.overlay.sha256);
assert.deepStrictEqual(plan.viewport, { width: 1280, height: 720, deviceScaleFactor: 1 });
fs.rmSync(tmp, { recursive: true, force: true });
});