Skip to content

test: simplify temporary test fixtures - #130

Merged
chenjiahan merged 1 commit into
mainfrom
chenjiahan/test-cleanup-temp-directories
Aug 1, 2026
Merged

test: simplify temporary test fixtures#130
chenjiahan merged 1 commit into
mainfrom
chenjiahan/test-cleanup-temp-directories

Conversation

@chenjiahan

Copy link
Copy Markdown
Member

Summary

This PR simplifies test fixture setup and keeps temporary projects in local, Git-ignored test-temp-* directories. It consolidates shared fmt helpers, removes redundant test logic, and isolates temporary projects from parent Git and Rstest discovery.

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying rstack-cli with  Cloudflare Pages  Cloudflare Pages

Latest commit: f47c136
Status: ✅  Deploy successful!
Preview URL: https://87d0dcd6.rstack-cli.pages.dev
Branch Preview URL: https://chenjiahan-test-cleanup-temp.rstack-cli.pages.dev

View logs

@coderabbitai

coderabbitai Bot commented Aug 1, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The changes isolate temporary test projects from repository discovery and Rstest collection. Shared formatting helpers now create Git-backed projects, write fixture files, and clean up directories. Formatting tests use these helpers instead of local implementations. CLI and setup tests create local temporary directories and configure Git ceiling boundaries. Minor test helpers and config reload setup were simplified.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: simplifying temporary test fixture setup.
Description check ✅ Passed The description directly matches the changes by describing fixture simplification, shared helpers, Git isolation, and Rstest exclusion.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chenjiahan/test-cleanup-temp-directories

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/rstack/tests/setup/helpers.ts`:
- Around line 24-32: Sanitize inherited explicit Git repository variables in
both isolated test environments: update the fixture setup around the
GIT_CEILING_DIRECTORIES preservation in
packages/rstack/tests/setup/helpers.ts:24-32 and the corresponding setup in
packages/rstack/tests/cli/setup/index.test.ts:32-36 to remove or temporarily
sanitize those variables, while retaining restoreEnv-based restoration of
GIT_CEILING_DIRECTORIES and all modified environment state.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 54ce8d03-bab5-43c7-a677-bf32b234e6ed

📥 Commits

Reviewing files that changed from the base of the PR and between 21b55e0 and f47c136.

📒 Files selected for processing (14)
  • packages/rstack/rstack.config.ts
  • packages/rstack/tests/cli/fmt/index.test.ts
  • packages/rstack/tests/cli/setup/index.test.ts
  • packages/rstack/tests/cli/staged/fmt.test.ts
  • packages/rstack/tests/config/reload-app-config/index.test.ts
  • packages/rstack/tests/exports/lint-subpath/index.test.ts
  • packages/rstack/tests/exports/test-subpath/index.test.ts
  • packages/rstack/tests/fmt/discoverPaths.test.ts
  • packages/rstack/tests/fmt/discovery.test.ts
  • packages/rstack/tests/fmt/helpers.ts
  • packages/rstack/tests/fmt/runner.test.ts
  • packages/rstack/tests/helpers/cliTest.ts
  • packages/rstack/tests/setup/helpers.ts
  • packages/rstack/tests/setup/hooks.test.ts
💤 Files with no reviewable changes (2)
  • packages/rstack/tests/exports/lint-subpath/index.test.ts
  • packages/rstack/tests/exports/test-subpath/index.test.ts

Comment thread packages/rstack/tests/setup/helpers.ts
@chenjiahan
chenjiahan merged commit fefc003 into main Aug 1, 2026
4 checks passed
@chenjiahan
chenjiahan deleted the chenjiahan/test-cleanup-temp-directories branch August 1, 2026 02:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant