[PR #1394] [MERGED] test(native): skip the EACCES directory diagnostic as root #2851

Closed
opened 2026-10-17 21:11:02 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/1394
Author: @marnixpluim
Created: 10/10/2026
Status: ✅ Merged
Merged: 10/11/2026
Merged by: @morluto

Base: main ← Head: test/skip-eacces-diagnostic-as-root


📝 Commits (1)

  • 0f25b56 test(native): skip the EACCES directory diagnostic as root

📊 Changes

1 file changed (+1 additions, -1 deletions)

View changed files

📝 tests/boundary/providers/native/artifactProvider.directoryErrors.test.ts (+1 -1)

📄 Description

Requested by Marnix · project thread

Summary

artifactProvider.directoryErrors.test.ts makes a member unreadable with mode 0 and expects inventory to fail with EACCES. Root ignores file permissions, so in a container that runs tests as root, such as a default Docker container, inventory succeeds and the test fails. This skips it as root, with the same guard the other permission-dependent boundary tests already use.

No issue is linked: it is a one-line test guard.

Problem and expected behavior

Trigger: npx vitest run tests/boundary/providers/native/artifactProvider.directoryErrors.test.ts as uid 0 on Linux. Expected: skipped, as for tests/boundary/filesystem/binaryTarget.test.ts and tests/boundary/browser/historicalCaptureDecoder.test.ts. On 7aa4d768 it fails, because reading the mode-0 file succeeds.

Change and scope

it.skipIf(process.platform === "win32") becomes it.skipIf(process.platform === "win32" || process.getuid?.() === 0). Nothing else changes; non-root runs still execute the test.

Contract and boundary impact

  • Semantic owner and earliest changed stage: test only.
  • CLI and MCP/tool-catalog contract: none.
  • Provider, bridge, target-format, or platform compatibility: none.
  • Evidence, artifact, provenance, or reconstruction contract: none.
  • Process execution, authorization, cleanup, or containment impact: none.
  • Generated metadata (docs/public/product-catalog.json), package, or installation impact: none.

Evidence and regression coverage

  • Tests added or updated: tests/boundary/providers/native/artifactProvider.directoryErrors.test.ts (guard only).
  • Base reproduction or other evidence: as root on 7aa4d768 the test fails at expect(result.ok).toBe(false) (expected true to be false), because inventory reads the mode-0 member without error. With this change it is skipped as root. For non-root users the guard is unchanged, so the test still runs.
  • User-visible CLI/MCP output (if applicable): not applicable.
  • Remaining proof gaps: none.

Validation performed

  • npx vitest run tests/boundary/providers/native/artifactProvider.directoryErrors.test.ts as root: 1 skipped (on 7aa4d768: 1 failed)
  • Full suite on the four branches from this Hermes Desktop run, merged (npm run test:prepare, then npx vitest run; root, Linux x64, Node 22.22): 6,246 tests passed, 114 skipped, 1 failed. The failure is analysisSelectorCli.test.ts "rejects missing and conflicting selectors before opening a target": it starts the CLI 12 times, hit its 30 s timeout under the parallel run, and passes alone in 27.6 s. It covers CLI argument parsing, which these changes don't touch.

Compatibility, safety, and release

  • Breaking changes or migration steps: none.
  • Real Hopper/Ghidra, browser, or OS coverage: not applicable.
  • Package or release metadata impact: none.
  • Security, privacy, process, or containment review: none.

Review checklist

  • This PR addresses a concrete problem or an agreed enhancement.
  • The PR has one focused outcome and the title follows type(scope): outcome.
  • Related issue is linked, or the reason for not linking one is stated above.
  • Tests cover changed observable behavior and meaningful failure paths.
  • Owning docs, contracts, and generated metadata are updated where needed.
  • User-visible CLI/MCP changes include representative output.
  • I checked the final diff for secrets, unrelated cleanup, and unsupported claims.

🤖 Generated with Claude Code

https://claude.ai/code/session_01XPY2GmufMNGQKoEgRUx1pd


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/morluto/rea/pull/1394 **Author:** [@marnixpluim](https://github.com/marnixpluim) **Created:** 10/10/2026 **Status:** ✅ Merged **Merged:** 10/11/2026 **Merged by:** [@morluto](https://github.com/morluto) **Base:** `main` ← **Head:** `test/skip-eacces-diagnostic-as-root` --- ### 📝 Commits (1) - [`0f25b56`](https://github.com/morluto/rea/commit/0f25b5662b3556295587e7d87a448dfe8517744b) test(native): skip the EACCES directory diagnostic as root ### 📊 Changes **1 file changed** (+1 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `tests/boundary/providers/native/artifactProvider.directoryErrors.test.ts` (+1 -1) </details> ### 📄 Description <!-- claude-projects-attribution: {"github_login":"marnixpluim"} --> _Requested by **Marnix** · [project thread](https://claude.ai/code/project/chan_015mc63Gczn836s2xXzmeLLa?thread=cmsg_015mc63Gczn836s2xXzmeLLa375aS21D2UMwQouWTw67kh)_ ## Summary `artifactProvider.directoryErrors.test.ts` makes a member unreadable with mode 0 and expects inventory to fail with `EACCES`. Root ignores file permissions, so in a container that runs tests as root, such as a default Docker container, inventory succeeds and the test fails. This skips it as root, with the same guard the other permission-dependent boundary tests already use. No issue is linked: it is a one-line test guard. ## Problem and expected behavior Trigger: `npx vitest run tests/boundary/providers/native/artifactProvider.directoryErrors.test.ts` as uid 0 on Linux. Expected: skipped, as for `tests/boundary/filesystem/binaryTarget.test.ts` and `tests/boundary/browser/historicalCaptureDecoder.test.ts`. On `7aa4d768` it fails, because reading the mode-0 file succeeds. ## Change and scope `it.skipIf(process.platform === "win32")` becomes `it.skipIf(process.platform === "win32" || process.getuid?.() === 0)`. Nothing else changes; non-root runs still execute the test. ## Contract and boundary impact - Semantic owner and earliest changed stage: test only. - CLI and MCP/tool-catalog contract: none. - Provider, bridge, target-format, or platform compatibility: none. - Evidence, artifact, provenance, or reconstruction contract: none. - Process execution, authorization, cleanup, or containment impact: none. - Generated metadata (`docs/public/product-catalog.json`), package, or installation impact: none. ## Evidence and regression coverage - Tests added or updated: `tests/boundary/providers/native/artifactProvider.directoryErrors.test.ts` (guard only). - Base reproduction or other evidence: as root on `7aa4d768` the test fails at `expect(result.ok).toBe(false)` (`expected true to be false`), because inventory reads the mode-0 member without error. With this change it is skipped as root. For non-root users the guard is unchanged, so the test still runs. - User-visible CLI/MCP output (if applicable): not applicable. - Remaining proof gaps: none. ## Validation performed - `npx vitest run tests/boundary/providers/native/artifactProvider.directoryErrors.test.ts` as root: 1 skipped (on `7aa4d768`: 1 failed) - Full suite on the four branches from this Hermes Desktop run, merged (`npm run test:prepare`, then `npx vitest run`; root, Linux x64, Node 22.22): 6,246 tests passed, 114 skipped, 1 failed. The failure is `analysisSelectorCli.test.ts` "rejects missing and conflicting selectors before opening a target": it starts the CLI 12 times, hit its 30 s timeout under the parallel run, and passes alone in 27.6 s. It covers CLI argument parsing, which these changes don't touch. ## Compatibility, safety, and release - Breaking changes or migration steps: none. - Real Hopper/Ghidra, browser, or OS coverage: not applicable. - Package or release metadata impact: none. - Security, privacy, process, or containment review: none. ## Review checklist - [x] This PR addresses a concrete problem or an agreed enhancement. - [x] The PR has one focused outcome and the title follows `type(scope): outcome`. - [x] Related issue is linked, or the reason for not linking one is stated above. - [x] Tests cover changed observable behavior and meaningful failure paths. - [x] Owning docs, contracts, and generated metadata are updated where needed. - [x] User-visible CLI/MCP changes include representative output. - [x] I checked the final diff for secrets, unrelated cleanup, and unsupported claims. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01XPY2GmufMNGQKoEgRUx1pd --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-17 21:11:02 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#2851
No description provided.