Skip to content

Commit

Permalink
Merge pull request #22 from NikolayPianikov/release/1.0.2
Browse files Browse the repository at this point in the history
#21 Release 1.0.2
  • Loading branch information
NikolayPianikov authored Oct 4, 2016
2 parents 7d7d47a + 5560cb1 commit 402842a
Show file tree
Hide file tree
Showing 21 changed files with 684 additions and 618 deletions.
6 changes: 6 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
teamcity-event-listener 1.0.2 - Oct 1, 2016

Issues Resolved

* 0006 TeamCity does not parse service messages inside errors/output of tests
* 0014 Erroneous TeamCity service messages with multiple test assemblies and (default) parallel execution
112 changes: 73 additions & 39 deletions build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ var configuration = Argument("configuration", "Debug");

var version = "1.0.2";
var modifier = "";
var versionsOfNunitCore = new [] {"3.4.1", ""};

var integrationTestsCategories = new List<string>();

var dbgSuffix = configuration == "Debug" ? "-dbg" : "";
var packageVersion = version + modifier + dbgSuffix;
Expand Down Expand Up @@ -166,37 +169,13 @@ Task("BuildForIntegrationTests")
});

//////////////////////////////////////////////////////////////////////
// INITIALIZE FOR INTEGRATION TEST
// ADD TEAMCITY TEST CATEGORY
//////////////////////////////////////////////////////////////////////

Task("InitializeForIntegrationTests")
Task("AddTeamCityTestCategory")
.Does(() =>
{
EnsureDirectoryExists(TEST_NUNIT_DIR);
EnsureDirectoryExists(TEST_PACKAGES_DIR);
CleanDirectories(TEST_NUNIT_DIR + "**/*.*");
CleanDirectories(TEST_PACKAGES_DIR + "**/*.*");

NuGetInstall(new [] {"NUnit.Runners", "NUnit"}, new NuGetInstallSettings()
{
OutputDirectory = TEST_NUNIT_DIR,
Source = PRERELEASE_PACKAGE_SOURCE,
Prerelease = true,
NoCache = true
});

NuGetInstall(new [] {"NUnit"}, new NuGetInstallSettings()
{
Version = "2.6.4",
OutputDirectory = TEST_PACKAGES_DIR,
Source = PACKAGE_SOURCE,
Prerelease = true,
NoCache = true
});

CleanDirectories(TEST_NUNIT_DIR + "NUnit.Extension.TeamCityEventListener*");
EnsureDirectoryExists(TEST_TEAMCITY_EXT_DIR);
CopyFileToDirectory(BIN_DIR + "teamcity-event-listener.dll", TEST_TEAMCITY_EXT_DIR);
integrationTestsCategories.Add("cat==teamcity");
});

//////////////////////////////////////////////////////////////////////
Expand All @@ -206,23 +185,71 @@ Task("InitializeForIntegrationTests")
Task("IntegrationTest")
.IsDependentOn("Build")
.IsDependentOn("BuildForIntegrationTests")
.IsDependentOn("InitializeForIntegrationTests")
.Does(() =>
{
int rc = StartProcess(
NUNIT3_CONSOLE,
new ProcessSettings()
foreach(var nunitCoreVersion in versionsOfNunitCore)
{
EnsureDirectoryExists(TEST_NUNIT_DIR);
EnsureDirectoryExists(TEST_PACKAGES_DIR);
CleanDirectories(TEST_NUNIT_DIR + "**/*.*");
CleanDirectories(TEST_PACKAGES_DIR + "**/*.*");

NuGetInstall(new [] {"NUnit", "NUnit.ConsoleRunner", "NUnit.Extension.NUnitProjectLoader", "NUnit.Extension.NUnitV2Driver" }, new NuGetInstallSettings()
{
Version = nunitCoreVersion == string.Empty ? null : nunitCoreVersion,
OutputDirectory = TEST_NUNIT_DIR,
Source = nunitCoreVersion == string.Empty ? PRERELEASE_PACKAGE_SOURCE : PACKAGE_SOURCE,
Prerelease = (nunitCoreVersion == string.Empty),
NoCache = true
});

NuGetInstall(new [] {"NUnit"}, new NuGetInstallSettings()
{
Version = "2.6.4",
OutputDirectory = TEST_PACKAGES_DIR,
Source = PACKAGE_SOURCE,
Prerelease = false,
NoCache = true
});

CleanDirectories(TEST_NUNIT_DIR + "NUnit.Extension.TeamCityEventListener*");
EnsureDirectoryExists(TEST_TEAMCITY_EXT_DIR);
CopyFileToDirectory(BIN_DIR + "teamcity-event-listener.dll", TEST_TEAMCITY_EXT_DIR);

var versionCategories = string.Join(
"||",
versionsOfNunitCore
.TakeWhile(i => i != nunitCoreVersion)
.Concat(Enumerable.Repeat(nunitCoreVersion, 1))
.Select(i => "cat==" + (string.IsNullOrEmpty(i) ? "dev" : i)));

var categoriesList =
integrationTestsCategories
.Concat(Enumerable.Repeat(versionCategories, 1))
.Where(i => !string.IsNullOrEmpty(i))
.Select(i => "(" + i + ")").ToList();

var arguments = INTEGRATION_TEST_ASSEMBLY;
if (categoriesList.Count!= 0)
{
Arguments = INTEGRATION_TEST_ASSEMBLY
});
arguments += " --where \"" + string.Join("&&", categoriesList) + "\"";
}

if (rc != 0)
{
var message = rc > 0
? string.Format("Test failure: {0} tests failed", rc)
: string.Format("Test exited with rc = {0}", rc);
int rc = StartProcess(
NUNIT3_CONSOLE,
new ProcessSettings()
{
Arguments = arguments
});

throw new CakeException(message);
if (rc != 0)
{
var message = rc > 0
? string.Format("Test failure: {0} tests failed", rc)
: string.Format("Test exited with rc = {0}", rc);

throw new CakeException(message);
}
}
});

