MSPEC를 MS 빌드와 통합하는 방법은 무엇입니까?
-
06-09-2019 - |
문제
며칠 전에 나는 a BDD 스크린 캐스트 ~에 의해 Rob Conery. 비디오에서 그는 사용 방법을 보여주었습니다 MSPEC, 그래서 나는 그것을 다운로드하고 비트로 연주했습니다. 내가 지금 원하는 것은 통합하는 것입니다 MSPEC MS 빌드를 사용하면 어떻게하는지 모르겠습니다 ... TFS 팀 빌드를 CI 서버로 사용합니다. 통합을 도와 줄 수 있습니까? MSPEC MSBuild와 함께?
감사!
해결책
현재 가장 쉬운 방법은 그냥 실행하는 것입니다.
<Target Name="RunSpecs">
<PropertyGroup>
<MSpecCommand>
lib\machine\specifications\Machine.Specifications.ConsoleRunner.exe $(AdditionalSettings) path\to\your\project\bin\Debug\Your.Project.Specs.dll path\to\your\other\project\bin\Debug\Your.Other.Project.dll
</MSpecCommand>
</PropertyGroup>
<Message Importance="high" Text="Running Specs with this command: $(MSpecCommand)"/>
<Exec Command="$(MSpecCommand)" />
</Target>
편집 : 추가 설정에주의하십시오. 다음과 같이 대상으로 호출 할 수 있습니다.
<MSBuild Projects="yourmsbuild.msbuild" Targets="RunSpecs" Properties="AdditionalSettings=-s -t -i "web" --html Specs\Specs.html"/>
인수로 -팀을 통과하면 TeamCity 특정 로그 데이터를 출력하여 TeamCity가 테스트를 추적합니다.
Machine.Specifications
Copyright (C) 2007, 2008
Usage: mspec-runner.exe [options] <assemblies>
Options:
-i, --include Executes all specifications in contexts with these comma delimited tags. Ex. -i "foo,bar,foo_bar"
-x, --exclude Exclude specifications in contexts with these comma delimited tags. Ex. -x "foo,bar,foo_bar"
-t, --timeinfo Shows time-related information in HTML output
-s, --silent Suppress console output
--teamcity Reporting for TeamCity CI integration.
--html <PATH> Outputs an HTML file(s) to path, one-per-assembly w/ index.html (if directory, otherwise all are in
one file)
-h, --help Shows this help message
제휴하지 않습니다 StackOverflow