-
Notifications
You must be signed in to change notification settings - Fork 153
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New Feature: Direct Agent Execution #1624
base: version4
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this new code is part of the testing as I don't see it in build.cake or package-tests.cake but I'm not clear on how the tester is tested.
#else | ||
var attrs = assembly?.GetCustomAttributes(typeof(TAttr), false); | ||
return attrs.Length > 0 | ||
? attrs[0] as TAttr | ||
: null; | ||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see any TargetFramework
that would get to the #else
case.
|
||
public void WriteSummaryReport(XmlNode resultNode) | ||
{ | ||
var OverallResult = resultNode.GetAttribute("result") ?? "Unknown"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't local variable start with lower case?
This value is already obtained before this method is called so could be passed as a parameter.
|
||
private void WriteErrorsFailuresAndWarnings(XmlNode resultNode) | ||
{ | ||
string resultState = resultNode.GetAttribute("result") ?? ""; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"result"
node could be passed in like in summary.
if (resultNode.SelectSingleNode("reason/message")?.InnerText == "One or more child tests had warnings" || | ||
resultNode.SelectSingleNode("failure/message")?.InnerText == "One or more child tests had errors") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Most likely pre-existing, but this is a hard dependency on a string in another repository.
#endif | ||
var xmlResult = runner.Run(null, TestFilter.Empty).Xml; | ||
|
||
WriteRunSettingsReport(xmlResult); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would like to see a separate report
class.
Is it the idea that the nunit-console calls this class as otherwise we have two report classes.
#if NETFRAMEWORK | ||
string agentExe = agentAssembly; | ||
#else | ||
string agentExe = Path.ChangeExtension(agentAssembly, ".exe"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is nunit-console to be supported on non-windows? The NUnitConsole_Linux.sln
has not been maintained.
On Linux there is no .exe
extension.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should continue to be supported. Some linux distros support exe but not all. Let's add an issue for this.
#else | ||
const string STANDARD_CONFIG_FILE = "nunit.engine.core.tests.dll.config"; | ||
#endif | ||
const string STANDARD_CONFIG_FILE = "nunit.agent.core.tests.exe.config"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Compiling this branch, I see the previous behaviour:
$ find . -name 'nunit.agent.core.tests*.config'
./net462/nunit.agent.core.tests.exe.config
./net8.0/nunit.agent.core.tests.dll.config
The DirectTestAgent isn't part of the engine but of the tests. It just provides an exe to allow exercising the direct execution facility in nunit.agent.core. There's only one unit test that uses it right now but once the agents are in separate projects, all their tests will be run through it. We have never tested the agents in isolation before but this makes a start. |
Fixes #1623