【发布时间】:2019-04-19 09:37:06
【问题描述】:
我正在使用 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/'
【问题讨论】:
标签: c# docker asp.net-core .net-core code-coverage