Stryker's vitest runner drops vitest.mutate.config.ts's testNamePattern, so the clock-face test it means to skip still runs

Đang mở
#1,940 1 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ó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
48/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
typescript
Lĩnh vực
testing

Hướng nghiên cứu

Start by reading vitest.mutate.config.ts:13 and ui/src/model/events.test.ts:148, then inspect how the mutation run handles this test under worker threads. The issue points to @stryker-mutator/vitest-runner 10.1.1 overwriting testNamePattern; the reporter says they did not run Stryker. Reproduce the first-run failure and check that a proposed fix keeps the clock-face test from failing in the mutation run.

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

Mô tả

bug:needs-info

vitest.mutate.config.ts:13 sets testNamePattern to leave out ui/src/model/events.test.ts:148 ("is its time of day on the browser's clock face"), because that test sets process.env.TZ, which a worker thread ignores.

@stryker-mutator/vitest-runner 10.1.1 overwrites that pattern on every project in each run without test ids, the dry run included (node_modules/@stryker-mutator/vitest-runner/dist/src/vitest-test-runner.js:216-219):

this.ctx.projects.forEach((project) => {
    project.config.testNamePattern = undefined;
});

So the dry run runs the clock-face test anyway. In the thread pool it fails:

$ pnpm exec vitest run --config vitest.mutate.config.ts --pool threads ui/src/model/events.test.ts -t "clock face"
× is its time of day on the browser's clock face
AssertionError: expected '13:30:00' to be '17:00:00'

I read this from the runner's code and did not run Stryker (agents may not). If it holds, a pnpm mutate run whose test files include ui/src/model/events.test.ts (a mutant in ui/src/model/events.ts or something it imports) fails its first run. Possible fixes: exclude the test some other way (for example a skipIf on worker threads), or make it not depend on process.env.TZ.

Found while triaging #1938.

Written by an agent.

Ngôn ngữ chính
TypeScript
Star
730
Fork
44
Merge trung bình
16 giờ 13 phút
Pull request đã merge (30 ngày)
387

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 callstackincubator/simlock

Tất cả issue của callstackincubator/simlock

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.