-
Notifications
You must be signed in to change notification settings - Fork 10.4k
Description
I have some integration tests that we want to run in a docker container using vstest from a published project.
The WebApplicationFactory is used to build a test server to host the service which is started for every test.
All the files from the output of the publish and copy it to a directory called app in the container.
This issue is very similar and there is a solution for the issue that I am unsure how to implement. Could I get a more detailed implementation details? Details below:
solution:
WAF can be extended to support this by adding your ownhttps://github.com/aspnet/AspNetCore/blob/master/src/Mvc/Mvc.Testing/src/WebApplicationFactoryContentRootAttribute.cs to the test assembly. Pointing at the content root of the published app.
To Reproduce
- create integration tests for a dotnet api project
- publish the integration tests
- copy the published files to the docker container
- build the image
- run the container
Exception:
Error Message:
System.InvalidOperationException : Solution root could not be located using application root
Further technical details
-
netcoreapp2.2
-
.NET Core SDK (reflecting any global.json):
Version: 2.2.103
Commit: 8edbc2570a
Runtime Environment:
OS Name: debian
OS Version: 9
OS Platform: Linux
RID: debian.9-x64
Base Path: /usr/share/dotnet/sdk/2.2.103/
Host (useful for support):
Version: 2.2.1
Commit: 878dd11e62
.NET Core SDKs installed:
2.2.103 [/usr/share/dotnet/sdk]
.NET Core runtimes installed:
Microsoft.AspNetCore.All 2.2.1 [/usr/share/dotnet/shared/Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.2.1 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 2.2.1 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
To install additional .NET Core runtimes or SDKs:
https://aka.ms/dotnet-download
- VS 2019