2013-09-06 3 views
1

저는 TeamCity를 처음 사용했습니다. 좀 XML은TeamCity 및 Gallio 통합을 설정하는 단계별 방법

<Gallio IgnoreFailures="true" ... 

같은 트릭을 수행하지만이 넣어 wher 모르는 것을 발견했다. 이것을 호출하는 방법. TeamCity에 추가 할 단계. 나는 어떤 튜토리얼에 대한 greateful 것입니다.

답변

2

1 솔루션에 라이브러리 프로젝트를 추가하십시오.
2 프로젝트를 편집하고 (아래 섹션 추가) 커밋하십시오.

3

<!-- put this in csproj almost at the end in target section --> 
<UsingTask AssemblyFile="Gallio directory - wherever it is insalled\bin\Gallio.MSBuildTasks.dll" TaskName="Gallio" /> 

<ItemGroup> 
    <TestAssemblies Include="Path to your test project dll (ex ..\testProjName\bin\Debug\testProjName.dll" /> 
    <!-- put as many TestAssemblies as you want --> 
</ItemGroup> 

<!-- name of the target is important to rememver. You will use it in Team City Configuration --> 
<Target Name="RunTests"> 
    <Gallio Files="@(TestAssemblies)" IgnoreFailures="false" ReportTypes="html" ShowReports="true"> 
    <!-- This tells MSBuild to store the output value of the task's ExitCode property 
     into the project's ExitCode property --> 
     <Output TaskParameter="ExitCode" PropertyName="ExitCode" /> 
    </Gallio> 
    <Error Text="Tests execution failed" Condition="'$(ExitCode)' != 0" /> 
</Target> 

구성을 구축 할 수있는 MSBuild에서 단계를 추가합니다. a) 러너 유형 : MSBuild b) 빌드 파일 경로 : 테스트 프로젝트의 상대 경로. c) 대상 : 위의 예에서 대상 이름은 "RunTests"입니다. d) 그에 따라 다른 모든 필드를 채 웁니다. e) 저장 단계

프로젝트를 이미 실행하고 테스트 할 수 있어야합니다. 여기에 추가 할 수있는 다른 단계가 있다고 생각되면 내 대답을 편집하십시오.

나는 한동안 답변을 찾고 있었지만 부분적으로는 여러 사이트에서 발견했지만 전체적으로는 어디에도 없습니다. 예 : other similar answer은 부분적 일뿐만 아니라 MsBuild 3.2에서 작동하지 않는 매개 변수를가집니다.

관련 문제