statechart: relative-symlink launcher test fails on macOS because /var is a symlink

Đang mở Phù hợp với người mới
#1,164 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
72/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
macos, node.js, typescript
Lĩnh vực
cli, testing

Hướng nghiên cứu

Trường hợp đang lỗi là bài kiểm thử có tên 'the launcher reached through an absolute and a relative symlink' trong pstack/skills/statechart/scripts/test/cli.test.ts, khoảng dòng 135. Hãy đọc hàm hỗ trợ linkedLauncher, hàm tạo các liên kết dưới os.tmpdir(), và lệnh gọi path.relative dùng để dựng đích tương đối. Chạy bài kiểm thử với bộ lọc --test-name-pattern trên macOS. Hoàn thành khi thư mục tạm được phân giải bằng realpath trước khi dựng liên kết tương đối và bài kiểm thử pass trên cả macOS và Linux.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

On macOS, the launcher reached through an absolute and a relative symlink writes the committed chart on this Node in pstack/skills/statechart/scripts/test/cli.test.ts fails. The test before it, which reaches the launcher by its own path, passes.

$ node --disable-warning=ExperimentalWarning --test --test-name-pattern="launcher reached" test/cli.test.ts
✔ the launcher reached by its own path writes the committed chart on this Node
✖ the launcher reached through an absolute and a relative symlink writes the committed chart on this Node
  AssertionError [ERR_ASSERTION]: Expected values to be strictly equal:
  undefined !== ''
      at cli.test.ts:135:12

Node v26.13.0, macOS. The scripts are copied verbatim from ae5650f.

Cause. linkedLauncher creates its links under os.tmpdir(), which is /var/folders/... on macOS. /var is a symlink to /private/var. path.relative(second, launcher) computes the relative target lexically from /var/folders/.../b. The kernel resolves the link's .. segments from the physical directory, /private/var/folders/.../b, which is one level deeper, so the relative link points at a path that doesn't exist and the spawn fails.

Possible fix. Resolve the temp directory before building the relative link, for example fs.mkdtempSync(path.join(fs.realpathSync(os.tmpdir()), "statechart-links-")).

Ngôn ngữ chính
TypeScript
Star
14.9k
Fork
1.5k
Merge trung bình
3 giờ 23 phút
Pull request đã merge (30 ngày)
143

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của cursor/plugins

Tất cả issue của cursor/plugins

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.