Skip to content

Commit 8111a53

Browse files
committed
appveyor config
- run tests using nunit3 runner plugin - squash warnings - switch to 'ci' suffix to ensure precendency over 'build-nnn'
1 parent e181876 commit 8111a53

File tree

8 files changed

+27
-27
lines changed

8 files changed

+27
-27
lines changed

appveyor.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,12 @@ install:
3232
before_build:
3333

3434
build_script:
35-
- ps: .\fake.bat GenerateApi
36-
- ps: dotnet restore "projects\client\RabbitMQ.Client"
37-
- ps: dotnet build "projects\client\RabbitMQ.Client"
38-
- ps: dotnet pack "projects\client\RabbitMQ.Client" -c Release --version-suffix=build-$env:APPVEYOR_BUILD_NUMBER
35+
- cmd: .\build.bat
36+
- cmd: .\run-test.bat
37+
- ps: |
38+
$suffix = Get-Date -format "yyyyMMddhhss"
39+
Write-Host $suffix
40+
dotnet pack "projects\client\RabbitMQ.Client" -c Release --version-suffix=ci-$suffix
3941
4042
test: off
4143

projects/client/Unit/src/unit/Fixtures.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -564,7 +564,7 @@ protected List<ConnectionInfo> ListConnections()
564564
return new ConnectionInfo(columns[0], Convert.ToUInt32(columns[1].Trim()));
565565
}).ToList();
566566
}
567-
catch (Exception ex)
567+
catch (Exception)
568568
{
569569
Console.WriteLine("Bad response from rabbitmqctl list_connections -q pid peer_port:" + Environment.NewLine + stdout);
570570
throw;

projects/client/Unit/src/unit/TestConnectionFactory.cs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public void TestCreateConnectionUsesSpecifiedPort()
7979
cf.Port = 1234;
8080
Assert.That(() =>
8181
{
82-
using(var conn = cf.CreateConnection());
82+
using(var conn = cf.CreateConnection()) {}
8383
}, Throws.TypeOf<BrokerUnreachableException>());
8484
}
8585

@@ -92,7 +92,7 @@ public void TestCreateConnectionWithClientProvidedNameUsesSpecifiedPort()
9292
cf.Port = 1234;
9393
Assert.That(() =>
9494
{
95-
using(var conn = cf.CreateConnection("some_name"));
95+
using(var conn = cf.CreateConnection("some_name")) {}
9696
}, Throws.TypeOf<BrokerUnreachableException>());
9797
}
9898

@@ -125,7 +125,9 @@ public void TestCreateConnectionUsesDefaultPort()
125125
var cf = new ConnectionFactory();
126126
cf.AutomaticRecoveryEnabled = true;
127127
cf.HostName = "localhost";
128-
using(var conn = cf.CreateConnection());
128+
using(var conn = cf.CreateConnection()){
129+
Assert.AreEqual(5672, conn.Endpoint.Port);
130+
}
129131
}
130132

131133
[Test]
@@ -149,7 +151,7 @@ public void TestCreateConnectionWithAutoRecoveryUsesAmqpTcpEndpoint()
149151
cf.HostName = "not_localhost";
150152
cf.Port = 1234 ;
151153
var ep = new AmqpTcpEndpoint("localhost");
152-
using(var conn = cf.CreateConnection(new System.Collections.Generic.List<AmqpTcpEndpoint> { ep }));
154+
using(var conn = cf.CreateConnection(new System.Collections.Generic.List<AmqpTcpEndpoint> { ep })) {}
153155
}
154156

155157
[Test]
@@ -160,7 +162,7 @@ public void TestCreateConnectionWithAutoRecoveryUsesInvalidAmqpTcpEndpoint()
160162
var ep = new AmqpTcpEndpoint("localhost", 1234);
161163
Assert.That(() =>
162164
{
163-
using(var conn = cf.CreateConnection(new System.Collections.Generic.List<AmqpTcpEndpoint> { ep }));
165+
using(var conn = cf.CreateConnection(new System.Collections.Generic.List<AmqpTcpEndpoint> { ep })){}
164166
}, Throws.TypeOf<BrokerUnreachableException>());
165167
}
166168

@@ -171,7 +173,7 @@ public void TestCreateConnectionUsesAmqpTcpEndpoint()
171173
cf.HostName = "not_localhost";
172174
cf.Port = 1234 ;
173175
var ep = new AmqpTcpEndpoint("localhost");
174-
using(var conn = cf.CreateConnection(new System.Collections.Generic.List<AmqpTcpEndpoint> { ep }));
176+
using(var conn = cf.CreateConnection(new System.Collections.Generic.List<AmqpTcpEndpoint> { ep })) {}
175177
}
176178

177179
[Test]
@@ -181,7 +183,7 @@ public void TestCreateConnectionUsesInvalidAmqpTcpEndpoint()
181183
var ep = new AmqpTcpEndpoint("localhost", 1234);
182184
Assert.That(() =>
183185
{
184-
using(var conn = cf.CreateConnection(new System.Collections.Generic.List<AmqpTcpEndpoint> { ep }));
186+
using(var conn = cf.CreateConnection(new System.Collections.Generic.List<AmqpTcpEndpoint> { ep })) {}
185187
}, Throws.TypeOf<BrokerUnreachableException>());
186188
}
187189
}

projects/client/Unit/src/unit/TestConnectionRecovery.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
using System.Collections.Generic;
4848
using System.Threading;
4949

50-
#pragma warning disable 0168
50+
#pragma warning disable 0618
5151

5252
namespace RabbitMQ.Client.Unit
5353
{
@@ -327,7 +327,7 @@ public void TestCreateModelOnClosedAutorecoveringConnectionDoesNotHang()
327327
c.CreateModel();
328328
Assert.Fail("Expected an exception");
329329
}
330-
catch (AlreadyClosedException ace)
330+
catch (AlreadyClosedException)
331331
{
332332
// expected
333333
}
@@ -604,7 +604,7 @@ public void TestRecoveryWithTopologyDisabled()
604604
ch.QueueDeclarePassive(s);
605605
Assert.Fail("Expected an exception");
606606
}
607-
catch (OperationInterruptedException e)
607+
catch (OperationInterruptedException)
608608
{
609609
// expected
610610
}

projects/client/Unit/src/unit/TestHeartbeats.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@
3939
//---------------------------------------------------------------------------
4040

4141
using NUnit.Framework;
42-
using RabbitMQ.Client.Impl;
4342
using System;
4443
using System.Collections.Generic;
4544
using System.Threading;
@@ -107,7 +106,6 @@ public void TestHundredsOfConnectionsWithRandomHeartbeatInterval()
107106
var conn = cf.CreateConnection();
108107
xs.Add(conn);
109108
var ch = conn.CreateModel();
110-
bool wasShutdown = false;
111109

112110
conn.ConnectionShutdown += (sender, evt) =>
113111
{

projects/client/Unit/src/unit/TestRecoverAfterCancel.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@
5050
using RabbitMQ.Client.Events;
5151
using RabbitMQ.Util;
5252

53+
#pragma warning disable 0618
54+
5355
namespace RabbitMQ.Client.Unit
5456
{
5557
[TestFixture]

run-test.bat

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
@ECHO OFF
22

3-
dotnet restore .\projects\client\RabbitMQ.Client
4-
dotnet build .\projects\client\RabbitMQ.Client
5-
dotnet restore .\projects\client\Unit
6-
dotnet build .\projects\client\Unit
7-
dotnet restore .\projects\client\Unit.Runner
8-
cd .\projects\client\Unit.Runner
9-
dotnet run
3+
dotnet restore .\projects\client\RabbitMQ.Client || exit /b
4+
dotnet build .\projects\client\RabbitMQ.Client || exit /b
5+
dotnet restore .\projects\client\Unit || exit /b
6+
dotnet build .\projects\client\Unit || exit /b
7+
dotnet test -f netcoreapp1.0 .\projects\client\Unit --where="cat != RequireSMP & cat != LongRunning & cat != GCTest"

run-test.sh

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ dotnet restore ./projects/client/RabbitMQ.Client
66
dotnet build ./projects/client/RabbitMQ.Client
77
dotnet restore ./projects/client/Unit
88
dotnet build ./projects/client/Unit
9-
dotnet restore ./projects/client/Unit.Runner
10-
cd ./projects/client/Unit.Runner
11-
dotnet run
9+
dotnet test -f netcoreapp1.0 ./projects/client/Unit --where='cat != RequireSMP & cat != LongRunning & cat != GCTest'
1210

1311

0 commit comments

Comments
 (0)