Skip to content
This repository was archived by the owner on Aug 23, 2019. It is now read-only.

Commit 95c919f

Browse files
committed
AppVeyor Integration
1 parent c8a05dc commit 95c919f

File tree

4 files changed

+25
-9
lines changed

4 files changed

+25
-9
lines changed

Machine.Specifications.ConsoleRunner/Machine.Specifications.ConsoleRunner.csproj

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,10 @@
6060
<HintPath>..\packages\CommandLineParser.1.9.71\lib\net35\CommandLine.dll</HintPath>
6161
</Reference>
6262
<Reference Include="Machine.Specifications.Reporting">
63-
<HintPath>..\packages\Machine.Specifications.Reporting.0.9.0-Unstable0014\lib\net20\Machine.Specifications.Reporting.dll</HintPath>
64-
<Private>True</Private>
63+
<HintPath>..\packages\Machine.Specifications.Reporting.0.9.0-Unstable0015\lib\net20\Machine.Specifications.Reporting.dll</HintPath>
6564
</Reference>
6665
<Reference Include="Machine.Specifications.Reporting.Templates">
67-
<HintPath>..\packages\Machine.Specifications.Reporting.0.9.0-Unstable0014\lib\net20\Machine.Specifications.Reporting.Templates.dll</HintPath>
68-
<Private>True</Private>
66+
<HintPath>..\packages\Machine.Specifications.Reporting.0.9.0-Unstable0015\lib\net20\Machine.Specifications.Reporting.Templates.dll</HintPath>
6967
</Reference>
7068
<Reference Include="Machine.Specifications.Runner.Utility, Version=0.9.0.0, Culture=neutral, processorArchitecture=MSIL">
7169
<SpecificVersion>False</SpecificVersion>

Machine.Specifications.ConsoleRunner/Options.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,14 @@ public Options()
6868
HelpText = "Disables TeamCity autodetection")]
6969
public bool DisableTeamCityAutodetection { get; set; }
7070

71+
[Option("appveyor",
72+
HelpText = "Reporting for AppVeyor CI integration (also auto-detected)")]
73+
public bool AppVeyorIntegration { get; set; }
74+
75+
[Option("no-appveyor-autodetect",
76+
HelpText = "Disables AppVeyor autodetection")]
77+
public bool DisableAppVeyorAutodetection { get; set; }
78+
7179
[OptionList('i',
7280
"include",
7381
HelpText = "Execute all specifications in contexts with these comma delimited tags. Ex. -i \"foo,bar,foo_bar\"",
@@ -107,6 +115,8 @@ public string GetUsage()
107115
sb.AppendLine(" -w, --wait Wait 15 seconds for debugger to be attached");
108116
sb.AppendLine(" --teamcity Reporting for TeamCity CI integration (also auto-detected)");
109117
sb.AppendLine(" --no-teamcity-autodetect Disables TeamCity autodetection");
118+
sb.AppendLine(" --appveyor Reporting for AppVeyor CI integration (also auto-detected)");
119+
sb.AppendLine(" --no-appveyor-autodetect Disables AppVeyor autodetection");
110120
sb.AppendLine(" --html <PATH> Outputs the HTML report to path, one-per-assembly w/ index.html (if directory, otherwise all are in one file)");
111121
sb.AppendLine(" --xml <PATH> Outputs the XML report to the file referenced by the path");
112122
sb.AppendLine(" -h, --help Shows this help message");

Machine.Specifications.ConsoleRunner/Program.cs

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,14 @@
99
using Machine.Specifications.ConsoleRunner.Outputs;
1010
using Machine.Specifications.Reporting.Generation.Spark;
1111
using Machine.Specifications.Reporting.Generation.Xml;
12-
using Machine.Specifications.Reporting.Integration;
12+
using Machine.Specifications.Reporting.Integration.AppVeyor;
13+
using Machine.Specifications.Reporting.Integration.TeamCity;
1314
using Machine.Specifications.Runner.Utility;
1415

1516
namespace Machine.Specifications.ConsoleRunner
1617
{
18+
using Reporting.Integration.AppVeyor;
19+
1720
public class Program
1821
{
1922
[LoaderOptimization(LoaderOptimization.MultiDomainHost)]
@@ -50,13 +53,18 @@ public ExitCode Run(string[] arguments)
5053
timer
5154
};
5255

56+
string teamCityProjectName = Environment.GetEnvironmentVariable("TEAMCITY_PROJECT_NAME");
57+
string appVeyorApiUrl = Environment.GetEnvironmentVariable("APPVEYOR_API_URL");
58+
5359
ISpecificationRunListener mainListener;
54-
if (options.TeamCityIntegration ||
55-
(!options.DisableTeamCityAutodetection &&
56-
Environment.GetEnvironmentVariable("TEAMCITY_PROJECT_NAME") != null))
60+
if (options.TeamCityIntegration || (!options.DisableTeamCityAutodetection && teamCityProjectName != null))
5761
{
5862
mainListener = new TeamCityReporter(_console.WriteLine, timer);
5963
}
64+
else if (options.AppVeyorIntegration || (!options.DisableAppVeyorAutodetection && appVeyorApiUrl != null))
65+
{
66+
mainListener = new AppVeyorReporter(_console.WriteLine, new AppVeyorBuildWorkerApiClient(appVeyorApiUrl));
67+
}
6068
else
6169
{
6270
mainListener = new RunListener(_console, DetermineOutput(options, _console), timer);

Machine.Specifications.ConsoleRunner/packages.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<packages>
33
<package id="CommandLineParser" version="1.9.71" targetFramework="net35" />
44
<package id="GitFlowVersionTask" version="0.14.0" targetFramework="net35" />
5-
<package id="Machine.Specifications.Reporting" version="0.9.0-Unstable0014" targetFramework="net35" />
5+
<package id="Machine.Specifications.Reporting" version="0.9.0-Unstable0015" targetFramework="net35" />
66
<package id="Machine.Specifications.Runner.Utility" version="0.9.0-Unstable0020" targetFramework="net35" />
77
<package id="Spark" version="1.7.5.3" targetFramework="net35" />
88
</packages>

0 commit comments

Comments
 (0)