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

Đang mở Phù hợp với người mới
#1,321 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
82/100
Loại issue
Tài liệu
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
csharp
Lĩnh vực
documentation

Hướng nghiên cứu

Bắt đầu từ tài liệu về adapter trong kho lưu trữ nunit/docs; payload không nêu tên tệp nào, vì vậy hãy tìm trang cài đặt adapter thay vì đoán một đường dẫn. Đọc mục 6 và các bình luận trong nunit/nunit3-vs-adapter#1515 để biết các số liệu đầu ra đã đo, sau đó thêm một mục bao gồm AgentMode, bảng giá trị mặc định theo từng chế độ, ShowStdout/ShowStderr, các thông báo lý do, StackTrace, hành vi của bảng điều khiển VSTest, lý do sử dụng agent và ba ví dụ dotnet test. Hoàn thành nghĩa là mục này đủ đầy đủ để người đọc có thể chọn một chế độ và chạy các ví dụ mà không cần tệp runsettings.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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

Ngôn ngữ chính
Dockerfile
Star
601
Fork
159
Merge trung bình
22 giờ 18 phút
Pull request đã merge (30 ngày)
6

Chuẩn bị môi trường

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của nunit/docs

Tất cả issue của nunit/docs

Issue tương tự

Thêm issue về Documentation

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.