Skip to content

Conversation

chenjiahan
Copy link
Member

Summary

  • Remove hardcoded cwd declarations from test files and use the cwd provided by test context
  • Simplify test configurations by removing redundant cwd options in build calls
  • Update entry paths to use relative paths instead of join

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

@Copilot Copilot AI review requested due to automatic review settings October 6, 2025 14:01
Copy link

netlify bot commented Oct 6, 2025

Deploy Preview for rsbuild ready!

Name Link
🔨 Latest commit 9808dca
🔍 Latest deploy log https://app.netlify.com/projects/rsbuild/deploys/68e3cbc8dfc1fa00086d7917
😎 Deploy Preview https://deploy-preview-6311--rsbuild.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 48 (🔴 down 23 from production)
Accessibility: 97 (no change from production)
Best Practices: 100 (no change from production)
SEO: 100 (no change from production)
PWA: 60 (no change from production)
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Removes redundant cwd usage in E2E tests to rely on the test context, and switches entry paths to relative strings for simplicity.

  • Drop hardcoded cwd declarations and stop passing cwd into build/buildPreview
  • Update entries from join(cwd, 'src/...') to './src/...'
  • Destructure cwd from test context only where file operations require it

Reviewed Changes

Copilot reviewed 18 out of 18 changed files in this pull request and generated no comments.

Show a summary per file
File Description
e2e/cases/server/public-dir/publicDir.test.ts Remove local cwd and stop passing it to build/buildPreview; keep path operations using __dirname.
e2e/cases/server/public-dir-with-template/index.test.ts Remove cwd and call buildPreview without cwd.
e2e/cases/server/public-dir-with-multi-template/index.test.ts Remove cwd and call buildPreview without cwd.
e2e/cases/server/print-urls/index.test.ts Remove cwd and call buildPreview without cwd.
e2e/cases/server/html-fallback/index.test.ts Replace join(cwd, ...) entries with './src/index.js' across tests.
e2e/cases/server/history-api-fallback/historyApiFallback.test.ts Remove cwd/join usage and use './src/index.jsx'; stop passing cwd to buildPreview.
e2e/cases/print-file-size/with-error/index.test.ts Remove cwd and build without it.
e2e/cases/print-file-size/basic/index.test.ts Remove cwd and build without it; keep helper using toPosixPath.
e2e/cases/plugin-react/disable-fast-refresh/index.test.ts Destructure cwd from test context for fs operations; remove local cwd.
e2e/cases/output/clean-dist-path/index.test.ts Build without passing cwd; retain existing cwd for path setup.
e2e/cases/hmr/reconnect/index.test.ts Destructure cwd from test context and remove local cwd.
e2e/cases/hmr/rebuild-logs/index.test.ts Destructure cwd in both tests; remove local cwd.
e2e/cases/hmr/multiple-connection/index.test.ts Destructure cwd and remove local cwd.
e2e/cases/hmr/error-recovery/index.test.ts Destructure cwd and remove local cwd.
e2e/cases/hmr/client-port-placeholder/index.test.ts Destructure cwd and remove local cwd.
e2e/cases/hmr/client-host/index.test.ts Destructure cwd and remove local cwd.
e2e/cases/hmr/basic/index.test.ts Convert to rspackTest(...) form and destructure cwd; remove local cwd.

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

import { join } from 'node:path';
import { expect, getFileContent, test } from '@e2e/helper';
const cwd = __dirname;

P1 Badge Remove unused cwd and join after refactor

After switching the test to use relative entry paths, the join import and const cwd = __dirname declaration at the top of this file are no longer referenced anywhere. The repository’s lint rules (per AGENTS instructions) treat unused imports/variables as errors, so pnpm lint and CI will now fail. Consider removing these declarations to keep the test lint‑clean.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting

@chenjiahan chenjiahan merged commit f841245 into main Oct 7, 2025
12 checks passed
@chenjiahan chenjiahan deleted the test_cwd_1006 branch October 7, 2025 04:03
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