我正在使用mcr.microsoft.com/dotnet/core/sdk:2.2映像在容器中运行单元测试。无法通过引发以下错误来生成覆盖率报告。
error : One or more errors occurred.
(Could not find file '/tmp/xunit.runner.visualstudio.dotnetcore.testadapter
Dockerfile:
FROM mcr.microsoft.com/dotnet/core/sdk:2.2
WORKDIR /app
COPY . /app
CMD [ "bash", "./build.sh" ]
build.sh
#!bin/bash
export PATH="$PATH:/root/.dotnet/tools"
echo "Installing Tools"
dotnet tool install --global coverlet.console
echo "Adding Package"
dotnet add <.csproj> package coverlet.msbuild
echo "Running Tests"
dotnet test <.csproj> /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:CoverletOutput='./coverage/'
答案 0 :(得分:0)
2.6.0
的{{1}}版本存在问题。
硬编码版本解决了这个问题。
coverlet