Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

test(breg): postgres_startup needs the tooling feature its required-features does not declare

Abierto Apto para principiantes
#2,307 0 comentarios 0 reacciones 0 asignados Ver en GitHub

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

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

area:breg bug

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.toml lines 556 to 559: [[test]] name = "postgres_startup", required-features = ["postgres-test"]. Its siblings postgres_migration (lines 114 to 117) and schema_fingerprint_rehearsal (lines 239 to 242) declare ["postgres-test", "tooling"].
  • crates/registry-breg/tests/postgres_startup.rs line 874, inside prepared_server_sessions_are_named_bounded_and_pg_stat_statements_stays_unavailable_until_preloaded (lines 820 to 821), which carries no cfg: prepared.runtime_pool_for_test().
  • crates/registry-breg/src/startup.rs lines 769 to 772: runtime_pool_for_test is #[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.sh line 45 (--features postgres-test,tooling,schema, which includes --test postgres_startup at line 100), called from .github/workflows/ci.yml line 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"] for postgres_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 with postgres-test alone.

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-features line, the ungated call at line 874, the cfg on runtime_pool_for_test, and the CI and script feature sets. I checked the other imports and harness items against their gates (migration, package, postgres, startup modules are runtime; the _for_test helpers, attachment_store::test_support and audit::test_support are postgres-test; install_compiled_schema is tooling or postgres-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_startup fails with one error, error[E0599]: no method named runtime_pool_for_test found for struct PreparedServer, at line 874, and could not compile registry-breg (test "postgres_startup") due to 1 previous error. That branch changes these files, but the three pieces involved (the required-features line, the cfg on runtime_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

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de registrystack/registry-stack

Todos los issues de registrystack/registry-stack

Issues similares

Más issues de Rust

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.