Como integrar MSpec com MS construir?
-
06-09-2019 - |
Pergunta
Poucos dias atrás eu assisti a um BDD screencast por Rob Conery. No vídeo ele mostrou como usar MSpec , então eu baixei e jogado com os bits. O que eu quero agora é integrar MSpec com MS Build, mas eu não sei como ... Eu uso TFS equipe de construção do meu servidor de CI - você pode me ajudar a integrar MSpec com MSBuild?
Obrigado!
Solução
No momento, a maneira mais fácil é apenas Exec-lo.
<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>
Edit: Notas de Configurações adicionais, você pode ligar para o destino assim:
<MSBuild Projects="yourmsbuild.msbuild" Targets="RunSpecs" Properties="AdditionalSettings=-s -t -i "web" --html Specs\Specs.html"/>
Se você passar --teamcity como um argumento Ele produz dados de log TeamCity específico para TeamCity vai acompanhar os seus testes.
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
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow