Document the adapter's agent output settings (AgentMode, ShowStdout, ShowStderr, StackTrace)

Aperta Adatta ai principianti
#1,321 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
82/100
Tipo di issue
Documentazione
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
csharp
Ambito
documentation

Direzione di ricerca

Parti dalla documentazione dell’adattatore nel repository nunit/docs; il payload non nomina alcun file, quindi individua la pagina delle impostazioni dell’adattatore invece di indovinare un percorso. Leggi il punto 6 e i commenti in nunit/nunit3-vs-adapter#1515 per i numeri di output misurati, poi aggiungi una sezione che copra AgentMode, la tabella dei valori predefiniti per modalità, ShowStdout/ShowStderr, i messaggi di motivo, StackTrace, il comportamento della console VSTest, la motivazione dell’agente e i tre esempi di dotnet test. Fatto significa che la sezione è abbastanza completa che chi legge possa scegliere una modalità ed eseguire gli esempi senza un file runsettings.

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

Descrizione

area:adapter type:newpage

Document the agent output settings from nunit/nunit3-vs-adapter#1515 (point 6 there). The settings ship in the adapter release that includes that work.

Add a section to the adapter documentation that covers:

  1. AgentMode: Off, Auto (default) and On.

    • Auto turns agent mode on when it detects an AI coding agent from its environment variables: CLAUDECODE, CURSOR_AGENT, GEMINI_CLI, COPILOT_CLI, AI_AGENT, CODEX_CLI, AGENT_CLI. These are the same variables that Microsoft.Testing.Platform checks.
    • Off keeps the traditional output.
    • Agent mode only changes defaults. A setting that is set explicitly always wins.
  2. Defaults per mode, when a setting is not set:

    Setting Off On
    ShowStdout/ShowStderr All (None if ConsoleOut=0) Failed
    StackTrace Full Filtered
    Verbosity 0 -1
  3. ShowStdout/ShowStderr:

    • All sends test output to the console as it arrives.
    • Failed keeps the output only in the test result. The VSTest console logger shows it for failed tests.
    • None drops it.
    • ConsoleOut is now a deprecated alias: 0 = None, 1 and 2 = All. 2 still sends the output as warnings.
  4. Reason messages follow ShowStdout: All sends the reason for every outcome, Failed only for failed tests, None none. A failed test has a reason when a warning is mapped to Failed (MapWarningTo=Failed).

  5. StackTrace: Full, Filtered or None. Filtered removes NUnit-internal and async state-machine frames. It replaces IncludeStackTrace and IncludeStackTraceForSuites, which still work.

  6. How the console output is produced under VSTest:

    • The VSTest console logger prints the block for each failed test (message, stack trace, stdout, stderr) from the test result, at every verbosity.
    • Messages that the adapter sends at Informational level are hidden at the default logger verbosity (minimal). Use --logger "console;verbosity=normal" to see them.
  7. What an agent needs from a test run, as the reason for the defaults: the failed tests with message, stack trace and output; the counts, to see whether the run can be trusted; and seldom skip reasons, because [Ignore] and [Explicit] reasons are the same on every run.

  8. Command-line examples that need no runsettings file:

    dotnet test -- NUnit.AgentMode=On
    dotnet test -- NUnit.AgentMode=Off
    dotnet test -- NUnit.ShowStdout=Failed NUnit.StackTrace=Filtered
    

Measured on a repro with 26 tests, agent mode reduced the console output by 56 % at minimal verbosity and 63 % at normal verbosity. See the comments in nunit/nunit3-vs-adapter#1515.

🤖 Made by @OsirisTerje with Claude

Lingua principale
Dockerfile
Stelle
601
Fork
159
Merge medio
22h 18m
PR unite (30g)
6

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

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 nunit/docs

Tutte le issue di nunit/docs

Issue simili

Altre issue su Documentation

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.