-
Notifications
You must be signed in to change notification settings - Fork 233
Building and running tests
DataStax C# drivers support .NET 4.5+ and .NET Core 1.0+.
- .NET Core 2.1 tools (2.1.101 and above)
dotnet restore src
dotnet build src/Cassandra.sln
On Windows, the command dotnet build src/Cassandra.sln
should succeed while on macOS / Linux it may fail due to the lack of support for .NET Framework builds on non-Windows platforms.
You can build specific projects against specific target frameworks on any platform:
dotnet build src/Cassandra/Cassandra.csproj -f netstandard1.5
dotnet build src/Cassandra.Tests/Cassandra.Tests.csproj -f netcoreapp2.0
dotnet build src/Cassandra.IntegrationTests/Cassandra.IntegrationTests.csproj -f netcoreapp2.0
dotnet test src/Cassandra.Tests/Cassandra.Tests.csproj -f netcoreapp2.0
The target frameworks supported by the test projects are netcoreapp2.0
and net452
.
There are more than 580 unit tests, running them should take no more than 3 minutes (usually less).
To run the integration tests you need ccm on your machine and make a ccm command accessible from command line path. You should be able to run > cmd.exe /c ccm help
using command line on Windows or $ /usr/local/bin/ccm help
on Linux / macOS.
You also need simulacron:
- Download the latest jar file here.
- Set
SIMULACRON_PATH
environment variable to the path of the jar file you downloaded in the previous step.
Finally, to run the tests:
dotnet test src/Cassandra.IntegrationTests/Cassandra.IntegrationTests.csproj -f netcoreapp2.0 --filter "(TestCategory!=long)&(TestCategory!=memory)"
You can build and run tests on Visual Studio 2017+ and JetBrains Rider (cross-platform) by opening the solution file Cassandra.sln
with any of those applications.