dotnet 테스트를 사용하여 VSTS에서 테스트 프로젝트를 실행하는 방법을 아는 사람이 있습니까?VSTS의 릴리스 단계에서 Visual Studio 2017 dotnet 테스트 프로젝트를 실행하는 방법
내 상황은 여기입니다. 나는 단순한 MVC dotnet 코어 웹 프로젝트를 가지고 있는데, 이는 푸른 웹 애플리케이션에서 호스팅되고 호스팅된다. 솔루션에서 나는 xUnitTest 프로젝트를 가지고있다.
솔루션에서 두 프로젝트를 모두 성공적으로 빌드하고 VSTS의 출시 단계에 대비 한 빌드 단계의 결과를 게시 할 수 있습니다. Webapp을 잘 할 수는 있지만 문제가있는 곳인 webapp를 배포 한 후에 테스트를 실행하고 싶습니다. PowerShell을 통해 "DOTNET 테스트"를 실행하려고
는는 비주얼 스튜디오 2017 프로젝트가없는 project.json을 찾을 수 없다는 실패합니다. 나는 'DOTNET'릴리스의 단계를 사용하면
Directory: D:\a\r1\a\Test QA-ASP.NET (PREVIEW)-CI\Extract\TrentsCoreTestProj
2017-05-18T08:39:05.5423817Z
2017-05-18T08:39:05.5423817Z
2017-05-18T08:39:05.5433824Z Mode LastWriteTime Length Name
2017-05-18T08:39:05.5433824Z ---- ------------- ------ ----
2017-05-18T08:39:05.5513817Z d----- 5/18/2017 6:48 AM bin
2017-05-18T08:39:05.5535129Z d----- 5/18/2017 6:50 AM obj
2017-05-18T08:39:05.5673839Z -a---- 5/18/2017 6:48 AM 1179 DemoTests.cs
2017-05-18T08:39:05.5693821Z -a---- 5/18/2017 6:48 AM 637 TrentsCoreTestProj.csproj
2017-05-18T08:39:07.0767288Z
2017-05-18T08:39:07.0767288Z Welcome to .NET Core!
2017-05-18T08:39:07.0767288Z ---------------------
2017-05-18T08:39:07.0767288Z Learn more about .NET Core @ https://aka.ms/dotnet-docs. Use dotnet --help to see available commands or go to https://aka.ms/dotnet-cli-docs.
2017-05-18T08:39:07.0767288Z Telemetry
2017-05-18T08:39:07.0767288Z --------------
2017-05-18T08:39:07.0767288Z The .NET Core tools collect usage data in order to improve your experience. The data is anonymous and does not include commandline arguments. The data is collected by Microsoft and shared with the community.
2017-05-18T08:39:07.0767288Z You can opt out of telemetry by setting a DOTNET_CLI_TELEMETRY_OPTOUT environment variable to 1 using your favorite shell.
2017-05-18T08:39:07.0767288Z You can read more about .NET Core tools telemetry @ https://aka.ms/dotnet-cli-telemetry.
2017-05-18T08:39:07.0767288Z Configuring...
2017-05-18T08:39:07.0767288Z -------------------
2017-05-18T08:39:07.0767288Z A command is running to initially populate your local package cache, to improve restore speed and enable offline access. This command will take up to a minute to complete and will only happen once.
2017-05-18T08:39:12.5336298Z Decompressing 0%Decompressing 1%Decompressing 2%Decompressing 3%Decompressing 4%Decompressing
...
97%Decompressing 98%Decompressing 99%Decompressing 100% 5339 ms
2017-05-18T08:39:33.4781464Z Expanding 0%Expanding 1%Expanding 2%Expanding 3%Expanding 4%Expanding
...
97%Expanding 98%Expanding 99%Expanding 100% 20646 ms
2017-05-18T08:39:59.8431503Z ##[error]dotnet-test Error: 0 : System.InvalidOperationException: D:\a\r1\a\Test QA-ASP.NET (PREVIEW)-CI\Extract\TrentsCoreTestProj\project.json does not exist.
at Microsoft.DotNet.Tools.Test.TestCommand.GetProjectPath(String projectPath)
at Microsoft.DotNet.Tools.Test.TestCommand.DoRun(String[] args)
2017-05-18T08:40:01.1967180Z ##[error]Process completed with exit code -1 and had 1 error(s) written to the error stream.
2017-05-18T08:40:01.1977186Z ##[section]Finishing: PowerShell Script
, 그것은 csproj 내가이 확실히있는 파워 쉘에서 볼 수있는이 아니라고 말한다.
2017-05-18T08:40:01.1997188Z ==============================================================================
2017-05-18T08:40:01.1997188Z Task : .NET Core
2017-05-18T08:40:01.1997188Z Description : Build, test and publish using dotnet core command-line.
2017-05-18T08:40:01.1997188Z Version : 1.0.1
2017-05-18T08:40:01.1997188Z Author : Microsoft Corporation
2017-05-18T08:40:01.1997188Z Help : [More Information](https://go.microsoft.com/fwlink/?linkid=832194)
2017-05-18T08:40:01.1997188Z ==============================================================================
2017-05-18T08:40:01.6787208Z [command]"C:\Program Files\dotnet\dotnet.exe" test "D:\a\r1\a\Test QA-ASP.NET (PREVIEW)-CI\Extract\TrentsCoreTestProj\TrentsCoreTestProj.csproj"
2017-05-18T08:40:01.8877228Z dotnet-test Error: 0 : System.InvalidOperationException: D:\a\r1\a\Test QA-ASP.NET (PREVIEW)-CI\Extract\TrentsCoreTestProj\TrentsCoreTestProj.csproj\project.json does not exist.
2017-05-18T08:40:01.8887223Z at Microsoft.DotNet.Tools.Test.TestCommand.GetProjectPath(String projectPath)
2017-05-18T08:40:01.8887223Z at Microsoft.DotNet.Tools.Test.TestCommand.DoRun(String[] args)
2017-05-18T08:40:01.9397245Z ##[error]Error: C:\Program Files\dotnet\dotnet.exe failed with return code: 4294967295
2017-05-18T08:40:01.9397245Z ##[error]Dotnet command failed with non-zero exit code on the following projects : D:\a\r1\a\Test QA-ASP.NET (PREVIEW)-CI\Extract\TrentsCoreTestProj\TrentsCoreTestProj.csproj
2017-05-18T08:40:01.9397245Z ##[section]Finishing: dotnet test
나는 그러나 나는 우리의 CI의 테스트 부분을 빌드 할 수 있도록 VSTS에있을이 필요, 동일한 명령을 사용하여 성공적으로 내 로컬 명령 줄에서 "DOTNET 테스트"를 실행할 수 있습니다.
릴리스에 사용한 파일은 무엇입니까? 테스트 파일이 존재합니까 (예 : csproj)? –