Skip to content
This repository has been archived by the owner on Nov 27, 2017. It is now read-only.

Fix few issues with labels #56

Merged
merged 4 commits into from Jul 19, 2016
Merged

Fix few issues with labels #56

merged 4 commits into from Jul 19, 2016

Conversation

somdoron
Copy link
Contributor

  1. Outcome of a test is never printed
  2. Test is being printed when the test is finished, problematic when I want to find an hanging thread. To fix printing the name of the test when the test starts

@@ -190,7 +190,7 @@ int Execute()
else
{
TestExecutionListener listener = new TestExecutionListener(_testExecutionSink, _options, assemblyPath);
SetupLabelOutput(listener);
SetupLabelOutput(listener);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: extra spaces

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed and rebased

@somdoron
Copy link
Contributor Author

@jasonwilliams200OK fixed and rebased.

@ghost
Copy link

ghost commented Jul 18, 2016

Thanks @somdoron. Would be nice to have a test to verify the changes. :)

@somdoron
Copy link
Contributor Author

@jasonwilliams200OK will add, might take me a day.


string output = null;

if (testResult.Messages.Count > 0)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was a miss, good catch. 👍

@CharliePoole
Copy link
Contributor

@rprouse I there a stated standard C# level to be used for dotnet-test-nunit?

@rprouse
Copy link
Member

rprouse commented Jul 18, 2016

@CharliePoole there is no stated C# level, but because .NET Core 1.0 requires Visual Studio 2015 Update 3, I have been using C# 6 features.

@somdoron
Copy link
Contributor Author

@jasonwilliams200OK I added tests.

@rprouse the current implementation doesn't print the label twice as the WriteLabelLine protects against that.

@CharliePoole @rprouse Regarding printing the label before the tests, right now it is only if you set the labels to All, if set to ON it will print the test when test is finished.
I know the behavior is different than nunit-console but does helps find hanging thread, try to guess the alphabetic order is pretty annoying and this behavior already helps find hanging tests.
If not for "All" we might create a new option called "Debug" that prints when a test begin.

@@ -215,7 +250,7 @@ public void FiresSuiteFinished()

Assert.That(test, Is.Not.Null);
Assert.That(test, Is.EqualTo("NUnit.Framework.Internal.CultureSettingAndDetectionTests.LoadWithFrenchCanadianCulture"));
}
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: extra space :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed and rebased.

@CharliePoole
Copy link
Contributor

@somdoron Actually, your implementation is correct, based on the intent for All versus On. The console implementation originally worked that way but it somehow got messed up when we made some changes to it.

@somdoron
Copy link
Contributor Author

Can the PR be merged?

if (labels == "ALL")
WriteLabelLine(args.TestName);
};

listener.TestFinished += (sender, args) =>
{
if (labels == "ALL")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we are going to add the labels ALL to the start, let's remove it from here. When we go multi-threaded, the currentLabel code you pointed to could fail to prevent the second print.

@rprouse
Copy link
Member

rprouse commented Jul 19, 2016

@somdoron one small change, then we can merge.

@somdoron
Copy link
Contributor Author

@rprouse fixed and rebased

@rprouse
Copy link
Member

rprouse commented Jul 19, 2016

👍 waiting for CI

Thanks for your help.

@somdoron
Copy link
Contributor Author

thanks

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants