Injectable filesystem roots for core::paths to unit-test first-run flows
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
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
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 configurablepick_sourcesoutput (it currently always returnsNone); - add regression tests through
run_first_run_pickerfor free-only and Spotify-plus-free selections, coveringclient.ymlseeding, 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
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
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 LargeModGames/spotatui
-
bug good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
LargeModGames/spotatui#878 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 90/100
LargeModGames/spotatui#872 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
bug good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 92/100
LargeModGames/spotatui#871 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
documentation good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
LargeModGames/spotatui#832 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
bug good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
LargeModGames/spotatui#829 · 1 comentario ·
Los mantenedores suelen responder en 1 día
Todos los issues de LargeModGames/spotatui
Issues similares
-
Stack overflow in `check bans` with `include-dependencies = true` and a dev-dependency cycleAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
EmbarkStudios/cargo-deny#910 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
tursodatabase/turso#10054 ·
Los mantenedores suelen responder en 1 día
-
build: Update rust versionPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abiertodependencies
Dificultad 2/5 1-3 horas Aptitud para principiantes 67/100
ibm-granite-community/granite-cli#229 ·
Los mantenedores suelen responder en 1 día
-
setTargetAtTime booked ahead of time starts its curve early (values blow up before start_time)Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
orottier/web-audio-api-rs#658 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
aosama/astronomical#1318 ·
Los mantenedores suelen responder en 1 día