Graph-check unit tests fail under direct pytest because logger fixtures assume Bazel runfiles
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
- #1000 của @AlexanderLanin — đã đóng, không merge
Đá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
- 78/100
Hướng nghiên cứu
Bắt đầu bằng cách chạy .venv_docs/bin/python -m pytest src/extensions/score_metamodel/tests/test_graph_checks.py -q với RUNFILES_DIR và RUNFILES_MANIFEST_FILE chưa được đặt để tái hiện sáu lỗi. Đọc fake_check_logger() trong src/extensions/score_metamodel/tests/__init__.py và CheckLogger._location() trong src/extensions/score_metamodel/log.py; fixture cung cấp một tiền tố đường dẫn MagicMock mà các vị trí không thuộc Bazel tiết lộ. Hoàn thành nghĩa là cả sáu assertion về vị trí đều đạt dưới pytest trực tiếp trong khi bazel test //src/extensions/score_metamodel:unit_tests vẫn đạt.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Graph-check unit tests fail when invoked directly through pytest, although the Bazel unit-test target passes. Developers should be able to run these tests through pytest, including from an IDE, without a Bazel runfiles environment.
Reproduction
Reproduced on a clean snapshot of main at 946fd135045841db63e18ffd532374963e84a220, using Python 3.12.12 and pytest 9.1.1.
After preparing the development environment:
bazel run //:ide_support
.venv_docs/bin/python -m pytest src/extensions/score_metamodel/tests/test_graph_checks.py -q
Run from a normal shell with RUNFILES_DIR and RUNFILES_MANIFEST_FILE unset.
Actual result
6 failed, 17 passed:
test_eval_need_check_missing_attribute_logs_and_returns_falsetest_check_all_warns_once_per_failing_parenttest_check_one[none_fulfill]test_check_one[no_parents]test_check_one[unknown_parent]test_info_only_keeps_message
The failures are location assertions. For example:
Expected: docname.rst:42
Actual: <MagicMock id='...'>/docname.rst:42
For comparison, the normal Bazel invocation passes all 109 tests:
bazel test //src/extensions/score_metamodel:unit_tests
Cause
fake_check_logger() passes a MagicMock as the logger's path prefix, while its assertions expect docname.rst:42.
CheckLogger._location() omits that prefix in a Bazel runfiles environment. Outside Bazel, it includes the prefix, exposing the mock in the location string and causing the assertions to fail.
Expected result
- The graph-check unit tests pass through both direct pytest and Bazel invocations.
- Logger fixtures and location assertions work without externally supplied Bazel runfiles variables, while retaining meaningful verification of diagnostic locations.
- Ngôn ngữ chính
- Python
- Star
- 11
- Fork
- 37
- Merge trung bình
- 1 ngày 1 giờ
- Pull request đã merge (30 ngày)
- 61
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Không 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 eclipse-score/docs-as-code
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
eclipse-score/docs-as-code#920 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
drop buildifier_prebuilt dependencyCó thể đã có người làm @Logeshwari-Sithan đã nhận 5 ngày trước. Đang mởgood first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
eclipse-score/docs-as-code#917 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Add project name to headline ...Có thể làm lại được Pull request cho issue này đã bị đóng mà không được merge. Đang mởdocumentation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
eclipse-score/docs-as-code#613 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
update py_venvĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
eclipse-score/docs-as-code#606 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug waiting_for_author
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
eclipse-score/docs-as-code#288 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của eclipse-score/docs-as-code
Issue tương tự
-
PluginProvider.storeInstance races and clobbers the dedup cache for concurrent loadsCó thể đã có người làm @Wilson0511 đã nhận hôm nay. Đang mởneeds-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
Maintainer thường phản hồi trong vòng 2 ngày
-
community documentation good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/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
-
bug(sdk): add_toleration_json silently drops camelCase tolerationSeconds for static dict/list inputCó thể đã có người làm @ravikumar266 đã nhận hôm nay. Đang mởarea/sdk kind/bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
kubeflow/pipelines#15347 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
predict_file with crop_model duplicates predictions once per imageCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
weecology/DeepForest#1445 ·