Hi,
I have a added Docker and DockerCompose support to my Visual Studio 2022 C# .NET 6 project.
My solution contains a xUnit Testproject, that I want to execute. I have added a launchsettings.json file, that extends my Visual Studio profile. No I can press F5 to start my tests.
I want, that the xUnit tests are immediately executed. To achieve this, I try to invoke the dotNet test application. In the Docker Desktop for Windows I see the following output:
Well, if I go into the console and invoke the “dotnet test” command, the UnitTest is found:
I tried it with different approaches to start “dotnet test” added to the Dockerfile from the xUnit-Testproject:
CMD [“dotnet”, “test”]
#CMD [“dotnet”, “test”, “–no-restore”]
#RUN dotnet restore
#ENTRYPOINT [“dotnet”, “test”]
#ENTRYPOINT [“dotnet test”]
#ENTRYPOINT [“dotnet”, “test”, “myproject1.Functions.Tests.CORE.dll”]
{
“profiles”: {
“Docker Compose”: {
“commandName”: “DockerCompose”,
“commandVersion”: “1.0”,
“serviceActions”: {
“myproject1”: “StartDebugging”,
“myproject1.tests.integration.core”: “DoNotStart”
}
},
“Docker Compose Integration Tests”: {
“commandName”: “DockerCompose”,
“commandVersion”: “1.0”,
“serviceActions”: {
“myproject1”: “StartDebugging”,
“myproject1.functions.tests.core”: “StartDebugging”
}
}
}
}
Any idea what I do wrong?
Thanks,
Christian