mirror of
https://github.com/morluto/rea.git
synced 2026-11-16 19:53:50 +00:00
test: expect the unknown Evidence subject for resource-only and objdump command records (#11613)
Since #11416 every Evidence record has a subject; one without a file target names identity {kind: unknown, reason: not-observed} with null name and local_path. Four tests that #11416's run did not select still expected subject: null and fail on main: the keyless bundle resource CLI, provider composition and acceptance tests, and the objdump command identity test.
This commit is contained in:
1 parent
dbb4bc29f0
commit
42e808ff76
4 files changed
+25
-5
No files matched your search
@@ -1,3 +1,4 @@
|
||||
import { unknownTarget } from "./domain/targetIdentity.js";
|
||||
import { mkdtemp, mkdir, rm, writeFile } from "node:fs/promises";
|
||||
import { tmpdir } from "node:os";
|
||||
import { join } from "node:path";
|
||||
@@ -52,7 +53,11 @@ it("inspects a keyless app bundle through the public CLI and preserves resource
|
||||
);
|
||||
expect(exitCode, stdout).toBe(0);
|
||||
expect(parseEvidence(JSON.parse(stdout))).toMatchObject({
|
||||
subject: null,
|
||||
subject: {
|
||||
identity: unknownTarget("not-observed"),
|
||||
name: null,
|
||||
local_path: null,
|
||||
},
|
||||
normalized_result: {
|
||||
archive_path: "Resources/Archive.plist",
|
||||
target_sha256: null,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { unknownTarget } from "../../../src/domain/targetIdentity.js";
|
||||
import { evidenceBundleSchema } from "../../../src/domain/evidenceBundle.js";
|
||||
import { build } from "plist";
|
||||
import { lstat, mkdir, writeFile } from "node:fs/promises";
|
||||
@@ -327,7 +328,11 @@ const expectResourceEvidence = (
|
||||
);
|
||||
expect(evidence).toMatchObject({
|
||||
operation,
|
||||
subject: null,
|
||||
subject: {
|
||||
identity: unknownTarget("not-observed"),
|
||||
name: null,
|
||||
local_path: null,
|
||||
},
|
||||
normalized_result: {
|
||||
resource_root: {
|
||||
caller_path: bundle,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { unknownTarget } from "../../../src/domain/targetIdentity.js";
|
||||
import { expect } from "vitest";
|
||||
import { randomUUID } from "node:crypto";
|
||||
import { tmpdir } from "node:os";
|
||||
@@ -45,7 +46,11 @@ cliTest(
|
||||
name: "objdump command",
|
||||
version: null,
|
||||
},
|
||||
subject: null,
|
||||
subject: {
|
||||
identity: unknownTarget("not-observed"),
|
||||
name: null,
|
||||
local_path: null,
|
||||
},
|
||||
});
|
||||
|
||||
const missing = join(tmpdir(), `missing-objdump-${randomUUID()}`);
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { unknownTarget } from "../../../src/domain/targetIdentity.js";
|
||||
import { projectCliAnalysisResult } from "../../../src/cli/projectCliAnalysisResult.js";
|
||||
import { mkdtemp, mkdir, rm, writeFile } from "node:fs/promises";
|
||||
import { tmpdir } from "node:os";
|
||||
@@ -26,7 +27,7 @@ afterEach(async () => {
|
||||
);
|
||||
});
|
||||
|
||||
it("routes a CLI app resource path through the resource session and preserves null target identity", async () => {
|
||||
it("routes a CLI app resource path through the resource session and keeps the target identity unknown", async () => {
|
||||
const bundlePath = await mkdtemp(join(tmpdir(), "rea-cli-resource-root-"));
|
||||
temporaryDirectories.push(bundlePath);
|
||||
await mkdir(join(bundlePath, "Resources"));
|
||||
@@ -63,7 +64,11 @@ it("routes a CLI app resource path through the resource session and preserves nu
|
||||
).then(projectCliAnalysisResult);
|
||||
expect(result).toMatchObject({
|
||||
operation: "inspect_keyed_archive",
|
||||
subject: null,
|
||||
subject: {
|
||||
identity: unknownTarget("not-observed"),
|
||||
name: null,
|
||||
local_path: null,
|
||||
},
|
||||
normalized_result: {
|
||||
target_sha256: null,
|
||||
resource_root: { canonical_path: bundlePath, executable_sha256: null },
|
||||
|
||||
Reference in new issue
Block a user