Skip to content

Commit 72663df

Browse files
committed
Include dotnet cli builds to travis and appveyor
Appveyor: use build matrix for ci_type and target runtime Travis: Only build .NET Core target on travis Test: use exception derived type Test: Removed unused variable
1 parent 59be9ee commit 72663df

File tree

4 files changed

+40
-11
lines changed

4 files changed

+40
-11
lines changed

.travis.yml

+18-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
language: csharp
2-
sudo: false
2+
sudo: required
3+
dist: trusty
4+
addons:
5+
apt:
6+
packages:
7+
- gettext
8+
- libcurl4-openssl-dev
9+
- libicu-dev
10+
- libssl-dev
11+
- libunwind8
12+
- zlib1g
313
branches:
414
except:
515
- 1.0
@@ -9,7 +19,12 @@ branches:
919
solution: src/Cassandra.sln
1020
install:
1121
- nuget restore src/Cassandra.sln
12-
- nuget install NUnit.Runners -Version 3.2.1 -OutputDirectory testrunner
22+
- nuget install NUnit.Runners -Version 3.4.1 -OutputDirectory testrunner
23+
- export DOTNET_INSTALL_DIR="$PWD/.dotnetcli"
24+
- curl -sSL https://raw.githubusercontent.com/dotnet/cli/rel/1.0.0/scripts/obtain/dotnet-install.sh | bash /dev/stdin --version latest --install-dir "$DOTNET_INSTALL_DIR"
25+
- export PATH="$DOTNET_INSTALL_DIR:$PATH"
1326
script:
1427
- xbuild /p:Configuration=Release /v:m /p:restorepackages=false src/Cassandra.sln
15-
- mono ./testrunner/NUnit.ConsoleRunner.3.2.1/tools/nunit3-console.exe ./src/Cassandra.Tests/bin/Release/Cassandra.Tests.dll
28+
- mono ./testrunner/NUnit.ConsoleRunner.3.4.1/tools/nunit3-console.exe ./src/Cassandra.Tests/bin/Release/Cassandra.Tests.dll
29+
- dotnet restore
30+
- dotnet test src/Cassandra.Tests -c Release -f netcoreapp1.0

appveyor.yml

+18-3
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,19 @@ configuration:
1414
environment:
1515
NUNIT_PATH: nunit3-console
1616
matrix:
17-
- CASSANDRA_VERSION: 3.4
18-
19-
- CASSANDRA_VERSION: 2.2.5
17+
- TARGET: net452
18+
CI_TYPE: UNIT
19+
- TARGET: netcoreapp1.0
20+
CI_TYPE: UNIT
21+
- TARGET: net452
22+
CASSANDRA_VERSION: 3.4
23+
CI_TYPE: INTEGRATION
24+
- TARGET: netcoreapp1.0
25+
CASSANDRA_VERSION: 3.4
26+
CI_TYPE: INTEGRATION
27+
- TARGET: net452
28+
CASSANDRA_VERSION: 2.2.5
29+
CI_TYPE: INTEGRATION
2030

2131
install:
2232
- ps: .\appveyor_install.ps1
@@ -35,6 +45,11 @@ test:
3545
- long
3646
- duration
3747

48+
test_script:
49+
- dotnet restore
50+
- IF "%CI_TYPE%" == "UNIT" dotnet test src\Cassandra.Tests -c Release -f %TARGET%
51+
- IF "%CI_TYPE%" == "INTEGRATION" dotnet test src\Cassandra.IntegrationTests -c Release -f %TARGET% --where "cat=short"
52+
3853
on_failure:
3954
- ps: >-
4055
Write-Host "Build failed"

src/Cassandra.IntegrationTests/Policies/Tests/LoadBalancingPolicyShortTests.cs

+1-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public class LoadBalancingPolicyShortTests : TestGlobals
2121
public void TwoSessionsConnectedToSameDcUseSeparatePolicyInstances()
2222
{
2323
var builder = Cluster.Builder();
24-
var testCluster = TestClusterManager.CreateNew(1);
24+
var testCluster = TestClusterManager.CreateNew();
2525

2626
using (var cluster1 = builder.WithConnectionString(String.Format("Contact Points={0}1", testCluster.ClusterIpPrefix)).Build())
2727
using (var cluster2 = builder.WithConnectionString(String.Format("Contact Points={0}2", testCluster.ClusterIpPrefix)).Build())
@@ -249,7 +249,6 @@ public void TokenAware_BindInt_NoHops()
249249
var pstmt = session.Prepare("INSERT INTO " + policyTestTools.TableName + " (k, i) VALUES (?, ?)");
250250
for (var i = (int)short.MinValue; i < short.MinValue + 40; i++)
251251
{
252-
var partitionKey = BitConverter.GetBytes(i).Reverse().ToArray();
253252
var statement = pstmt
254253
.Bind(i, i)
255254
.EnableTracing();

src/Cassandra.Tests/BuilderTests.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,9 @@ public void WithCredentials()
9191
public void AddContactPointsThrowsWhenNameCouldNotBeResolved()
9292
{
9393
const string hostName = "not_existent_host_100003030";
94-
var ex = Assert.Throws<SocketException>(() => Cluster.Builder()
95-
.AddContactPoint(hostName)
96-
.Build());
94+
var ex = (SocketException) Assert.Throws(
95+
Is.InstanceOf<SocketException>(),
96+
() => Cluster.Builder().AddContactPoint(hostName).Build());
9797
Assert.AreEqual(ex.SocketErrorCode, SocketError.HostNotFound);
9898
}
9999

0 commit comments

Comments
 (0)