Windows unit tests fail on main: pnpm-registry-overrides fixtures are checked out as CRLF (mixes CRLF and LF line endings)

未關閉 適合新手
#2,238 1 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

@mikolalysenko 已經在處理了。

開始於 2026年11月25日。

  • #2239 來自 @mikolalysenko —— 未關閉

評估

難度
1/5
預估耗時
1-3 小時
新手友好度
85/100
Issue 類型
缺陷
描述清晰度
描述清楚
活躍度
活躍
技術堆疊
git, rust
領域
testing-qa

研究方向

先閱讀 .gitattributes 中現有 pnpm-hosted/** 和 redirect/** -text 項目旁邊的部分,然後檢查 crates/socket-patch-core/tests/fixtures/pnpm-registry-overrides/ 下的 fixture 樹。失敗的測試位於 crates/socket-patch-core/src/formats/pnpm/registry_alias.rs 和 crates/socket-patch-core/src/hosted/engine.rs;透過 test (windows-latest, 1) job 或 Windows checkout 重現。當這七個測試在位元組級完全相符的 fixture 下通過時即完成。

由索引模型根據 Issue 內容生成。

描述

agent:claimed agent:triaged ci-janitor priority:p1

[agent] PR shepherd: the test (windows-latest, 1) job fails on main at e685fb145 (run 45555390805), and the same 7 tests fail on every PR that runs the Windows tests (for example #2234, job 139041204826). It turns ci-ok (windows only) red. It is separate from #2235, which is the e2e pnpm 11 test.

test formats::pnpm::named_registries::tests::the_planned_file_is_the_one_the_fixtures_were_locked_with ... FAILED
test formats::pnpm::registry_alias::tests::shapes_outside_the_fixtures_are_refused ... FAILED
test formats::pnpm::registry_alias::tests::the_overrides_section_holds_exactly_the_wanted_pins ... FAILED
test formats::pnpm::registry_alias::tests::the_routed_shape_is_what_pnpm_writes ... FAILED
test formats::pnpm::registry_alias::tests::unpinning_one_release_leaves_the_rest ... FAILED
test formats::pnpm::registry_alias::tests::unpinning_restores_the_plain_shape ... FAILED
test hosted::engine::tests::the_registry_route_writes_what_pnpm_writes ... FAILED
test result: FAILED. 8059 passed; 7 failed

panicked at crates\socket-patch-core\src\formats\pnpm\registry_alias.rs:1216:74:
a v9 lock: "mixes CRLF and LF line endings"

panicked at crates\socket-patch-core\src\hosted\engine.rs:8633:13:
assertion `left == right` failed: both-versions
  left:  Some("packages:\n  - '.'\nnamedRegistries:\n ...")
  right: Some("packages:\r\n  - '.'\r\nnamedRegistries:\r\n ...")

Cause. These tests read the tests/fixtures/pnpm-registry-overrides golden fixtures that #2167 (5d8378e) added. .gitattributes marks pnpm-hosted/** and redirect/** as -text, but not pnpm-registry-overrides/**. On a Windows checkout git converts those fixtures to CRLF. The parser then sees mixed line endings, and the byte-exact comparisons fail.

Likely fix. Add crates/socket-patch-core/tests/fixtures/pnpm-registry-overrides/** -text to .gitattributes (with a comment like the existing ones), then confirm with a Windows run of test (windows-latest, 1). The CLI itself is probably fine: a real pnpm lock on Windows has one consistent line ending.


Generated by Claude Code

主要語言
Rust
星號
9
分支
2
平均合併
1 天 8 小時
30 天內合併 PR
309

環境準備

  • 沒有 Dockerfile 或 Docker Compose 檔案
  • 沒有 Pull Request 範本
  • 閱讀貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

SocketDev/socket-patch 的其他 Issue

查看 SocketDev/socket-patch 的全部 Issue

相似的 Issue

更多 Rust Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。