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

Injectable filesystem roots for core::paths to unit-test first-run flows

Abierto
#461 1 comentario 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
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
48/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Tranquilo
Stack tecnológico
rust
Área
cli, testing

Línea de trabajo

Start with core/paths.rs to trace how config, state, and cache locations are resolved, then read core/first_run.rs and core/test_helpers.rs for apply_selections and ScriptedOnboarding. Add isolated filesystem roots and the described picker regression tests for free-only and Spotify-plus-free selections. Done when tests verify client.yml seeding, active-source persistence, and per-source setup without changing process environment.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

enhancement

Is your feature request related to a problem? Please describe.

The first-run selected-source path has no unit coverage and cannot safely get any today. Everything past the source picker in core/first_run.rs (apply_selections) persists immediately through the real config/state directories: ClientConfig::init_default_spotify_config(), UserConfig::save_config(), and core::state::save(default_state_path()?, ...) all resolve their locations through core::paths, which reads process env (XDG_*). Repo tests deliberately never mutate process env (one process, shared threads), so any test driving this path would write into the developer's actual config directory. Raised during review of #460.

Describe the solution you'd like

Injectable filesystem roots in core::paths (explicit root parameters or a test-only override), so config/state/cache locations can be pointed at a tempdir per test. On top of that:

  • extend ScriptedOnboarding (core/test_helpers.rs) with configurable pick_sources output (it currently always returns None);
  • add regression tests through run_first_run_picker for free-only and Spotify-plus-free selections, covering client.yml seeding, active-source persistence, and per-source setup.

Describe alternatives you've considered

  • Setting XDG_* env vars inside tests: rejected, env is process-global and tests share threads.
  • Extracting more of the flow into pure functions: helps, but the persistence half stays unverified without redirectable paths.

Additional context

Discussion: https://github.com/LargeModGames/spotatui/pull/460#discussion_r3782064232

Lenguaje dominante
Rust
Estrellas
1.4k
Forks
238
Merge medio
8 h 56 min
PR fusionados (30 d)
208

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 LargeModGames/spotatui

Todos los issues de LargeModGames/spotatui

Issues similares

Más issues de Rust

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.