Skip to content
Browse files

- added more assemblies to be tested with MSBuild script

- ServiceStack.Common.Tests.OAuth redis settings pushed to the config for TeamCity integration
- added new TeamCityBuild target
  • Loading branch information...
1 parent 612eef9 commit 669add4e475e869b211e596ba76148e2246c616d @desunit desunit committed Aug 28, 2012
View
21 build/build.msbuild
@@ -2,22 +2,28 @@
<PropertyGroup>
<BuildSolutionDir>$(MSBuildProjectDirectory)/..</BuildSolutionDir>
<Configuration Condition="$(Configuration) == ''">Release</Configuration>
+ <NUnitConsoleArgs>/noshadow</NUnitConsoleArgs>
</PropertyGroup>
<PropertyGroup>
<DoBuildSolutionsDependsOn>
- BeforeBuildSolutions;
BuildSolutions
</DoBuildSolutionsDependsOn>
</PropertyGroup>
<Target Name="Default" DependsOnTargets="$(DoBuildSolutionsDependsOn)" />
+ <Target Name="TeamCityBuild">
+ <Copy SourceFiles="$(BuildSolutionDir)/tests/ServiceStack.Common.Tests/ci.app.config" DestinationFiles="$(BuildSolutionDir)/tests/ServiceStack.Common.Tests/app.config" />
+ <CallTarget Targets="Default" />
+ </Target>
+
<Target Name="UnitTests" DependsOnTargets="$(DoBuildSolutionsDependsOn)">
- <Exec Command="$(BuildSolutionDir)/lib/tests/nunit-console-x86.exe $(BuildSolutionDir)/tests/ServiceStack.Messaging.Tests/bin/$(Configuration)/ServiceStack.Messaging.Tests.dll" />
- <Exec Command="$(BuildSolutionDir)/lib/tests/nunit-console-x86.exe $(BuildSolutionDir)/tests/ServiceStack.Common.Tests/bin/$(Configuration)/ServiceStack.Common.Tests.dll" />
- <Exec Command="$(BuildSolutionDir)/lib/tests/nunit-console-x86.exe $(BuildSolutionDir)/tests/ServiceStack.Auth.Tests/bin/$(Configuration)/ServiceStack.Auth.Tests.dll" />
- <Exec Command="$(BuildSolutionDir)/lib/tests/nunit-console-x86.exe $(BuildSolutionDir)/tests/ServiceStack.WebHostApp/bin/ServiceStack.WebHost.Endpoints.Tests.dll" />
+ <Exec Command="$(BuildSolutionDir)/lib/tests/nunit-console-x86.exe $(BuildSolutionDir)/tests/ServiceStack.ServiceHost.Tests/bin/$(Configuration)/ServiceStack.ServiceHost.Tests.dll $(NUnitConsoleArgs)" />
+ <Exec Command="$(BuildSolutionDir)/lib/tests/nunit-console-x86.exe $(BuildSolutionDir)/tests/ServiceStack.Messaging.Tests/bin/$(Configuration)/ServiceStack.Messaging.Tests.dll $(NUnitConsoleArgs)" />
+ <Exec Command="$(BuildSolutionDir)/lib/tests/nunit-console-x86.exe $(BuildSolutionDir)/tests/ServiceStack.Common.Tests/bin/$(Configuration)/ServiceStack.Common.Tests.dll $(NUnitConsoleArgs)" />
+ <Exec Command="$(BuildSolutionDir)/lib/tests/nunit-console-x86.exe $(BuildSolutionDir)/tests/ServiceStack.Auth.Tests/bin/$(Configuration)/ServiceStack.Auth.Tests.dll $(NUnitConsoleArgs)" />
+ <Exec Command="$(BuildSolutionDir)/lib/tests/nunit-console-x86.exe $(BuildSolutionDir)/tests/ServiceStack.WebHostApp/bin/ServiceStack.WebHost.Endpoints.Tests.dll $(NUnitConsoleArgs)" />
</Target>
<Target Name="Build">
@@ -26,11 +32,6 @@
<MSBuild Projects="../src/ServiceStack/ServiceStack.csproj" Properties="Configuration=$(Configuration)"/>
</Target>
- <Target Name="BeforeBuildSolutions">
- <Message Text="*****Before building solution*****" Importance="high"/>
- <!--<Copy SourceFiles="Test/ci.app.config" DestinationFiles="Test/app.config" />-->
- </Target>
-
<Target Name="BuildSolutions">
<MSBuild Projects="$(BuildSolutionDir)/src/ServiceStack.sln" Targets="Build"
Properties="Configuration=$(Configuration)" />
View
88 tests/ServiceStack.Common.Tests/OAuth/OAuthUserSessionWithoutTestSourceTests.cs
@@ -1,28 +1,29 @@
using System;
using System.Collections.Generic;
using System.IO;
-using NUnit.Framework;
-using ServiceStack.Common.Utils;
+using NUnit.Framework;
+using ServiceStack.Common.Utils;
+using ServiceStack.Configuration;
using ServiceStack.OrmLite;
using ServiceStack.OrmLite.SqlServer;
-using ServiceStack.OrmLite.Sqlite;
-using ServiceStack.Redis;
+using ServiceStack.OrmLite.Sqlite;
+using ServiceStack.Redis;
using ServiceStack.ServiceInterface.Auth;
using ServiceStack.Text;
-namespace ServiceStack.Common.Tests.OAuth
-{
- //[TestFixture, Ignore("Manual OAuth Test with iteration over data stores")]
- public class OAuthUserSessionWithoutTestSourceTests
+namespace ServiceStack.Common.Tests.OAuth
+{
+ [TestFixture, Explicit("Manual OAuth Test with iteration over data stores")]
+ public class OAuthUserSessionWithoutTestSourceTests
{
- private OAuthUserSessionTests tests;
- private readonly List<IUserAuthRepository> userAuthRepositorys = new List<IUserAuthRepository>();
-
- OrmLiteConnectionFactory dbFactory = new OrmLiteConnectionFactory(
- ":memory:", false, SqliteOrmLiteDialectProvider.Instance);
-
- [SetUp]
- public void SetUp()
+ private OAuthUserSessionTests tests;
+ private readonly List<IUserAuthRepository> userAuthRepositorys = new List<IUserAuthRepository>();
+
+ OrmLiteConnectionFactory dbFactory = new OrmLiteConnectionFactory(
+ ":memory:", false, SqliteOrmLiteDialectProvider.Instance);
+
+ [SetUp]
+ public void SetUp()
{
try
{
@@ -31,7 +32,8 @@ public void SetUp()
inMemoryRepo.Clear();
userAuthRepositorys.Add(inMemoryRepo);
- var redisRepo = new RedisAuthRepository(new BasicRedisClientManager());
+ var appSettings = new AppSettings();
+ var redisRepo = new RedisAuthRepository(new BasicRedisClientManager(new string[] { appSettings.GetString("Redis.Host") ?? "localhost" }));
redisRepo.Clear();
userAuthRepositorys.Add(redisRepo);
@@ -64,32 +66,32 @@ public void SetUp()
Console.WriteLine(ex.Message);
throw;
}
- }
-
- [Test]
- public void Does_persist_TwitterOAuth()
- {
- userAuthRepositorys.ForEach(x => tests.Does_persist_TwitterOAuth(x));
- }
-
- [Test]
- public void Does_persist_FacebookOAuth()
- {
- userAuthRepositorys.ForEach(x => tests.Does_persist_FacebookOAuth(x));
- }
-
- [Test]
- public void Does_merge_FacebookOAuth_TwitterOAuth()
- {
- userAuthRepositorys.ForEach(x => tests.Does_merge_FacebookOAuth_TwitterOAuth(x));
- }
-
- [Test]
- public void Can_login_with_user_created_CreateUserAuth()
- {
- userAuthRepositorys.ForEach(x => tests.Can_login_with_user_created_CreateUserAuth(x));
+ }
+
+ [Test]
+ public void Does_persist_TwitterOAuth()
+ {
+ userAuthRepositorys.ForEach(x => tests.Does_persist_TwitterOAuth(x));
}
-
- }
+ [Test]
+ public void Does_persist_FacebookOAuth()
+ {
+ userAuthRepositorys.ForEach(x => tests.Does_persist_FacebookOAuth(x));
+ }
+
+ [Test]
+ public void Does_merge_FacebookOAuth_TwitterOAuth()
+ {
+ userAuthRepositorys.ForEach(x => tests.Does_merge_FacebookOAuth_TwitterOAuth(x));
+ }
+
+ [Test]
+ public void Can_login_with_user_created_CreateUserAuth()
+ {
+ userAuthRepositorys.ForEach(x => tests.Can_login_with_user_created_CreateUserAuth(x));
+ }
+
+
+ }
}
View
14 tests/ServiceStack.Common.Tests/ci.app.config
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<!-- TeamCity will copy this config into app.config -->
+<configuration>
+ <configSections>
+ </configSections>
+ <appSettings>
+ <add key="Redis.Host" value="10.50.0.198:6379" />
+ </appSettings>
+ <connectionStrings>
+ <add name="ServiceStack.Common.Tests.Properties.Settings.authConnectionString"
+ connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\auth.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True"
+ providerName="System.Data.SqlClient" />
+ </connectionStrings>
+</configuration>

0 comments on commit 669add4

Please sign in to comment.
Something went wrong with that request. Please try again.