كيفية دمج MSPEC مع MS Build؟
-
06-09-2019 - |
سؤال
منذ بضعة أيام شاهدت bdd screencast. بواسطة روب كونري. وبعد في الفيديو الذي أظهر كيفية استخدامه mspec., ، لذلك قمت بتنزيله ولعب مع البتات. ما أريد الآن هو الاندماج mspec. مع MS Builn، لكنني لا أعرف كيف ... أستخدم TFS Team Build كخادم 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 كحجة فهو إخراج بيانات سجل الفريق الخاصة بحيث ستقوم الفريق بالتتبع الاختبارات الخاصة بك.
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