title: VSTS : dotnet with Docker fail to publish tests
body: <p>I try to publish my unit tests on VSTS during the continuous integration, I use docker, and at the time the Publish task is played, I still get the following error, thus the xml file resulting from the <strong>dotnet test</strong> command can"t be found.</p>
  
  <pre><code>No test result files matching **\test-results.xml were found.
  </code></pre>
  
  <p>If I run the command <strong>docker-compose run web-tests</strong> locally, a tests-results folder is created containing the expected test-results.xml file.</p>
  
  <p><strong>What I am doing wrong on VSTS ?</strong></p>
  
  <p>The code repo : <a href="https://github.com/NicolasReyDotNet/UnitTestDocker" rel="noreferrer">Github</a></p>
  
  <p>My folder architecture:</p>
  
  <pre><code>web/
  ├── web/
  │   └── web.csproj
  │   └── Dockerfile
  │       
  ├── web.test/
  │  └── web.test.csproj
  │       
  └── web.sln
  └── docker-compose.yml
  └── docker-compose.override.yml
  </code></pre>
  
  <p>Dockerfile (EDIT remove extra dotnet test command) :</p>
  
  <pre><code>FROM microsoft/aspnetcore:2.0 AS base
  WORKDIR /app
  EXPOSE 80
  
  FROM microsoft/aspnetcore-build:2.0 AS build
  WORKDIR /src 
  COPY web.sln ./
  COPY web/web.csproj web/
  COPY web.test/web.test.csproj web.test/
  RUN dotnet restore -nowarn:msb3202,nu1503
  COPY . .
  WORKDIR /src/web
  RUN dotnet build -c Release -o /app
  
  FROM build as test
  WORKDIR /src/web.test
  #RUN dotnet test
  
  FROM build AS publish
  WORKDIR /src/web
  RUN dotnet publish -c Release -o /app
  FROM base AS final
  WORKDIR /app
  COPY --from=publish /app .
  ENTRYPOINT ["dotnet", "web.dll"]
  </code></pre>
  
  <p>docker-compose.yml:</p>
  
  <pre><code>version: '3.4'
  services:
    web:
      image: web
      build:
        context: .
        dockerfile: web/Dockerfile
    web-tests:
      image: web-tests
      build:
        context: .
        dockerfile: web/Dockerfile      
        target: test
      volumes: 
        - ${BUILD_ARTIFACTSTAGINGDIRECTORY:-./tests-results/}:/tests
  </code></pre>
  
  <p>docker-compose.override.yml:</p>
  
  <pre><code>version: '3.4'
  services:
    web:
      environment:
        - ASPNETCORE_ENVIRONMENT=Development
      ports:
        - "80"
    web-tests:
      environment:
        - ASPNETCORE_ENVIRONMENT=Development
      ports:
        - "80"
      entrypoint:
        - dotnet
        - test
        - --logger
        - trx;LogFileName=/tests/test-results.xml
  </code></pre>
  
  <p>And my both VSTS Tasks 
  <a href="https://i.stack.imgur.com/sVrnJ.png" rel="noreferrer"><img src="https://i.stack.imgur.com/sVrnJ.png" alt="docker-compose run task"></a>
  <a href="https://i.stack.imgur.com/pOans.png" rel="noreferrer"><img src="https://i.stack.imgur.com/pOans.png" alt="publish tests task"></a></p>