Expand Down Expand Up @@ -256,6 +283,13 @@ Task("Rebuild")
Task("Appveyor")
.IsDependentOn("Build")
.IsDependentOn("Test")
.IsDependentOn("AddTeamCityTestCategory")
.IsDependentOn("IntegrationTest")
.IsDependentOn("Package");

Task("CheckIntegration")
.IsDependentOn("Build")
.IsDependentOn("Test")
.IsDependentOn("IntegrationTest")
.IsDependentOn("Package");

Expand Down
9 changes: 4 additions & 5 deletions src/extension/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("teamcity-event-listener")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyDescription("NUnit Engine extension that helps integration with TeamCity.")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("teamcity-event-listener")]
[assembly: AssemblyCopyright("Copyright © 2016")]
[assembly: AssemblyCopyright("Copyright © 2016")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

Expand All @@ -32,5 +31,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.1.0")]
[assembly: AssemblyFileVersion("1.0.1.0")]
[assembly: AssemblyVersion("1.0.2.0")]
[assembly: AssemblyFileVersion("1.0.2.0")]
11 changes: 3 additions & 8 deletions src/nunit.integration.tests/AppConfig.feature
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
Background:
Given NUnit path is ..\nunit\

@3.4.1
Scenario Outline: I can the test with config file
Given Framework version is <frameworkVersion>
And I have added successfulWithConfig method as SuccessfulTest to the class Foo.Tests.UnitTests1 for foo.tests
Expand All @@ -22,15 +23,14 @@ Scenario Outline: I can the test with config file
| Failed | 0 |
| Inconclusive | 0 |
| Skipped | 0 |


Examples:
| configurationType | frameworkVersion |
| CmdArguments | Version45 |
| CmdArguments | Version40 |
| ProjectFile | Version45 |
| ProjectFile | Version40 |

@3.4.1
Scenario Outline: I can the test with config file for several assemblies using the command line for the list of assemblies
Given Framework version is <frameworkVersion>
And I have added successfulWithConfig method as SuccessfulTest to the class Foo1.Tests.UnitTests1 for foo1.tests
Expand Down Expand Up @@ -73,14 +73,12 @@ Scenario Outline: I can the test with config file for several assemblies using t
| testFinished | Foo2.Tests.UnitTests1.SuccessfulTest | |
| flowFinished | | |
| testSuiteFinished | foo2.tests.dll | |



Examples:
| configurationType | frameworkVersion |
| CmdArguments | Version45 |
| CmdArguments | Version40 |

@3.4.1
Scenario Outline: I can the test with config file for several assemblies using the project file for the list of assemblies
Given Framework version is <frameworkVersion>
And I have added successfulWithConfig method as SuccessfulTest to the class Foo1.Tests.UnitTests1 for foo1.tests
Expand Down Expand Up @@ -123,9 +121,6 @@ Scenario Outline: I can the test with config file for several assemblies using t
| testFinished | Foo2.Tests.UnitTests1.SuccessfulTest | |
| flowFinished | | |
| testSuiteFinished | foo2.tests.dll | |



Examples:
| configurationType | frameworkVersion |
| ProjectFile | Version45 |
Expand Down
Loading

0 comments on commit 402842a

Please sign in to comment.