-
Notifications
You must be signed in to change notification settings - Fork 106
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
Initial support of Microsoft.Testing.Platform #1153
Initial support of Microsoft.Testing.Platform #1153
Conversation
} | ||
|
||
// TODO: Uncomment this line when InternalsVisibleTo is set up. | ||
// var nopWriter = new InternalTraceWriter(new StreamWriter(Stream.Null)); |
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 am not sure what's different but on our last test with NUnit we were able to access this type.
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.
Yes, it is public. And has been so since 2013.
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.
@OsirisTerje This is not public, the class is internal
We need you to set the InternalsVisibleTo
from nunit.engine.core to testadapter.
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.
My bad, I just checked the old code and we were actually referencing nunit
package in addition to nunit.engine
.
Is it fine to do so here?
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.
We're talking about two different InternalTraceWriter classes, I referred to the one in the framework:
Referencing the framework from the adapter might be troublesome. We need to ensure people can use different versions of nunit with the same adapter. Possibly some clever use of wildcards on the versions can handle it.
Changing the engine to make this public instead of internal is doable.
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 honestly don't remember well all details but we used this trick following a bug we were having. @nohwnd Do you recall?
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 remember, but all the details of the fix, including link to the issue it is fixing are in the code in form of comments. 🙂 If we need to change our dependencies and use class that is not public, we instantiate it via reflection as well, since we are already patching it via reflection. But looks like you reverted the // new ...
so I guess it is okay as is.
src/NUnitTestAdapter/TestingPlatformAdapter/TestApplicationBuilderExtensions.cs
Show resolved
Hide resolved
src/NUnitTestAdapter/TestingPlatformAdapter/TestApplicationBuilderExtensions.cs
Show resolved
Hide resolved
src/NUnitTestAdapter/TestingPlatformAdapter/TestApplicationBuilderExtensions.cs
Show resolved
Hide resolved
I'd personally like to see microsoft/testfx#2298 resolved before we move forward with this, to ensure that Microsoft is actually embracing a Framework agnostic runner vs trying to extinguish other frameworks (the comment referenced in that issue is...not encouraging.) It may have already been resolved in a satisfactory way (Microsoft.Testing.Platform seems to be in the naming conventions now and the repo is testfx), but I'd like to confirm it. |
@SeanKilleen I can already close the issue you are referencing. As you can see in the nuget packages added everything is already MSTest agnostic. The only thing that remains MSTest oriented is the main doc. On the contrary to VSTest which is the main tool people use, the new platform is hidden and not something people are much aware of. |
@Evangelink great, thanks for confirming! |
@OsirisTerje @SeanKilleen How do you guys want me to move on this PR? Not sure if you prefer to discuss on the PR or ticket.
Not for now but for some future, I'd be happy to start seeing the "VS" part going away (maybe if/when we are able to drop support from VSTest and focus only on the new platform). We are really trying to have the new platform felt more as a dotnet tooling/sdk concept rather than a VS centric feature. BTW if that's any easier, I'd be happy to setup some call with you (hopefully we have some common timezone time :)) so we can discuss how we can help you. |
So I'll simply copy your questions here over to the ticket and start answering there. PS: Are the relevant packages now published so we could drop the local feed and get the CI build green? |
Here is my build and sample testing workflow:
Could you confirm this is working for you? |
I see the builds are still failing, due to the local nuget path. D:\a\1\s\src\NUnit3AdapterExternalTests\NUnit3AdapterExternalTests.csproj : error NU1301: The local source 'C:\src\nunit3-vs-adapter\package' doesn't exist. [D:\a\1\s\NUnit3TestAdapter.sln]
|
I changed the nuget.config to point to a relative path But as the packages are not there, the build fails. I believe the best is to upload the packages to e.g. MyGet or as beta packages to nuget. If I remove the Local feed, the solution builds, so they don't seem to be needed for the adapter ? You mention "for the samples". The nuget.config needs to go there, see below. Also, the samples folder should be moved into either the Your pt.1 and 2 works Meaning backwards compatibility is gone. The acceptance tests, we have 72 failed out of 98, but this is our fault, as it is caused by mismatch of our tests with version 4 of NUnit. Need to add an issue to get that fixed :-) We need these tests for this PR. I added new nuget.config files in the samples pointing up to the package directory. Pt 3 -7 then works. The output from 7: No information here about tests however, except that "they" succeeded. |
Thanks, I called out this was not workin and was only a temp solution to demo you something so we can start some discussion.
Same as above, this is just a temp "solution" to demo. I expect quite some cleaning to do here. Output from 4 is using vstest output (old dotnet test) while output from 7 uses the new default.
This is to reduce output contention by default. We know this is not the most loved solution and we have this issue microsoft/testfx#2162 to track improving this output for "interactive" scenarios. For the tests, I expect you may want to "improve" them to run maybe in the 2 modes (runner or vstest) for better safety. |
[ ] It should be removed from this PR.
|
# Conflicts: # src/NUnitTestAdapter/NUnit.TestAdapter.csproj # src/NUnitTestAdapterTests/NUnit.TestAdapter.Tests.csproj
@OsirisTerje I have commented I have been discussing with @nohwnd and having dependency on newer version of ObjectModel should not break support for older VS. |
@Evangelink If it doesn't crash the older ones, we can remove it. We just have to trust you on that one. :-) I no longer have any of those installed, and not sure if it will break on other things, like what framework we're actually now running under, so, anyway... Then we let that go. |
The CI breaks due to the nuget local src, used for the samples. That should be removed. I have already moved the samples themselves, so when this is merged (and pushed to myget using the Publish build), the samples should grab the new version from myget.org |
It shouldn't said our VSTest expert :)
Yep sorry, will fix that now. |
Working on a fix for the tests. |
The copy of the file was moved from the .props to the .targets
Initial support of Microsoft.Testing.Platform (#1153)
Provide the base changes to support the new platform while keeping backward compatibility.
There are multiple points to discuss for the design, naming and update of your testing infra.
Fixes #1152