[PR #1254] [MERGED] [codex] Harden local test scripts #5004

Closed
opened 2026-10-22 04:12:23 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/1254
Author: @Xelvanis
Created: 5/26/2026
Status: ✅ Merged
Merged: 5/26/2026
Merged by: @undefined

Base: refactor ← Head: codex/harden-local-test-scripts


📝 Commits (1)

  • 50abfed harden local test scripts

📊 Changes

6 files changed (+51 additions, -8 deletions)

View changed files

📝 .github/workflows/ci.yml (+1 -1)
📝 README.md (+9 -0)
📝 docs/developer/run-build.html (+12 -0)
📝 package.json (+4 -2)
📝 playwright.config.ts (+25 -4)
📝 vitest.config.ts (+0 -1)

📄 Description

## Linked issue

No linked issue; cleanup/chore from local test-script audit.

Why this change

The local test commands had two weak failure paths:

  • pnpm test allowed an empty Vitest suite to pass, which could hide broken test globs or accidental test removal.
  • Playwright smoke tests could reuse an already-running preview server on the default Vite preview port, which could accidentally test stale output or fail unclearly when the port was occupied.

What changed

  • Make pnpm test fail when no tests are collected.
  • Add pnpm test:allow-empty for the rare intentional empty-suite case.
  • Make pnpm test:ui build first, then run Playwright.
  • Add pnpm test:ui:run for CI or local flows that already built dist/.
  • Move Playwright preview to port 4175 by default, start a fresh strict preview server, and allow PLAYWRIGHT_PORT overrides.
  • Validate PLAYWRIGHT_PORT so invalid values fail with a clear config error.
  • Document the updated commands in README.md and docs/developer/run-build.html.

Refactor impact

Primary owner:

Testing/tooling and developer docs.

Impact areas reviewed:

  • Package scripts
  • Vitest config
  • Playwright config
  • CI browser smoke job
  • Developer verification docs

Boundary notes:

No product runtime, engine, shared API, mode owner, Rust, storage, provider, or remote-runtime boundaries changed.

Pressure points touched:

None. This PR only changes test tooling, CI command wiring, and docs.

Validation

  • pnpm check passes locally
  • pnpm typecheck passes locally
  • pnpm build passes locally
  • pnpm check:architecture passes locally
  • pnpm check:docs passes locally
  • cargo check --manifest-path src-tauri/Cargo.toml --workspace passes locally
  • Rust clippy/tests were run for Rust behavior changes
  • Browser or Tauri app manual verification completed
  • Playwright, screenshot, or recording evidence added for UI changes
  • Remote runtime smoke checked when relevant

Manual verification notes

Commands run locally:

  • pnpm test
  • pnpm typecheck
  • pnpm check:docs
  • pnpm test:ui
  • pnpm test:ui:run
  • pnpm exec vitest run tests/__definitely_missing__/**/*.test.ts failed as expected when no tests were collected.
  • pnpm exec vitest run --passWithNoTests tests/__definitely_missing__/**/*.test.ts passed as expected for the explicit allow-empty path.
  • PLAYWRIGHT_PORT=abc pnpm exec playwright test --list failed as expected with PLAYWRIGHT_PORT must be an integer from 1 to 65535.
  • git diff --check passed, with only Git CRLF warnings.

Docs and release impact

  • No docs changes needed
  • Updated README.md
  • Updated CONTRIBUTING.md
  • Updated docs/developer/
  • Updated repo skills or AGENTS.md
  • Confirmed this PR does not restore old staging/package-workspace/release claims

Docs changed: README.md and docs/developer/run-build.html.

No CHANGELOG.md exists in this branch, and this is not user-facing product behavior.

UI evidence

N/A. No visible UI behavior changed.

Summary by CodeRabbit

  • Documentation

    • Updated validation checks documentation to include test commands.
    • Added browser smoke test guidelines with Playwright port configuration guidance.
  • Chores

    • Refined test script organization for improved testing workflows.
    • Enhanced browser test server configuration with environment-based port customization.

Review Change Stack


🔄 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/Pasta-Devs/Marinara-Engine/pull/1254 **Author:** [@Xelvanis](https://github.com/Xelvanis) **Created:** 5/26/2026 **Status:** ✅ Merged **Merged:** 5/26/2026 **Merged by:** [@undefined](undefined) **Base:** `refactor` ← **Head:** `codex/harden-local-test-scripts` --- ### 📝 Commits (1) - [`50abfed`](https://github.com/Pasta-Devs/Marinara-Engine/commit/50abfede3e62a51fb5eb9a495ba14a0fff2b1a2c) harden local test scripts ### 📊 Changes **6 files changed** (+51 additions, -8 deletions) <details> <summary>View changed files</summary> 📝 `.github/workflows/ci.yml` (+1 -1) 📝 `README.md` (+9 -0) 📝 `docs/developer/run-build.html` (+12 -0) 📝 `package.json` (+4 -2) 📝 `playwright.config.ts` (+25 -4) 📝 `vitest.config.ts` (+0 -1) </details> ### 📄 Description ## Linked issue No linked issue; cleanup/chore from local test-script audit. ## Why this change The local test commands had two weak failure paths: - `pnpm test` allowed an empty Vitest suite to pass, which could hide broken test globs or accidental test removal. - Playwright smoke tests could reuse an already-running preview server on the default Vite preview port, which could accidentally test stale output or fail unclearly when the port was occupied. ## What changed - Make `pnpm test` fail when no tests are collected. - Add `pnpm test:allow-empty` for the rare intentional empty-suite case. - Make `pnpm test:ui` build first, then run Playwright. - Add `pnpm test:ui:run` for CI or local flows that already built `dist/`. - Move Playwright preview to port `4175` by default, start a fresh strict preview server, and allow `PLAYWRIGHT_PORT` overrides. - Validate `PLAYWRIGHT_PORT` so invalid values fail with a clear config error. - Document the updated commands in `README.md` and `docs/developer/run-build.html`. ## Refactor impact Primary owner: Testing/tooling and developer docs. Impact areas reviewed: - Package scripts - Vitest config - Playwright config - CI browser smoke job - Developer verification docs Boundary notes: No product runtime, engine, shared API, mode owner, Rust, storage, provider, or remote-runtime boundaries changed. Pressure points touched: None. This PR only changes test tooling, CI command wiring, and docs. ## Validation <!-- Checkboxes intentionally left unchecked for human verification per repo workflow. Commands actually run are listed below. --> - [x] `pnpm check` passes locally - [x] `pnpm typecheck` passes locally - [x] `pnpm build` passes locally - [x] `pnpm check:architecture` passes locally - [x] `pnpm check:docs` passes locally - [ ] `cargo check --manifest-path src-tauri/Cargo.toml --workspace` passes locally - [ ] Rust clippy/tests were run for Rust behavior changes - [ ] Browser or Tauri app manual verification completed - [ ] Playwright, screenshot, or recording evidence added for UI changes - [ ] Remote runtime smoke checked when relevant ### Manual verification notes Commands run locally: - `pnpm test` - `pnpm typecheck` - `pnpm check:docs` - `pnpm test:ui` - `pnpm test:ui:run` - `pnpm exec vitest run tests/__definitely_missing__/**/*.test.ts` failed as expected when no tests were collected. - `pnpm exec vitest run --passWithNoTests tests/__definitely_missing__/**/*.test.ts` passed as expected for the explicit allow-empty path. - `PLAYWRIGHT_PORT=abc pnpm exec playwright test --list` failed as expected with `PLAYWRIGHT_PORT must be an integer from 1 to 65535`. - `git diff --check` passed, with only Git CRLF warnings. ## Docs and release impact - [ ] No docs changes needed - [x] Updated `README.md` - [ ] Updated `CONTRIBUTING.md` - [x] Updated `docs/developer/` - [ ] Updated repo skills or `AGENTS.md` - [x] Confirmed this PR does not restore old staging/package-workspace/release claims Docs changed: `README.md` and `docs/developer/run-build.html`. No `CHANGELOG.md` exists in this branch, and this is not user-facing product behavior. ## UI evidence N/A. No visible UI behavior changed. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Documentation** * Updated validation checks documentation to include test commands. * Added browser smoke test guidelines with Playwright port configuration guidance. * **Chores** * Refined test script organization for improved testing workflows. * Enhanced browser test server configuration with environment-based port customization. <!-- review_stack_entry_start --> [![Review Change Stack](https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg)](https://app.coderabbit.ai/change-stack/Pasta-Devs/Marinara-Engine/pull/1254?utm_source=github_walkthrough&utm_medium=github&utm_campaign=change_stack) <!-- review_stack_entry_end --> <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-22 04:12:23 +07: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
Pasta-Devs/Marinara-Engine#5004
No description provided.