dotnet tests not run with flag --no-build in docker

Solution 1:

check your sln file. The case where tests are running only with --no-build flag can be caused by missing Release or Debug configuration for the test.csproj

if for example it has only Debug configuration, then this would result in no tests found:

dotnet build -c Release
dotnet test -c Release --no-build --list-tests

To diagnose it you could increase the verbosity level. What's pretty nice, this also lists the executed test cases and their status:

dotnet test -c Release --no-build -v=normal