Skip to content

OpenAI's Codex Security CLI and TypeScript SDK for finding, validating, and fixing security vulnerabilities. npm: https://www.npmjs.com/package/@openai/codex-security

test: make scan fixtures and assertions explicit (#904)

mldangelo-oaicb1739ea94d1
diff --git a/plugins/codex-security/mcp-app/tests/test_deep_scan_artifact_validation.mjs b/plugins/codex-security/mcp-app/tests/test_deep_scan_artifact_validation.mjs
index 2b0bd4391..b80267ac4 100644
--- a/plugins/codex-security/mcp-app/tests/test_deep_scan_artifact_validation.mjs
+++ b/plugins/codex-security/mcp-app/tests/test_deep_scan_artifact_validation.mjs
@@ -202,7 +202,7 @@ async function testReducerValidation(root) {
"worker-001",
draft([firstFinding])
);
- const second = await createWorker(
+ await createWorker(
artifacts,
"discovery-0002",
"worker-002",
diff --git a/plugins/codex-security/tests/test_deep_scan_successful_publication.py b/plugins/codex-security/tests/test_deep_scan_successful_publication.py
index 8a144ece4..a83bb8359 100644
--- a/plugins/codex-security/tests/test_deep_scan_successful_publication.py
+++ b/plugins/codex-security/tests/test_deep_scan_successful_publication.py
@@ -164,7 +164,8 @@ def assert_published_aggregate(scan):
findings = json.loads((scan.scan_dir / "findings.json").read_text())["findings"]
for finding in findings:
for field in ("findingId", "occurrenceId", "fingerprints"):
- assert finding.pop(field)
+ value = finding.pop(field)
+ assert value
assert findings == scan.findings
coverage = json.loads((scan.scan_dir / "coverage.json").read_text())
for field in ("documentType", "schemaVersion", "scanId"):
diff --git a/plugins/codex-security/tests/test_workbench_db.py b/plugins/codex-security/tests/test_workbench_db.py
index f68ccdef9..9cb0301e5 100644
--- a/plugins/codex-security/tests/test_workbench_db.py
+++ b/plugins/codex-security/tests/test_workbench_db.py
@@ -4060,10 +4060,7 @@ def test_completed_finding_projects_writeup_and_poc_artifact_paths(tmp_path: Pat
(fixtures / "payload.txt").write_text("../outside\n")
outside = tmp_path / "outside.txt"
outside.write_text("must not be projected\n")
- try:
- (poc / "outside-link.txt").symlink_to(outside)
- except OSError:
- pass
+ (poc / "outside-link.txt").symlink_to(outside)
completed = run_workbench(state_dir, "complete-scan", "--scan-id", scan_id)
assert completed["scan"]["findings"][0]["artifactPaths"] == [
@@ -4176,7 +4173,6 @@ def test_workbench_preserves_dirty_git_scan_after_worktree_changes(tmp_path: Pat
scan_id = str(started["results"]["scanId"])
contract = started["results"]["contract"]["target"]
assert contract["allowedKinds"] == ["git_worktree"]
- snapshot_digest = str(contract["requiredSnapshotDigest"])
write_completed_contract(
Path(str(started["results"]["scanDir"])),
scan_id,
diff --git a/sdk/typescript/tests-ts/mcp-launcher.test.ts b/sdk/typescript/tests-ts/mcp-launcher.test.ts
index e1e0f3c00..3bc1b09de 100644
--- a/sdk/typescript/tests-ts/mcp-launcher.test.ts
+++ b/sdk/typescript/tests-ts/mcp-launcher.test.ts
@@ -146,7 +146,7 @@ test.each(["server", "helper"] as const)(
env_vars: string[];
};
expect(config.env_vars).toContain("CODEX_MCP_NODE_PATH");
- let managedNode = node;
+ let managedNode: string;
const marker = join(root, "managed-node-used");
if (process.platform !== "win32") {
managedNode = join(root, "managed node");