Repository navigation
Add settings for requesting and reporting an agent type - #27
Merged
Merged
Conversation
Add SettingDefinitions.RequestedAgentType and SelectedAgentType, beside RequestedAgentName and SelectedAgentName. Runners can then ask for a kind of agent, such as InProcess, without knowing an agent's internal name, and see which kind the engine used. Values are the names of TestAgentType members, held as strings because PackageHelper does not serialize enum-valued settings. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Collaborator
Author
|
@dotnet-policy-service agree |
CharliePoole
approved these changes
Dec 3, 2026
CharliePoole
left a comment
Member
There was a problem hiding this comment.
This looks good to me. Most of the work will be in the console and engine changes.
| /// of a <see cref="TestAgentType"/> member. | ||
| /// </summary> | ||
| public static SettingDefinition<string> SelectedAgentType { get; } = new(nameof(SelectedAgentType), string.Empty); | ||
|
|
Member
There was a problem hiding this comment.
I like the symmetry of the names with the two agent name settings.
Collaborator
Author
There was a problem hiding this comment.
Thanks. That was the aim: each type setting sits beside the name setting it pairs with, so a runner can read them together.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of nunit/nunit-console#1983. A runner can ask for an agent by name, but not for a kind of agent, so the console asks for the in-process agent by an internal name it must keep in step with the engine.
Changes
SettingDefinitions.RequestedAgentType, besideRequestedAgentName. A runner sets it to ask for a kind of agent.SettingDefinitions.SelectedAgentType, besideSelectedAgentName. The engine sets it to report the kind of agent it used.Both are strings holding the name of a
TestAgentTypemember (InProcess,LocalProcessorRemoteProcess), and default to empty. They aren't enum-valued because package settings with enum values aren't serialized today. The doc comment onRequestedAgentTypesays that tests still run in-process only when that is asked for.Tests
A new test checks that both settings can be looked up by name, are strings, and default to empty. All 74 tests pass on net462 and net8.0.
Follow-up
The engine and console side is a separate nunit/nunit-console PR, which will pin the MyGet build containing this change. It covers how the engine chooses an agent by type, what happens when a requested name and type don't match, and the console's
--inprocessoption.This PR is the first in a trial of Claude working through a bot account, described on nunit/nunit-console#1983.
🤖 Generated with Claude Code