title: GitLab Runner stopping after `dotnet restore` or `dotnet test`
body: <p>I am new to CI and tried to add the following yaml to our project.</p>
  <p>image: microsoft/dotnet:latest</p>
  <pre><code>stages:
    - test
  
  test: 
    stage: test
    before_script:
      - 'echo Stage - Test started'
      - 'dotnet tool install dotnet-reportgenerator-globaltool --tool-path tools'
    script:  
      - 'cd &quot;./My Project&quot;'  
      - 'dotnet test --settings:./Settings/CodeCoverage.runsettings --collect:&quot;XPlat Code Coverage&quot;'
      - './tools/reportgenerator &quot;-reports:./Tests/*/TestResults/*/coverage.cobertura.xml&quot; &quot;-targetdir:Reports_Coverage&quot; -reportTypes:TextSummary'
      - 'cat ./Reports_Coverage/Summary.txt'
    after_script:
      - 'echo Stage - Test finished'
  </code></pre>
  <p>On the job I get the following output:</p>
  <pre><code>Running with gitlab-runner 13.7.0 (943fc252) on ***
  Resolving secrets
  Preparing the &quot;kubernetes&quot; executor
  Using Kubernetes namespace: gitlab-pipeline
  Using Kubernetes executor with image microsoft/dotnet:latest ...
  Preparing environment
  Running on*** via ***...
  Getting source from Git repository
  Fetching changes with git depth set to 50...
  Initialized empty Git repository in /builds/***/.git/
  Created fresh repository.
  Checking out 07e98444 as ***...
  Skipping Git submodules setup
  Executing &quot;step_script&quot; stage of the job script
  $ echo Stage - Test started
  Stage - Test started
  $ dotnet tool install dotnet-reportgenerator-globaltool --tool-path tools
  You can invoke the tool using the following command: reportgenerator
  Tool 'dotnet-reportgenerator-globaltool' (version '4.8.4') was successfully installed.
  $ cd &quot;./My Project&quot;
  $ dotnet test --settings:./Settings/CodeCoverage.runsettings --collect:&quot;XPlat Code Coverage&quot;
  Running after_script
  Running after script...
  $ echo Stage - Test finished
  Stage - Test finished
  Cleaning up file based variables
  ERROR: Job failed: command terminated with exit code 1
  </code></pre>
  <p>I tinkered around a little bit and realized, that this minified yaml also fails:</p>
  <pre><code>image: microsoft/dotnet:latest
  
  stages:
    - test
  
  test: 
    stage: test
    before_script:
      - 'cd &quot;./My Project&quot;'  
      - 'dotnet restore'
    script:  
      - 'dotnet test --no-restore'
  </code></pre>
  <p>This generates an equal output, except it stops at <code>dotnet restore</code>.
  I honestly don't know what to do, since this is the most minified version of a test I found.
  Did I mess up something within the project, or is the problem within the GitLab Runner itself?</p>
  <p>Project Version: .net Core App 3.1</p>