test(breg): postgres_startup needs the tooling feature its required-features does not declare
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 74/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- github-actions, postgresql, rust
- Área
- build-system, testing
Línea de trabajo
Lee crates/registry-breg/Cargo.toml junto con las declaraciones de características de los objetivos de prueba hermanos y, después, examina crates/registry-breg/tests/postgres_startup.rs alrededor de la llamada a runtime_pool_for_test() que no está protegida por una condición y de su definición en crates/registry-breg/src/startup.rs. Reproduce el fallo con el comando indicado cargo check --locked -p registry-breg --features postgres-test --test postgres_startup. El trabajo estará terminado cuando compile el conjunto de características declarado, con la prueba protegida correctamente por una condición o con las características requeridas del objetivo actualizadas.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- Rust
- Estrellas
- 2
- Forks
- 0
- Merge medio
- 9 h 19 min
- PR fusionados (30 d)
- 275
Preparar el entorno
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de registrystack/registry-stack
-
area:breg area:docs documentation
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
registrystack/registry-stack#2302 ·
Los mantenedores suelen responder en 1 día
-
area:docs documentation
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
registrystack/registry-stack#2253 ·
Los mantenedores suelen responder en 1 día
-
area:coordinator bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
registrystack/registry-stack#2252 ·
Los mantenedores suelen responder en 1 día
-
area:release bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
registrystack/registry-stack#2248 ·
Los mantenedores suelen responder en 1 día
-
BReg docs: the WASM upgrade step points at a compatibility member that explain no longer emitsAbiertoarea:breg documentation
Dificultad 1/5 1-3 horas Aptitud para principiantes 88/100
registrystack/registry-stack#2233 ·
Los mantenedores suelen responder en 1 día
Todos los issues de registrystack/registry-stack
Issues similares
-
state:triage-needed
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día
-
bug P2
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
Los mantenedores suelen responder en 1 día
-
cssparser-color: debug assertion in hsl_to_rgb for a hue that overflows f32Posiblemente ocupada @BartWaardenburg la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 64/100
servo/rust-cssparser#460 ·
-
`-w -r <range>` fails empty range but changed working treePosiblemente ocupada @dajiaohuang la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 2 días