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

nvx-rs: replace the golden CLI scenarios with structured scenario tests

Aperta
#728 0 commenti 0 reazioni 1 assegnatario Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@ppenna ci sta già lavorando.

Dal 23/10/2026.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
35/100
Tipo di issue
Refactoring
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
linux, python, rust
Ambito
cli, testing-qa

Direzione di ricerca

Start with tests/cli.rs, tests/fixtures/cli.json, and the replay in nvx_rs_reproduces_the_recorded_scenarios; inspect the shared setup and scenario records before designing the harness under tests/cli/. Map all 281 scenarios and listed regressions to the requested tests, then run the Linux and Windows suites and the specified mutation checks. Done means every scenario is covered and the behavior preserving pull request passes its gate; retirement is a later pull request.

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

Descrizione

Goal

Replace tests/fixtures/cli.json and its replay, nvx_rs_reproduces_the_recorded_scenarios in tests/cli.rs, with scenario tests that check what callers rely on: exit statuses, error codes and stable fragments, the state directory and its parsed JSON files, file modes, and the arguments that OpenVMM receives, rather than transcripts recorded from Python.

Background
  • cli.json holds 141 POSIX and 140 Windows scenarios, in 426 steps, recorded from nvx.py sandbox, egress compile, and artifacts, with nvx-fake-openvmm as OpenVMM. Each step compares the exit status, standard output and error, and state files byte for byte, after replacing the root, process IDs, and random identifiers with placeholders.
  • On Windows, only the replay reaches 533 lines and 130 branches, mostly in src/host/cli/sandbox/ and src/testing/fake_openvmm.rs, and all of egress compile.
  • nvx.py sandbox passes the streams and status of nvx-rs through, and the hypervisor suites match message fragments and parse runtime.json and outcome reports.
Tasks

Replacement tests, in a pull request that doesn't change behavior:

  • A harness in tests/cli/ that reuses the root and fake-OpenVMM setup of tests/cli.rs, and checks exit statuses, error codes (#724) or stable fragments, the entries of the state directory, its parsed JSON files, POSIX file modes, and the arguments that the fake OpenVMM received.
  • Table-driven tests:
    • usage_errors_exit_2_and_name_the_option
    • validation_errors_exit_1_before_any_side_effect: the state directory is unchanged, and OpenVMM didn't run.
    • dry_runs_print_the_openvmm_command_and_launch_nothing: the >> line, split into arguments, holds the sandbox blocks, workload identity, shares, egress rules, and kernel command line.
    • one_shot_runs_exit_with_the_workload_or_openvmm_status: statuses such as 0, 3, 7, 124, 127, and 137, the workload's output byte for byte, and the schema of the outcome report.
    • lifecycles_of_every_configuration: the state after each of provision, start, exec, stop, and deprovision.
    • refusals_of_lifecycle_operations
    • configurations_of_every_format_start_and_exec, from hand-written config.json files of formats 1 to 6 in tests/fixtures/state/.
    • egress_compile_prints_the_library_lowering
    • artifacts_list_every_guest_in_order
    • A property that the >> line splits back into the arguments, with CommandLineToArgvW on Windows and a shell-word splitter on POSIX.
  • A temporary table that maps each of the 281 scenarios, and the regressions of #369, #373, #464, and #513, to tests, and a test that fails on a scenario that maps to none.
  • Keep the other tests of tests/cli.rs, including the Ctrl-C tests.

Retirement, in the next pull request:

  • Delete cli.json, the replay and its normalization helpers, and the mapping test.
  • Write only the newest config.json format, and keep reading formats 1 to 6. Drop the README's promise that an older nvx.py can operate a sandbox that nvx-rs provisioned.
  • Docs: replace the README's "Golden scenarios" section, and update its Testing section and doc/project-structure.md.
Gate
  • The lines and branches that only the replay reaches, on Windows and Linux (#726), are reached by the new tests or deleted.
  • cargo mutants on src/host/cli/sandbox/mod.rs, lifecycle.rs, and state.rs misses no mutant with the new tests that the replay catches.
  • Every scenario maps to a test.
Coordination
  • nvx-rs run (#638) gets its scenarios as tests of this harness, not as records from Python.
  • Until cli.json is deleted, changes such as those of #620 and #622 may edit its records by hand, but add no recorded scenarios.
Acceptance criteria
  • cli.json is gone, and the scenario tests pass on Linux and Windows.
Lingua principale
Python
Stelle
408
Fork
28
Merge medio
16h 20m
PR unite (30g)
355

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

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 microsoft/nvx

Tutte le issue di microsoft/nvx

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.