microsoft/PartsUnlimited

PartsUnlimited.UnitTests.dll provided was not found

m13biker opened this issue · 2 comments

Hi,

Im Following the Microsoft lab for CI and CD using the Parts unlimited Repo but the .Net core Build in the AzureDevOps pipeline fails with the following error:

##[error]dotnet.exe : The test source file 
"d:\a\1\s\test\PartsUnlimited.UnitTests\bin\debug\netcoreapp2.2\PartsUnlimited.UnitTests.dll" provided was not found.
At D:\a\1\s\build.ps1:27 char:1
+ & dotnet test $test --configuration $BuildConfiguration --logger "trx ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (The test source... was not found.:String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError
 

##[error]Process completed with exit code 1 and had 1 error(s) written to the error stream.

Tired to clone the repo couple of times but the job stil fails with the same error.

The configuration for the job is the following:
Azure Pipeline
Azure DevOps GIT Repository Cloned from: https://github.com/microsoft/PartsUnlimited.git
Agent Type: vs2017-win2016

Screenshot_6

Hope someone can help us with this.

Thank you.

Julian G

I've had this exact same issue, although i don't know how to fix it i have found a way to workaround it (this will screw me over if later on in the lab it relies on the unit tests)
you need to edit the build.ps1 file in your repo, and comment out the following lines
#$test = Join-Path "$BuildDir" "test\PartsUnlimited.UnitTests\PartsUnlimited.UnitTests.csproj"
#& dotnet build $test --configuration $BuildConfiguration --verbosity d
#& dotnet test $test --configuration $BuildConfiguration --logger "trx;LogFileName=testresults.xml" --no-build

In visual studio 2017 my projects build perfectly fine so i am not sure why they are failing to build on the agent, it's possible there's some missing component but i don't know (i tried to run it on my own self hosted agent but i was getting errors at the python task which i couldn't resolve).

once you've done the above you're going to get another issue more than likely regarding the manifest. Insert a new-item command inbetween these two lines like so
$outputDirectory = Join-Path $publishDirectory "PartsUnlimited"
New-Item -Path $outputDirectory -ItemType Directory
& dotnet publish $webSite --framework netcoreapp2.2 --output $outputDirectory --configuration $BuildConfiguration

hope that helps, but note this is a workaround not a fix, i did this just to get my pipeline working so i can progress with the lab and hope it doesn't bite me later on

@SteveMills2020 thanks so much for this - your workaround got me through the pipeline build - legend!