-
Notifications
You must be signed in to change notification settings - Fork 323
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
Use fakes to surround vstest core and test it #3347
Conversation
src/Microsoft.TestPlatform.CommunicationUtilities/SocketClient.cs
Outdated
Show resolved
Hide resolved
playground/TestPlatform.Playground/TestPlatform.Playground.csproj
Outdated
Show resolved
Hide resolved
src/Microsoft.TestPlatform.CommunicationUtilities/DataCollectionRequestHandler.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.TestPlatform.CrossPlatEngine/Client/ProxyExecutionManager.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.TestPlatform.CrossPlatEngine/Client/ProxyOperationManager.cs
Outdated
Show resolved
Hide resolved
...Platform.TestHostProvider.UnitTests/Microsoft.TestPlatform.TestHostProvider.UnitTests.csproj
Outdated
Show resolved
Hide resolved
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 will finish the review later, my brain is dead now.
src/Microsoft.TestPlatform.Common/Hosting/ITestRuntimeProviderManager.cs
Show resolved
Hide resolved
src/Microsoft.TestPlatform.Common/Hosting/ITestRuntimeProviderManager.cs
Show resolved
Hide resolved
src/Microsoft.TestPlatform.CommunicationUtilities/TestRequestSender.cs
Outdated
Show resolved
Hide resolved
test/vstest.ProgrammerTests/Fakes/FakeAssemblyMetadataProvider.cs
Outdated
Show resolved
Hide resolved
test/vstest.ProgrammerTests/Fakes/FakeAssemblyMetadataProvider.cs
Outdated
Show resolved
Hide resolved
Co-authored-by: Amaury Levé <amaury.leve@gmail.com>
Co-authored-by: Amaury Levé <amaury.leve@gmail.com>
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.
Some minor comments from me but otherwise LGTM! Thanks for this awesome improvement!
// TODO: In various places TestRequest sender is instantiated, and we can't easily inject the factory, so this is last | ||
// resort of getting the dependency into the execution flow. | ||
_communicationEndpoint = communicationEndPoint | ||
#if DEBUG |
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.
Just to make sure, when in debug we want to have the 3 possible paths, right?
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, in debug we want to try the service locator before setting the channel.
Co-authored-by: Amaury Levé <amaury.leve@gmail.com>
…nto fakes-over-mocks
Adds a set of fakes (not Microsoft.Fakes), that replicate the basics of functionality that we need complete a test run. This is a first step towards having the ability to write "integration" tests that run in memory, and inject different kinds of failures. If you look at UnitTests1.cs, the code looks terribly complicated right now. But it will clean up when more relationships are clear. Even though there are many Fake implementations, just 3 or 4 are crucial. FakeTestRuntimeProvider, because it is an extension point, and it manages all aspects of setting up and tearing down a testhost. FakeCommunicationChannel, because that provides the way for posting and receiving messages that would normally go via sockets, and it allows me to receive and send messages.
Only a single test is written here, and it depends on having just a single "testhost" and just a single communication channel to it. But it shows that the idea is possible.
When moving forward with this I want to keep these rules in mind: