0

Have a yaml file build script and all works fine except for the unit test which fails after various warnings eventually raising MSB3027 and MSB3021 errors.

This is in a pipeline in Atlassian.

Seen issues mentioning long PATH names but how to resolve here? Have similar pipelines setup and working before.

image: mcr.microsoft.com/dotnet/core/sdk:3.1

pipelines:
  branches:
    develop:
        - step:
            name: Build and Test
            caches:
              - dotnetcore
            script:
              - export ENV_NAME=develop
              - export PROJECT_NAME=Myapi
              - export ZIP_FILE=Myapi-dev.zip
              - export TEST_PROJECT=Myapi.Tests
              - dotnet build $PROJECT_NAME
              - dotnet test $TEST_PROJECT --no-build --configuration Release
              # this will publish our app output into a subfolder so that we can package it up
              - dotnet publish $PROJECT_NAME --output $ENV_NAME/publish --configuration release


/usr/share/dotnet/sdk/3.1.402/Microsoft.Common.CurrentVersion.targets(4364,5): 
warning MSB3026: Could not copy "/root/.nuget/packages/microsoft.testplatform.objectmodel/16.7.1/lib/netstandard2.0/pt-BR/Microsoft.TestPlatform.CoreUtilities.resources.dll" 
to "bin/Release/netcoreapp3.1/pt-BR/Microsoft.TestPlatform.CoreUtilities.resources.dll". Beginning retry 1 in 1000ms. 
Could not find a part of the path '/opt/atlassian/pipelines/agent/build/myapi/bin/Release/netcoreapp3.1/pt-BR/Microsoft.TestPlatform.CoreUtilities.resources.dll'.
richardb
  • 943
  • 1
  • 10
  • 27
  • Why its reporting pt-BR (Portuguese) resource files is odd. – richardb Oct 08 '20 at 14:07
  • My Windows 10 PC has pt-br folder in bin\Debug\netcoreapp3.1 and naturally works, so on the build server (some flavor of Linux/Unix), case sensitivity would explain the issue unable to find that file, but how to fix? – richardb Oct 12 '20 at 15:12

1 Answers1

0

In the end this was a third party component and the resource file the Test project needed was not in the expected location for the build pipeline. I worked around the issue by copying the files it needed into the target location.

# Workaround for resource file case sensitivity issue
            - ls -lR .
            - cp -R ./Myapi/bin ./Myapi.Tests/bin
            - cp -R ./Myapi/bin/Debug/netcoreapp3.1/pt-br ./Myapi.Tests/bin/Debug/netcoreapp3.1/pt-BR
            - dotnet test $TEST_PROJECT
richardb
  • 943
  • 1
  • 10
  • 27