Comment intégrer MSpec avec MS construire?
-
06-09-2019 - |
Question
Il y a quelques jours j'ai regardé un BDD screencast par Rob Conery . Dans la vidéo, il a montré comment utiliser MSpec , donc je l'ai téléchargé et joué avec les bits. Ce que je veux maintenant intégrer MSpec avec MS build, mais je ne sais pas comment ... J'utilise la construction de l'équipe TFS que mon serveur CI - Pouvez vous me aider à intégrer MSpec avec MSBuild?
Merci!
La solution
Au moment le plus simple est à Exec juste.
<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>
Modifier: avis Paramètres supplémentaires, vous pouvez appeler dans la cible comme ceci:
<MSBuild Projects="yourmsbuild.msbuild" Targets="RunSpecs" Properties="AdditionalSettings=-s -t -i "web" --html Specs\Specs.html"/>
Si vous passez --teamcity comme argument, elle délivre en sortie des données de journaux spécifiques de TeamCity afin TeamCity permettra de suivre vos tests.
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
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow