Skip to content
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

Enable .NET Standard 2.0 tests on non-Windows platforms #2609

Merged
merged 6 commits into from Dec 12, 2017

Conversation

jnm2
Copy link
Contributor

@jnm2 jnm2 commented Dec 11, 2017

Commit 2 fixes #2542
Commit 4 fixes #2608
Commit 5 fixes #2555

Copy link
Member

@ChrisMaddock ChrisMaddock left a comment

Choose a reason for hiding this comment

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

#2542 is not nice for .NET Standard. 😞

The first four commits look great. 😄

The warnings I'm not totally happy with, as I feel like we won't ever see them. How often do we actually look through the whole CI logs to check for any messages like that? We have the same problem with Ignore("Fix this later") - they just get ignored for ever more.

I'd personally prefer to limit to be pushed up instead - I think all we want to avoid with these tests is any crazy 2 minute runtimes like we used to have. If we want to actually test performance (which I'd love to, one day... :-p), then this isn't the right way to do that.

The constraint looks nice though. 😄

@ChrisMaddock
Copy link
Member

One more - is there a reason you only did this for .NET Standard 2.0 and not 1.6 as well? Is there more work required for 1.6? We should definitely do that at some point.

@CharliePoole
Copy link
Contributor

General comment on Ignores and Warnings...

IMO, it's a social rather than a technical problem. As a visiting coach, I had to solve the problem many times and it generally involved giving visibility to Ignored tests (we didn't have Warnings till recently, of course). Once the entire team had the warnings displayed in front of them all the time social pressure led to their being fixed. No special technology was involved. Management wasn't involved.

The thing is, I only know how to do this in collocated teams I'm coaching. As an older guy, the whole "internet presence" thing sounds like an oxymoron to me. 😄 We did it by hanging reports with the failures and ignored tests featured on the wall. Is there anything you feel would be paid attention to by this group, separated as we are in time (zone) and space?

@jnm2
Copy link
Contributor Author

jnm2 commented Dec 11, 2017

@ChrisMaddock

There is more work required to compile our .NET Core 1.1 tests in order to test .NET Standard 1.6 and I'm aiming for smaller PRs 😎 #2611

The other thing to consider with warnings is that once build.cake uses a newer console runner, we will start seeing warnings and ignores every single time we run build.cake even when there are no errors. (We should make sure NUnitLite does that too.)

@jnm2
Copy link
Contributor Author

jnm2 commented Dec 11, 2017

@CharliePoole we could have build status indicators on our GitHub landing page that make us look bad when there are warnings... 😁

@CharliePoole
Copy link
Contributor

@jnm2 I for one never see the status indicators. I have to scroll down two pages to see them. But maybe others check them.

@jnm2
Copy link
Contributor Author

jnm2 commented Dec 11, 2017

The other thing with a performance test is that it's incredibly sensitive to hardware and to parallelism, so it's not like there's anything sacred about the duration 100ms. We'd need a dedicated server and no parallelism for the actual number to be meaningful.

I'm not sure if that builds the case for warnings or padding the limit. I have no real opinion but I do want to get this through, so let me know what's agreeable to you in the short term.

rprouse
rprouse previously approved these changes Dec 12, 2017
Copy link
Member

@rprouse rprouse left a comment

Choose a reason for hiding this comment

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

Looks good except for some minor nits. As for the MaxTime vs Warnings, I am on the fence. I agree with @ChrisMaddock that warnings will go unnoticed, but I also agree with @jnm2 that using timeouts for performance tests aren't really valid tests because they are so hardware specific. Down to warnings, if we don't believe that they are useful because they will never be seen, then why did we add them in the first place 😄

I'm not a huge fan of warnings, but if we believe they are a useful feature, we should probably use them occasionally ourselves, so I am okay with these two occurrences, but I wouldn't want to see them used too widely in the future.

My nits are very minor, so I am going to approve. If you decide to address the nits, I will re-approve 😄 It would be nice if GitHub had an option to only dismiss negative approvals for situations like this.

BUILDING.md Outdated
@@ -74,6 +74,7 @@ Feature constants are defined in [Common.props](src/NUnitFramework/Common.props)
- `PARALLEL` enables running tests in parallel
- `PLATFORM_DETECTION` enables platform detection
- `THREAD_ABORT` enables timeouts and forcible cancellation
- `COM_APARTMENT` enables control of the thread apartment state
Copy link
Member

Choose a reason for hiding this comment

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

Minor nit, but would something like APARTMENT_STATE or THREAD_APARTMENT be clearer? Many new developers probably don't know what COM is 😋

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's fine. I changed it from APARTMENT_STATE just to be didactic about the naming and the shorter constant grew on me but I'll switch back for clarity.

@@ -101,17 +101,28 @@ public SavedState(WorkItemQueue queue)
private int _addId = int.MinValue;
private int _removeId = int.MinValue;

#if COM_APARTMENT
Copy link
Member

Choose a reason for hiding this comment

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

This could be moved to line 109/110 to prevent the duplicate documentation.

Copy link
Contributor Author

@jnm2 jnm2 Dec 12, 2017

Choose a reason for hiding this comment

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

The weird thing is that you can't put preprocessor inside XML documentation. I thought it was simple but this comment blew my mind.


#region IsSubsetOf
#region IsSubsetOf
Copy link
Member

Choose a reason for hiding this comment

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

I really wish Visual Studio would fix this formatting issue. Makes me want to do a mass unindent checkin.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I would love it if you did. That, and an endianness fix, and a trailing whitespace fix. Or just say it's okay for me to. 😀

@jnm2
Copy link
Contributor Author

jnm2 commented Dec 12, 2017

What does everyone think of excluding [Category("Performance")] for Travis and AppVeyor?

@jnm2
Copy link
Contributor Author

jnm2 commented Dec 12, 2017

@rprouse Need new review because of the APARTMENT_STATE commit. 😀

@rprouse
Copy link
Member

rprouse commented Dec 12, 2017

LGTM, waiting on CI. As for the category, would you propose not running that category of tests? I think I prefer the warning.

@jnm2
Copy link
Contributor Author

jnm2 commented Dec 12, 2017

@rprouse I would propose not running performance tests on CI, yes. Since I'm thinking the data they generate is not very meaningful and they slow everything down a bit. But if you prefer warnings I'm happy with that so long as this PR is unblocked. Anyone can follow up later.

@rprouse
Copy link
Member

rprouse commented Dec 12, 2017

Another .NET 3.5 failure

1) Failed : NUnit.Framework.Internal.Execution.EventQueueTests+SetWaitHandle_Enqueue_AsynchronousTest.SetWaitHandle_Enqueue_Asynchronous
  Expected: null
  But was:  <NUnit.Framework.AssertionException:   Expected: True
  But was:  False
   at NUnit.Framework.Assert.ReportFailure(String message)
   at NUnit.Framework.Assert.That[TActual](TActual actual, IResolveConstraint expression, String message, Object[] args)
   at NUnit.Framework.Internal.Execution.EventQueueTests.SetWaitHandle_Enqueue_AsynchronousTest.Consumer() in C:\projects\nunit\src\NUnitFramework\tests\Internal\EventQueueTests.cs:line 196
   at NUnit.Framework.Internal.Execution.EventQueueTests.ProducerConsumerTest.ConsumerThreadWrapper() in C:\projects\nunit\src\NUnitFramework\tests\Internal\EventQueueTests.cs:line 316>
   at NUnit.Framework.Internal.Execution.EventQueueTests.ProducerConsumerTest.RunProducerConsumer() in C:\projects\nunit\src\NUnitFramework\tests\Internal\EventQueueTests.cs:line 304
   at NUnit.Framework.Internal.Execution.EventQueueTests.SetWaitHandle_Enqueue_AsynchronousTest.SetWaitHandle_Enqueue_Asynchronous() in C:\projects\nunit\src\NUnitFramework\tests\Internal\EventQueueTests.cs:line 181

@jnm2
Copy link
Contributor Author

jnm2 commented Dec 12, 2017

A new perf-sensitive failure to keep an eye on, Travis/netstandard2.0:

3) Failed : NUnit.Framework.Internal.Execution.TestWorkerTests.BusyExecuteIdleEventsCalledInSequence
  Expected: "BusyExecIdle" after 200 milliseconds delay
  But was:  "BusyExec"

@jnm2 jnm2 merged commit 38e61b6 into master Dec 12, 2017
@jnm2 jnm2 deleted the jnm2/enable_tests_netstandard2.0 branch December 12, 2017 17:24
@CharliePoole
Copy link
Contributor

<off-topic>
Warnings can be very useful to a team, if the team knows how to use them. It's not a technical problem but a social one. If you have warnings, then you have to have something in place to make sure they get attention.

I can assure you that my teams have always made effective use of warnings, because we set up non-technical team structures to deal with them. I'm sure that plenty of teams are using our NUnit warnings in that way, even if we are not able to because we are distributed and haven't yet invented a social mechanism to make those who create warnings want to get rid of them.

I don't think that says anything real bad about us as a team. I do not believe the necessary social connections for proper functioning of a distributed team have been invented yet. Every few years I review what's out there and it's all still very primitive as compared to the standard organizational patterns like "Expert in Earshot" and "Big Visible Displays".
</off-topic>

@mitchellmaler
Copy link

Quick Question: With the new dotnet test command using the adapter do you know if it is still possible to pass arguments to nunit? The argument I am looking to pass is the --workers parameter so I can limit the amount of parallel tests that run at a given time.

@rprouse
Copy link
Member

rprouse commented Dec 13, 2017

@mitchellmaler, dotnet test only passes arguments on to VSTest, not through to our adapter, so we are out of luck there. xUnit solved the problem by writing their own dotnet xunit command, giving them full control over the test process. We are considering doing the same with a dotnet nunit command, but we haven't started work on it.

@mitchellmaler
Copy link

Okay that makes sense. I will just use the NumberOfTestWorkers .runsettings property for now and use cli to change that if needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pri:critical Use this to indicate a hotfix may be necessary
Projects
None yet
5 participants