test(breg): postgres_startup needs the tooling feature its required-features does not declare
Maintainer thường phản hồi trong vòng 1 ngà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
- 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ệ
- github-actions, postgresql, rust
- Lĩnh vực
- build-system, testing
Hướng nghiên cứu
Đọc crates/registry-breg/Cargo.toml cùng với các khai báo tính năng của những đích kiểm thử tương tự, sau đó kiểm tra crates/registry-breg/tests/postgres_startup.rs quanh lời gọi runtime_pool_for_test() không được bảo vệ bằng điều kiện và phần định nghĩa hàm này trong crates/registry-breg/src/startup.rs. Tái hiện lỗi bằng lệnh được báo cáo cargo check --locked -p registry-breg --features postgres-test --test postgres_startup. Công việc hoàn tất khi tập tính năng đã khai báo biên dịch được, với kiểm thử được đặt điều kiện phù hợp hoặc các tính năng bắt buộc của đích được cập nhật.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Problem
The BReg postgres_startup integration target declares required-features = ["postgres-test"], but one of its ungated tests calls a method that exists only with tooling as well. cargo test -p registry-breg --features postgres-test --test postgres_startup therefore fails to compile. CI and products/breg/scripts/test-postgres.sh always pass postgres-test,tooling,schema, so only a local run with the declared feature set hits it.
Where (line numbers on origin/main 0faf3710a; same content on jeremi/documents, where some lines shift)
crates/registry-breg/Cargo.tomllines 556 to 559:[[test]] name = "postgres_startup",required-features = ["postgres-test"]. Its siblingspostgres_migration(lines 114 to 117) andschema_fingerprint_rehearsal(lines 239 to 242) declare["postgres-test", "tooling"].crates/registry-breg/tests/postgres_startup.rsline 874, insideprepared_server_sessions_are_named_bounded_and_pg_stat_statements_stays_unavailable_until_preloaded(lines 820 to 821), which carries nocfg:prepared.runtime_pool_for_test().crates/registry-breg/src/startup.rslines 769 to 772:runtime_pool_for_testis#[cfg(all(feature = "postgres-test", feature = "tooling"))].- The file already gates its other tooling-only tests (
#[cfg(feature = "tooling")]at lines 974, 983, 989 and 1185), so this one looks like a missed gate rather than a policy. - The CI command:
products/breg/scripts/test-postgres.shline 45 (--features postgres-test,tooling,schema, which includes--test postgres_startupat line 100), called from.github/workflows/ci.ymlline 1306.
What goes wrong
A contributor who runs the target with the feature set Cargo.toml declares gets a compile error (no method runtime_pool_for_test) instead of a test run. .github/scripts/check_breg_gated_tests.py does not catch this: it checks that every gated test is selected by some CI command, not that a target compiles with its own required-features.
Proposed direction
Pick one:
- (a) Declare
required-features = ["postgres-test", "tooling"]forpostgres_startup, as its siblings do, and drop the now redundant#[cfg(feature = "tooling")]gates in the file. Simplest; CI already passes both. - (b) Gate the one test with
#[cfg(feature = "tooling")], keeping the rest of the target runnable withpostgres-testalone.
Optionally, add a CI or check_breg_gated_tests.py check that builds each [[test]] with exactly its required-features (cargo check --tests), so the next drift is caught.
Notes
- Confirmed in code: the
required-featuresline, the ungated call at line 874, thecfgonruntime_pool_for_test, and the CI and script feature sets. I checked the other imports and harness items against their gates (migration,package,postgres,startupmodules areruntime; the_for_testhelpers,attachment_store::test_supportandaudit::test_supportarepostgres-test;install_compiled_schemaistoolingorpostgres-test) and found no other tooling-only item outside a gate. I did not build it. - Confirmed by a build on the PR #2305 branch (cargo 1.95.0, macOS):
cargo check --locked -p registry-breg --features postgres-test --test postgres_startupfails with one error,error[E0599]: no method named runtime_pool_for_test found for struct PreparedServer, at line 874, andcould not compile registry-breg (test "postgres_startup") due to 1 previous error. That branch changes these files, but the three pieces involved (therequired-featuresline, thecfgonruntime_pool_for_test, the ungated call) read the same on origin/main; main itself was not built.
- Ngôn ngữ chính
- Rust
- Star
- 2
- Fork
- 0
- Merge trung bình
- 9 giờ 43 phút
- Pull request đã merge (30 ngày)
- 268
Chuẩn bị môi trường
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 registrystack/registry-stack
-
docs(breg): state that the migration role must not hold CREATE on the database in Provision PostgreSQLCó thể đã có người làm @jeremi đã nhận 1 ngày trước. Đang mởarea:breg area:docs documentation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
registrystack/registry-stack#2302 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area:docs documentation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
registrystack/registry-stack#2253 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area:coordinator bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
registrystack/registry-stack#2252 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area:release bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
registrystack/registry-stack#2248 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
BReg docs: the WASM upgrade step points at a compatibility member that explain no longer emitsĐang mởarea:breg documentation
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 88/100
registrystack/registry-stack#2233 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của registrystack/registry-stack
Issue tương tự
-
bug needs triage P3
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
pbakaus/impeccable#1143 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Bundled uv is never updated and trusts the compromised eMudhra certificatesCó thể đã có người làm @FabienDanieau đã nhận hôm nay. Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/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 62/100
foxglove/mcap#1907 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 66/100
Maintainer thường phản hồi trong vòng 1 ngày