Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
426 changes: 215 additions & 211 deletions .github/workflows/build-test.yml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion gremlin-dotnet/Gremlin.Net.sln
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Gremlin.Net.Template", "src
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Gremlin.Net.Template.IntegrationTest", "test\Gremlin.Net.Template.IntegrationTest\Gremlin.Net.Template.IntegrationTest.csproj", "{3BFC3559-E317-4327-AFB7-CFBB31E1C868}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Gremlin.Net.Benchmarks", "test\Gremlin.Net.Benchmarks\Gremlin.Net.Benchmarks.csproj", "{7250A8B5-B962-49AB-B295-F75F8D4DBD78}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Gremlin.Net.BenchmarkTests", "test\Gremlin.Net.BenchmarkTests\Gremlin.Net.BenchmarkTests.csproj", "{7250A8B5-B962-49AB-B295-F75F8D4DBD78}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down
18 changes: 8 additions & 10 deletions gremlin-dotnet/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ limitations under the License.
<artifactId>gremlin-dotnet</artifactId>
<name>Apache TinkerPop :: Gremlin.Net</name>
<packaging>pom</packaging>
<properties>
<!-- provides a way to convert maven.test.skip value to skipTests for use in skipping dotnet tests -->
<maven.test.skip>false</maven.test.skip>
<skipTests>${maven.test.skip}</skipTests>
</properties>

