Skip to content

test(desktop): make Windows fixtures and cleanup portable - #5071

Merged
orangeCatDeveloper merged 3 commits into
apache:mainfrom
99Gaoxiaoqi:fix/desktop-windows-test-fixtures
Sep 28, 2026
Merged

orangeCatDeveloper merged 3 commits into
apache:mainfrom
99Gaoxiaoqi:fix/desktop-windows-test-fixtures

Conversation

@99Gaoxiaoqi

Copy link
Copy Markdown
Contributor

Summary

Windows Desktop Node tests fail before reaching their assertions because fixtures assume POSIX paths, shell scripts, symlink privileges, and unlocked database files. Match operator fixtures to the host platform, run fake Rive commands with Node, normalize path assertions, use Windows directory junctions, and close the project catalog before cleanup. File-symlink checks skip only on Windows EPERM; the legacy POSIX handoff test is explicitly POSIX-only.

Fixes #5059

Verification

Verified commit: cb661f4951da7f4e6a9da0aa741f97a082cec869.

  • Windows validation recorded with the fix: 52 affected tests passed, 2 capability/platform skips; build, typecheck, lint, format, and Desktop/UI knip checks passed. The full Desktop suite still has the existing session-local POSIX mode assertion failure outside this issue.
  • macOS (Node 26.7.0, npm 11.19.0): clean npm ci, npm run build, and npm --workspace @maka/desktop run test:dist passed: 2,508 tests, 0 failures, 0 skips.
  • Linux and Electron E2E were not run for this verification.

AI use

  • No generative tool made a substantive contribution
  • Generative tooling made a substantive contribution

Tool(s) and scope: OpenAI Codex assisted with the test-fixture implementation, verification, and this PR description. Submitted through Codex on behalf of 99Gaoxiaoqi. The commit contains Generated-by: OpenAI Codex; retain that trailer when squash-merging.

Checklist

  • Tests cover the change and fail without it
  • Lint, format, typecheck and the affected suites pass locally

Does this PR entail a change in behavior?

  • Yes — described under Summary above
  • No — test fixtures and cleanup only; no production behavior changes.

@github-actions github-actions Bot added the effort/M Under 500 readable lines label Sep 9, 2026

@hqhq1025 hqhq1025 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed exact head 409c6af6cb98663a49eabc12fb38f414545761f5.

I found no P0-P3 defect in the eight-file test-only diff. The changes preserve the tested contracts while making fixtures portable: platform-native Node operator paths, Windows directory junctions, normalized relative paths, explicit SQLite catalog closure, and a shell-free Node-based fake Rive CLI. The released POSIX handoff case is explicitly skipped on Windows while the schema-v1 managed receipt migration still runs there with a POSIX fixture path.

Validation on Node 24.18.1:

  • clean npm ci
  • npm run build:test
  • full workspace typecheck
  • affected Desktop tests: 54/54 passed
  • full Desktop Node suite: 2362/2362 passed
  • Windows skip inventory check
  • lint, format check, ASF header audit, changed-file Biome, and git diff --check
  • hosted test is green and is bound to this head

This is not currently ready to merge: the PR is CONFLICTING/DIRTY against current main (6cb8c58084d043f9b87421807fbee1d1ad3bdc03). A clean merge-tree fails in apps/desktop/src/main/__tests__/open-path-guard.test.ts and docs/windows-test-inventory.md; both have changed on main since the PR base, so the branch needs a rebase and the generated inventory must be regenerated and revalidated.

I could not independently execute the suite on Windows. The hosted check runs on Ubuntu, so the author-reported Windows 52-pass / 2-skip result remains unverified here.

Automated review notice: This comment was posted by an automated review agent operated by hqhq1025. It is not an independent human review and does not replace one.

99Gaoxiaoqi and others added 3 commits September 27, 2026 17:29
Match local operator fixtures to the host platform, execute fake Rive
commands with Node, normalize boundary-test paths, and close the project
catalog before removing its database. Use directory junctions on Windows
and explicitly handle unavailable file-symlink and legacy POSIX capabilities.

Windows validation: 52 affected tests pass, 2 capability/platform skips.
Build, typecheck, lint, format, and Desktop/UI knip checks pass.
The full Desktop suite retains the existing session-local POSIX mode
assertion failure outside this issue's scope.

Generated-by: OpenAI Codex
Record the legacy POSIX handoff exclusion added by the portable Desktop test fixtures.

Generated-by: OpenAI Codex
Skill location symlink tests hit the same Windows EPERM as the fixtures fixed here, and the legacy POSIX handoff skip is a platform contract rather than a portability gap.

Generated-by: Claude Code
@orangeCatDeveloper
orangeCatDeveloper force-pushed the fix/desktop-windows-test-fixtures branch from 409c6af to 1649926 Compare September 28, 2026 00:32
@orangeCatDeveloper

orangeCatDeveloper commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

I rebased this onto current main and pushed a follow-up, since the branch had conflicts:

  • Conflict in open-path-guard.test.ts: main renamed the skills fixtures to memory. I kept main's version and reapplied the junction/dir symlink type to both links.
  • Inventory: regenerated docs/windows-test-inventory.md with the script against the new base.
  • Follow-up commit (Generated-by: Claude Code):
    • skill-locations.test.ts has the same bare directory symlink(), so it now uses junctions on Windows too.
    • scripts/windows-test-inventory.mjs now classifies legacy-POSIX skips as platform-contract. The new handoff skip was being labeled portable-candidate.
    • Tightened the fake Rive comment to note it must mirror the rive-cli.ts subcommands.
  • First commit message: dropped the issue ref and the stale "macOS validation is pending" line. The rest of the message and the Generated-by: OpenAI Codex trailer are unchanged.

@orangeCatDeveloper
orangeCatDeveloper merged commit 9e765ab into apache:main Sep 28, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

effort/M Under 500 readable lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test(desktop): full Node suite fails in local Windows platform fixtures and cleanup

3 participants