On Windows, `report.test.ts`'s unwritable-folder case creates `\dev\null\nope` at the drive root instead of meeting an unwritable folder
メンテナーはふだん 1 日以内に返信
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 83/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- node.js, typescript
- 領域
- testing
調査の方向性
「never throws when the directory cannot be written」のケース付近にある packages/jest/src/diagnostics/__tests__/report.test.ts と、再帰的な fs.mkdir 呼び出し付近にある packages/jest/src/diagnostics/report.ts を読んでください。issue では、テストの一時フォルダー内のファイルを projectRoot として使うことが提案されています。Windows で対象を絞った Vitest のケースを実行し、ドライブのルートに何も作成せずに引き続き成功することを確認してください。
索引モデルが issue の本文から書いたものです。
説明
Describe the bug
never throws when the directory cannot be written hands the diagnostics appender projectRoot: '/dev/null/nope' (report.test.ts), a folder no write reaches on Linux and macOS, where /dev/null is a device. On Windows Node resolves it against the root of the drive the run is on, and the appender's fs.mkdir(dir, { recursive: true }) (report.ts) creates it. So the case passes without meeting an unwritable folder, and leaves \dev\null\nope\.harness\diagnostics\unwritable.jsonl behind, holding the marks a and b.
While that folder exists, Windows programs that open /dev/null as a path from that drive open the folder instead: Git for Windows' git diff --no-index /dev/null <file> fails with error: Could not access '/dev/null/<file>'.
A projectRoot below a regular file fails the same way on every platform (ENOTDIR), so a file the test writes in its temporary folder would keep the case's premise on Windows too.
System Info
System:
OS: Windows 11 10.0.26300
Binaries:
Node: 26.12.1
pnpm: 10.6.1
React Native Harness Version
main at 26b67ea4
Reproduction
Steps to reproduce
- On Windows, in a checkout of
main:pnpm install, thenpnpm vitest run packages/jest/src/diagnostics/__tests__/report.test.ts -t "never throws when the directory cannot be written". - The case passes:
Tests 1 passed | 26 skipped (27). dir /s /b \devon the drive the run is on lists what it made. I ran it from a drive mapped withsubst,X:, so the folder landed there:
X:\dev\null
X:\dev\null\nope
X:\dev\null\nope\.harness
X:\dev\null\nope\.harness\diagnostics
X:\dev\null\nope\.harness\diagnostics\unwritable.jsonl
unwritable.jsonl:
{"label":"a","startTime":1793230779050.4949,"duration":0,"status":"ok","kind":"mark"}
{"label":"b","startTime":1793230779052.054,"duration":0,"status":"ok","kind":"mark"}
Expected: the case meets a folder it cannot write, as on Linux and macOS, and leaves nothing outside its temporary folder.
Actual: the case passes after creating the folders above at the root of the drive the run is on, with the two marks in unwritable.jsonl.
- 主要言語
- TypeScript
- スター
- 335
- フォーク
- 23
- 平均マージ
- 1日 8時間
- マージ済み PR(30日)
- 54
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
callstackincubator/react-native-harness のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
callstackincubator/react-native-harness#296 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
callstackincubator/react-native-harness#128 ·
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 58/100
callstackincubator/react-native-harness#303 ·
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 52/100
callstackincubator/react-native-harness#300 ·
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 72/100
callstackincubator/react-native-harness#299 ·
メンテナーはふだん 1 日以内に返信
callstackincubator/react-native-harness の issue をすべて見る
似ている issue
-
Shell: serve the home app's Cookie Policy on a hard reload対応中かも @2001anshkaushik が今日担当しました。 オープンfeature module:ai
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
rocketride-org/rocketride-server#2899 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
wazuh/wazuh-dashboard-plugins#9551 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
gofish-graphics/gofish-graphics#1252 ·
メンテナーはふだん 1 日以内に返信
-
optimization P3 size:XS
難易度 1/5 1〜3時間 初心者へのやさしさ 88/100
josephfung/curia#2366 ·
メンテナーはふだん 1 日以内に返信
-
type:bug
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
nightgauge/nightgauge#2688 ·
メンテナーはふだん 1 日以内に返信