<modules>
<module>src</module>
Expand Down Expand Up @@ -58,6 +63,9 @@ limitations under the License.
<groupId>org.eobjects.build</groupId>
<artifactId>dotnet-maven-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<skip>${skipTests}</skip>
</configuration>
</plugin>
<!--
there is no point to deploying the jvm stuff - there is no java source really - just poms
Expand All @@ -70,15 +78,5 @@ limitations under the License.
</configuration>
</plugin>
</plugins>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.eobjects.build</groupId>
<artifactId>dotnet-maven-plugin</artifactId>
<extensions>true</extensions>
<version>0.24</version>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>
Original file line number Diff line number Diff line change
@@ -1,70 +1,70 @@
#region License
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
#endregion
using System.Threading.Tasks;
using Gremlin.Net.Driver;
using Gremlin.Net.Driver.Remote;
using Gremlin.Net.Structure.IO.GraphBinary;
using Gremlin.Net.Structure.IO.GraphSON;
using static Gremlin.Net.Process.Traversal.AnonymousTraversalSource;
using static Gremlin.Net.Process.Traversal.__;
namespace Gremlin.Net.Benchmarks;
public class CompressionBenchmarks
{
public static async Task GraphSONWithoutCompression()
{
var client = new GremlinClient(new GremlinServer("localhost", 45940), new GraphSON3MessageSerializer(),
disableCompression: true);
await PerformBenchmarkWithClient(client);
}
public static async Task GraphSONWithCompression()
{
var client = new GremlinClient(new GremlinServer("localhost", 45940), new GraphSON3MessageSerializer());
await PerformBenchmarkWithClient(client);
}
public static async Task GraphBinaryWithoutCompression()
{
var client = new GremlinClient(new GremlinServer("localhost", 45940), new GraphBinaryMessageSerializer(),
disableCompression: true);
await PerformBenchmarkWithClient(client);
}
public static async Task GraphBinaryWithCompression()
{
var client = new GremlinClient(new GremlinServer("localhost", 45940), new GraphBinaryMessageSerializer());
await PerformBenchmarkWithClient(client);
}
private static async Task PerformBenchmarkWithClient(GremlinClient client)
{
var g = Traversal().WithRemote(new DriverRemoteConnection(client));
for (var i = 0; i < 5; i++)
{
await g.V().Repeat(Both()).Times(10).Emit().Fold().Promise(t => t.ToList());
}
}
#region License

/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

#endregion

using System.Threading.Tasks;
using Gremlin.Net.Driver;
using Gremlin.Net.Driver.Remote;
using Gremlin.Net.Structure.IO.GraphBinary;
using Gremlin.Net.Structure.IO.GraphSON;
using static Gremlin.Net.Process.Traversal.AnonymousTraversalSource;
using static Gremlin.Net.Process.Traversal.__;

namespace Gremlin.Net.BenchmarkTests;

public class CompressionBenchmarks
{
public static async Task GraphSONWithoutCompression()
{
var client = new GremlinClient(new GremlinServer("localhost", 45940), new GraphSON3MessageSerializer(),
disableCompression: true);
await PerformBenchmarkWithClient(client);
}

public static async Task GraphSONWithCompression()
{
var client = new GremlinClient(new GremlinServer("localhost", 45940), new GraphSON3MessageSerializer());
await PerformBenchmarkWithClient(client);
}

public static async Task GraphBinaryWithoutCompression()
{
var client = new GremlinClient(new GremlinServer("localhost", 45940), new GraphBinaryMessageSerializer(),
disableCompression: true);
await PerformBenchmarkWithClient(client);
}

public static async Task GraphBinaryWithCompression()
{
var client = new GremlinClient(new GremlinServer("localhost", 45940), new GraphBinaryMessageSerializer());
await PerformBenchmarkWithClient(client);
}

private static async Task PerformBenchmarkWithClient(GremlinClient client)
{
var g = Traversal().WithRemote(new DriverRemoteConnection(client));
for (var i = 0; i < 5; i++)
{
await g.V().Repeat(Both()).Times(10).Emit().Fold().Promise(t => t.ToList());
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<RootNamespace>Gremlin.Net.Benchmarks</RootNamespace>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
using static Gremlin.Net.Process.Traversal.__;
using static Gremlin.Net.Process.Traversal.P;

namespace Gremlin.Net.Benchmarks
namespace Gremlin.Net.BenchmarkTests
{
[MemoryDiagnoser]
public class MessageSerializerBenchmarks
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
using System.Threading.Tasks;
using BenchmarkDotNet.Running;

namespace Gremlin.Net.Benchmarks
namespace Gremlin.Net.BenchmarkTests
{
public static class Program
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

#endregion

namespace Gremlin.Net.Benchmarks
namespace Gremlin.Net.BenchmarkTests
{
public class TestMessages
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,14 @@
<ProjectReference Include="..\..\src\Gremlin.Net\Gremlin.Net.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="coverlet.collector" Version="3.1.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="coverlet.msbuild" Version="3.1.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="gherkin" Version="23.0.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="coverlet.collector" Version="3.1.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="coverlet.msbuild" Version="3.1.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.0" />
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5" />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"TestServerIpAddress": "localhost",
"TestServerPort": 45940,
"TestSecureServerPort": 45941
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="coverlet.collector" Version="3.1.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="coverlet.msbuild" Version="3.1.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.0" />
<PackageReference Include="Moq" Version="4.18.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5" />
Expand Down
75 changes: 46 additions & 29 deletions gremlin-dotnet/test/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -87,28 +87,6 @@ limitations under the License.
<directory>${basedir}/target</directory>
<finalName>${project.artifactId}-${project.version}</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.eobjects.build</groupId>
<artifactId>dotnet-maven-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<skip>${skipTests}</skip>
<!--
transaction testing is disabled unless the -DincludeNeo4j flag enables the include-neo4j
maven profile which is a standard profile we use to add neo4j to testing explicitly - for
dotnet we set this TEST_TRANSACTIONS environment variable that can be accessed in tests to
determine if we skip transaction oriented tests or not. without neo4j we can't test Tx()
so this is disabled by default and enabled in the include-neo4j profile below
-->
<environment>
<TEST_TRANSACTIONS>false</TEST_TRANSACTIONS>
</environment>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.gmavenplus</groupId>
<artifactId>gmavenplus-plugin</artifactId>
Expand Down Expand Up @@ -223,6 +201,35 @@ limitations under the License.
</execution>
</executions>
</plugin>
<plugin>
<artifactId>exec-maven-plugin</artifactId>
<groupId>org.codehaus.mojo</groupId>
<version>1.2.1</version>
<executions>
<execution>
<id>run-tests</id>
<phase>integration-test</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<skip>${skipTests}</skip>
<environmentVariables>
<TEST_TRANSACTIONS>false</TEST_TRANSACTIONS>
</environmentVariables>
<executable>dotnet</executable>
<workingDirectory>./..</workingDirectory>
<arguments>
<argument>test</argument>
<argument>./Gremlin.Net.sln</argument>
<argument>/p:CollectCoverage=true</argument>
<argument>/p:CoverletOutputFormat=opencover</argument>
<argument>/p:Exclude="[*Tests?]*"</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
Expand All @@ -245,13 +252,23 @@ limitations under the License.
<plugins>
<!-- with neo4j present we can enable transaction testing -->
<plugin>
<groupId>org.eobjects.build</groupId>
<artifactId>dotnet-maven-plugin</artifactId>
<configuration>
<environment>
<TEST_TRANSACTIONS>true</TEST_TRANSACTIONS>
</environment>
</configuration>
<artifactId>exec-maven-plugin</artifactId>
<groupId>org.codehaus.mojo</groupId>
<version>1.2.1</version>
<executions>
<execution>
<id>run-tests</id>
<phase>integration-test</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<environmentVariables>
<TEST_TRANSACTIONS>true</TEST_TRANSACTIONS>
</environmentVariables>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.gmavenplus</groupId>
Expand Down