cache_invalidation_files with `**` doesn't catch files at the top of the directory
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
- 74/100
Hướng nghiên cứu
Bắt đầu bằng cách lần theo cách cache_invalidation_files được mở rộng thành watched_file_hashes và cách _changed_hashed_files(restrict_to=...) lọc các đường dẫn đó; so sánh hai hành vi khớp được mô tả trong issue. Tái hiện bằng các tệp ở cấp cao nhất và trong thư mục lồng nhau dưới tests, sau đó kiểm tra rằng cả hai đều kích hoạt chạy lại với mẫu đệ quy. Issue không nêu tên tệp kiểm thử, vì vậy hãy tìm hoặc thêm một kiểm thử hồi quy tập trung cho cả hai đường dẫn.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
mutmut 3.8.0 (the same matching code is still on master)
I tried this as a workaround for #626:
cache_invalidation_files = ["tests/**/*.py"]
on_dependency_change = "rerun"
It works for tests/sub/test_deep.py:
1 non-Python file(s) changed; rerunning all mutants: tests/sub/test_deep.py
calc.ops.x_is_adult__mutmut_1: survived
calc.ops.x_is_adult__mutmut_2: survived
but not for tests/test_ops.py. With the script from #626 (bash repro.sh watch) the warm run
still says killed and doesn't print the "rerunning" line.
The baseline is built with Path(".").glob("tests/**/*.py"), where ** can match zero
directories, so tests/test_ops.py does end up in watched_file_hashes. But
_changed_hashed_files(restrict_to=cfg.cache_invalidation_files) then filters with
fnmatch, and for fnmatch **/ needs a literal slash:
>>> from fnmatch import fnmatch
>>> fnmatch("tests/test_ops.py", "tests/**/*.py")
False
>>> fnmatch("tests/a/b.py", "tests/**/*.py")
True
So the file is dropped, and _changed_hashed_files() returns an empty set even though the hash
changed. A top-level tests/conftest.py would never trigger a rerun either.
"tests/*.py" on its own has the opposite problem: the top-level file is caught, but the glob
doesn't recurse, so files in sub-directories never get into the baseline. Listing both works:
tests/**/*.py top-level: missed tests/sub/: caught
tests/*.py top-level: caught tests/sub/: missed
tests/*.py + tests/**/*.py top-level: caught tests/sub/: caught
(checked each combination against a weakened test at both locations)
A fix could be to use the same matching in both places, e.g. PurePath.full_match() on 3.13+,
or check membership in the paths the glob returned.
- Ngôn ngữ chính
- Python
- Star
- 1.5k
- Fork
- 191
- Merge trung bình
- 1 ngày 7 giờ
- Pull request đã merge (30 ngày)
- 9
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của boxed/mutmut
-
Removing `not` from a parenthesized multi-line expression drops the parentheses (InvalidGeneratedSyntaxException, 3.8.0)Có thể đã có người làm @jihtsan đã nhận 19 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
boxed/mutmut#602 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
`run` with a `name__mutmut_*` pattern runs the whole test suite in the clean-test checkCó thể đã có người làm @Ishaan400 đã nhận 30 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
boxed/mutmut#592 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Invalid unary plus generated in match statementCó thể đã có người làm @GhostCoder6969 đã nhận 39 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày
-
What do the emoji's mean?Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
boxed/mutmut#560 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
boxed/mutmut#529 · 7 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
adafruit/Fruit-Jam-OS#98 ·
-
python triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
microsoft/semantic-kernel#14753 ·
Maintainer thường phản hồi trong vòng 5 ngày
-
area:cli area:configuration documentation priority:low size:small
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 80/100
RonaldHensbergen/composable-data-stack#1222 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug python
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
pvlib/pvlib-python#2939 ·
Maintainer thường phản hồi trong vòng 1 ngày