Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

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

Aperta
#461 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
48/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
rust
Ambito
cli, testing

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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

Lingua principale
Rust
Stelle
1.4k
Fork
238
Merge medio
9h 19m
PR unite (30g)
186

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di LargeModGames/spotatui

Tutte le issue di LargeModGames/spotatui

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.