This is an automated email from the ASF dual-hosted git repository.
lidavidm pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow-adbc.git
The following commit(s) were added to refs/heads/main by this push:
new 8686e6cd6 chore(csharp): Automatically run some tests for pull
requests (#1795)
8686e6cd6 is described below
commit 8686e6cd6450c8392ab6375cbc1d07ad87945991
Author: Curt Hagenlocher <[email protected]>
AuthorDate: Mon Apr 29 22:09:33 2024 -0700
chore(csharp): Automatically run some tests for pull requests (#1795)
Run some mocked tests and tests using DuckDB in continuous integration.
Closes #1794
---
.github/workflows/csharp.yml | 3 +++
ci/scripts/csharp_test.sh | 27 ++++++++++++++++++++++
.../src/Apache.Arrow.Adbc/Apache.Arrow.Adbc.csproj | 2 +-
csharp/test/Apache.Arrow.Adbc.Tests/AdbcTests.cs | 10 ++++----
.../Apache.Arrow.Adbc.Tests.csproj | 10 ++++++--
.../Apache.Arrow.Adbc.Tests.Drivers.Apache.csproj | 8 ++++---
...Apache.Arrow.Adbc.Tests.Drivers.BigQuery.csproj | 12 ++++++----
...pache.Arrow.Adbc.Tests.Drivers.FlightSql.csproj | 8 ++++---
...row.Adbc.Tests.Drivers.Interop.Snowflake.csproj | 14 ++++++-----
.../Apache.Arrow.Adbc.SmokeTests.csproj | 4 +++-
...e.Arrow.Adbc.SmokeTests.Drivers.BigQuery.csproj | 8 ++++---
....Arrow.Adbc.SmokeTests.Drivers.FlightSql.csproj | 4 +++-
...dbc.SmokeTests.Drivers.Interop.Snowflake.csproj | 10 ++++----
13 files changed, 87 insertions(+), 33 deletions(-)
diff --git a/.github/workflows/csharp.yml b/.github/workflows/csharp.yml
index 321997564..08d62e7a3 100644
--- a/.github/workflows/csharp.yml
+++ b/.github/workflows/csharp.yml
@@ -63,3 +63,6 @@ jobs:
- name: Build
shell: bash
run: ci/scripts/csharp_build.sh $(pwd)
+ - name: Test
+ shell: bash
+ run: ci/scripts/csharp_test.sh $(pwd)
diff --git a/ci/scripts/csharp_test.sh b/ci/scripts/csharp_test.sh
new file mode 100755
index 000000000..244ea3ae5
--- /dev/null
+++ b/ci/scripts/csharp_test.sh
@@ -0,0 +1,27 @@
+#!/usr/bin/env bash
+#
+# 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.
+
+set -ex
+
+source_dir=${1}/csharp/test/Apache.Arrow.Adbc.Tests
+
+pushd ${source_dir}
+dotnet test
+# TODO: consider sourcelink
+popd
diff --git a/csharp/src/Apache.Arrow.Adbc/Apache.Arrow.Adbc.csproj
b/csharp/src/Apache.Arrow.Adbc/Apache.Arrow.Adbc.csproj
index 7ab3afb6b..1dc9c72f7 100644
--- a/csharp/src/Apache.Arrow.Adbc/Apache.Arrow.Adbc.csproj
+++ b/csharp/src/Apache.Arrow.Adbc/Apache.Arrow.Adbc.csproj
@@ -8,7 +8,7 @@
<ItemGroup>
<PackageReference Include="Apache.Arrow" Version="15.0.2" />
</ItemGroup>
- <ItemGroup
Condition="$([MSBuild]::IsTargetFrameworkCompatible($(TargetFramework),
'net5.0'))">
+ <ItemGroup
Condition="$([MSBuild]::IsTargetFrameworkCompatible($(TargetFramework),
'net6.0'))">
<Compile Remove="C\NativeLibrary.cs" />
</ItemGroup>
<ItemGroup>
diff --git a/csharp/test/Apache.Arrow.Adbc.Tests/AdbcTests.cs
b/csharp/test/Apache.Arrow.Adbc.Tests/AdbcTests.cs
index fe5812c69..7f55abcd3 100644
--- a/csharp/test/Apache.Arrow.Adbc.Tests/AdbcTests.cs
+++ b/csharp/test/Apache.Arrow.Adbc.Tests/AdbcTests.cs
@@ -20,6 +20,7 @@ using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
+using Apache.Arrow.Ipc;
using Xunit;
namespace Apache.Arrow.Adbc.Tests
@@ -106,10 +107,10 @@ namespace Apache.Arrow.Adbc.Tests
[Theory]
[InlineData("Commit")]
[InlineData("CreateStatement")]
- [InlineData("GetInfo", new string[]{ "codes" }, new Type[] {
typeof(List<int>) })]
+ [InlineData("GetInfo", new string[] { "codes" }, new Type[] {
typeof(IReadOnlyList<AdbcInfoCode>) })]
[InlineData("GetObjects",
new string[] { "depth", "catalogPattern",
"dbSchemaPattern", "tableNamePattern", "tableTypes", "columnNamePattern" },
- new Type[] { typeof(AdbcConnection.GetObjectsDepth),
typeof(string), typeof(string), typeof(string), typeof(List<string>),
typeof(string) })]
+ new Type[] { typeof(AdbcConnection.GetObjectsDepth),
typeof(string), typeof(string), typeof(string), typeof(IReadOnlyList<string>),
typeof(string) })]
[InlineData("GetTableSchema",
new string[] { "catalog", "dbSchema", "tableName" },
new Type[] { typeof(string), typeof(string),
typeof(string) })]
@@ -132,7 +133,8 @@ namespace Apache.Arrow.Adbc.Tests
[Theory]
// TODO: Bind is defined differently to take a batch rather than an
array
- [InlineData("Bind", new string[] { "batch", "schema"}, new Type[] {
typeof(RecordBatch), typeof(Schema) })]
+ [InlineData("Bind", new string[] { "batch", "schema" }, new Type[] {
typeof(RecordBatch), typeof(Schema) })]
+ [InlineData("BindStream", new string[] { "stream" }, new Type[] {
typeof(IArrowArrayStream) })]
[InlineData("ExecuteQuery")]
[InlineData("ExecuteUpdate")]
[InlineData("ExecutePartitioned")] // C# matches Java here
@@ -176,7 +178,7 @@ namespace Apache.Arrow.Adbc.Tests
ParameterInfo[] parameters = mi.GetParameters();
- for(int i=0;i<parameters.Length;i++)
+ for (int i = 0; i < parameters.Length; i++)
{
ParameterInfo parameter = parameters[i];
diff --git a/csharp/test/Apache.Arrow.Adbc.Tests/Apache.Arrow.Adbc.Tests.csproj
b/csharp/test/Apache.Arrow.Adbc.Tests/Apache.Arrow.Adbc.Tests.csproj
index 688805cc2..edbb76fad 100644
--- a/csharp/test/Apache.Arrow.Adbc.Tests/Apache.Arrow.Adbc.Tests.csproj
+++ b/csharp/test/Apache.Arrow.Adbc.Tests/Apache.Arrow.Adbc.Tests.csproj
@@ -1,7 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
- <TargetFrameworks>net472;net8.0</TargetFrameworks>
+ <IsWindows
Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Windows)))'
== 'true'">true</IsWindows>
+ <TargetFrameworks
Condition="'$(IsWindows)'=='true'">net8.0;net472</TargetFrameworks>
+ <TargetFrameworks
Condition="'$(TargetFrameworks)'==''">net8.0</TargetFrameworks>
<ImplicitUsings>disable</ImplicitUsings>
<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
@@ -13,7 +15,11 @@
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="Moq" Version="4.20.70" />
<PackageReference Include="System.Text.Json" Version="7.0.4" />
- <PackageReference Include="xunit" Version="2.7.0" />
+ <PackageReference Include="xunit" Version="2.8.0" />
+ <PackageReference Include="xunit.runner.visualstudio" Version="2.8.0">
+ <PrivateAssets>all</PrivateAssets>
+ <IncludeAssets>runtime; build; native; contentfiles;
analyzers</IncludeAssets>
+ </PackageReference>
<PackageReference Include="DuckDB.NET.Bindings.Full" Version="0.10.2"
GeneratePathProperty="true" />
</ItemGroup>
diff --git
a/csharp/test/Drivers/Apache/Apache.Arrow.Adbc.Tests.Drivers.Apache.csproj
b/csharp/test/Drivers/Apache/Apache.Arrow.Adbc.Tests.Drivers.Apache.csproj
index f05422dcb..6c09ee0da 100644
--- a/csharp/test/Drivers/Apache/Apache.Arrow.Adbc.Tests.Drivers.Apache.csproj
+++ b/csharp/test/Drivers/Apache/Apache.Arrow.Adbc.Tests.Drivers.Apache.csproj
@@ -1,13 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
- <TargetFrameworks>net472;net8.0</TargetFrameworks>
+ <IsWindows
Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Windows)))'
== 'true'">true</IsWindows>
+ <TargetFrameworks
Condition="'$(IsWindows)'=='true'">net8.0;net472</TargetFrameworks>
+ <TargetFrameworks
Condition="'$(TargetFrameworks)'==''">net8.0</TargetFrameworks>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
- <PackageReference Include="xunit" Version="2.7.0" />
- <PackageReference Include="xunit.runner.visualstudio" Version="2.5.7">
+ <PackageReference Include="xunit" Version="2.8.0" />
+ <PackageReference Include="xunit.runner.visualstudio" Version="2.8.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers;
buildtransitive</IncludeAssets>
</PackageReference>
diff --git
a/csharp/test/Drivers/BigQuery/Apache.Arrow.Adbc.Tests.Drivers.BigQuery.csproj
b/csharp/test/Drivers/BigQuery/Apache.Arrow.Adbc.Tests.Drivers.BigQuery.csproj
index ae3845beb..044df68be 100644
---
a/csharp/test/Drivers/BigQuery/Apache.Arrow.Adbc.Tests.Drivers.BigQuery.csproj
+++
b/csharp/test/Drivers/BigQuery/Apache.Arrow.Adbc.Tests.Drivers.BigQuery.csproj
@@ -1,11 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">
- <PropertyGroup>
- <TargetFrameworks>net472;net8.0</TargetFrameworks>
- </PropertyGroup>
+ <PropertyGroup>
+ <IsWindows
Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Windows)))'
== 'true'">true</IsWindows>
+ <TargetFrameworks
Condition="'$(IsWindows)'=='true'">net8.0;net472</TargetFrameworks>
+ <TargetFrameworks
Condition="'$(TargetFrameworks)'==''">net8.0</TargetFrameworks>
+ </PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
- <PackageReference Include="xunit" Version="2.7.0" />
- <PackageReference Include="xunit.runner.visualstudio" Version="2.5.7">
+ <PackageReference Include="xunit" Version="2.8.0" />
+ <PackageReference Include="xunit.runner.visualstudio" Version="2.8.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers;
buildtransitive</IncludeAssets>
</PackageReference>
diff --git
a/csharp/test/Drivers/FlightSql/Apache.Arrow.Adbc.Tests.Drivers.FlightSql.csproj
b/csharp/test/Drivers/FlightSql/Apache.Arrow.Adbc.Tests.Drivers.FlightSql.csproj
index 22db27dc4..666e53495 100644
---
a/csharp/test/Drivers/FlightSql/Apache.Arrow.Adbc.Tests.Drivers.FlightSql.csproj
+++
b/csharp/test/Drivers/FlightSql/Apache.Arrow.Adbc.Tests.Drivers.FlightSql.csproj
@@ -1,13 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
- <TargetFrameworks>net472;net8.0</TargetFrameworks>
+ <IsWindows
Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Windows)))'
== 'true'">true</IsWindows>
+ <TargetFrameworks
Condition="'$(IsWindows)'=='true'">net8.0;net472</TargetFrameworks>
+ <TargetFrameworks
Condition="'$(TargetFrameworks)'==''">net8.0</TargetFrameworks>
<ImplicitUsings>disable</ImplicitUsings>
<SignAssembly>False</SignAssembly>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
- <PackageReference Include="xunit" Version="2.7.0" />
- <PackageReference Include="xunit.runner.visualstudio" Version="2.5.7">
+ <PackageReference Include="xunit" Version="2.8.0" />
+ <PackageReference Include="xunit.runner.visualstudio" Version="2.8.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers;
buildtransitive</IncludeAssets>
</PackageReference>
diff --git
a/csharp/test/Drivers/Interop/Snowflake/Apache.Arrow.Adbc.Tests.Drivers.Interop.Snowflake.csproj
b/csharp/test/Drivers/Interop/Snowflake/Apache.Arrow.Adbc.Tests.Drivers.Interop.Snowflake.csproj
index 127b0a329..bb49a9b33 100644
---
a/csharp/test/Drivers/Interop/Snowflake/Apache.Arrow.Adbc.Tests.Drivers.Interop.Snowflake.csproj
+++
b/csharp/test/Drivers/Interop/Snowflake/Apache.Arrow.Adbc.Tests.Drivers.Interop.Snowflake.csproj
@@ -1,7 +1,9 @@
-<Project Sdk="Microsoft.NET.Sdk">
- <PropertyGroup>
- <TargetFrameworks>net472;net8.0</TargetFrameworks>
- </PropertyGroup>
+<Project Sdk="Microsoft.NET.Sdk">
+ <PropertyGroup>
+ <IsWindows
Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Windows)))'
== 'true'">true</IsWindows>
+ <TargetFrameworks
Condition="'$(IsWindows)'=='true'">net8.0;net472</TargetFrameworks>
+ <TargetFrameworks
Condition="'$(TargetFrameworks)'==''">net8.0</TargetFrameworks>
+ </PropertyGroup>
<ItemGroup>
<None Remove="Resources\SnowflakeConstraints.sql" />
<None Remove="Resources\SnowflakeData.sql" />
@@ -16,8 +18,8 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
- <PackageReference Include="xunit" Version="2.7.0" />
- <PackageReference Include="xunit.runner.visualstudio" Version="2.5.7">
+ <PackageReference Include="xunit" Version="2.8.0" />
+ <PackageReference Include="xunit.runner.visualstudio" Version="2.8.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers;
buildtransitive</IncludeAssets>
</PackageReference>
diff --git
a/csharp/test/SmokeTests/Apache.Arrow.Adbc.SmokeTests/Apache.Arrow.Adbc.SmokeTests.csproj
b/csharp/test/SmokeTests/Apache.Arrow.Adbc.SmokeTests/Apache.Arrow.Adbc.SmokeTests.csproj
index d04534824..821e4cffe 100644
---
a/csharp/test/SmokeTests/Apache.Arrow.Adbc.SmokeTests/Apache.Arrow.Adbc.SmokeTests.csproj
+++
b/csharp/test/SmokeTests/Apache.Arrow.Adbc.SmokeTests/Apache.Arrow.Adbc.SmokeTests.csproj
@@ -2,7 +2,9 @@
<Import Project="..\Build.props" />
<PropertyGroup>
- <TargetFrameworks>net472;net8.0</TargetFrameworks>
+ <IsWindows
Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Windows)))'
== 'true'">true</IsWindows>
+ <TargetFrameworks
Condition="'$(IsWindows)'=='true'">net8.0;net472</TargetFrameworks>
+ <TargetFrameworks
Condition="'$(TargetFrameworks)'==''">net8.0</TargetFrameworks>
<ImplicitUsings>disable</ImplicitUsings>
<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
diff --git
a/csharp/test/SmokeTests/BigQuery/Apache.Arrow.Adbc.SmokeTests.Drivers.BigQuery.csproj
b/csharp/test/SmokeTests/BigQuery/Apache.Arrow.Adbc.SmokeTests.Drivers.BigQuery.csproj
index 6a36aad8f..cf56b58c9 100644
---
a/csharp/test/SmokeTests/BigQuery/Apache.Arrow.Adbc.SmokeTests.Drivers.BigQuery.csproj
+++
b/csharp/test/SmokeTests/BigQuery/Apache.Arrow.Adbc.SmokeTests.Drivers.BigQuery.csproj
@@ -1,8 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\Build.props" />
- <PropertyGroup>
- <TargetFrameworks>net472;net8.0</TargetFrameworks>
- </PropertyGroup>
+ <PropertyGroup>
+ <IsWindows
Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Windows)))'
== 'true'">true</IsWindows>
+ <TargetFrameworks
Condition="'$(IsWindows)'=='true'">net8.0;net472</TargetFrameworks>
+ <TargetFrameworks
Condition="'$(TargetFrameworks)'==''">net8.0</TargetFrameworks>
+ </PropertyGroup>
<ItemGroup>
<Compile Include="..\..\Drivers\BigQuery\BigQueryData.cs"
Link="BigQueryData.cs" />
<Compile Include="..\..\Drivers\BigQuery\BigQueryTestConfiguration.cs"
Link="BigQueryTestConfiguration.cs" />
diff --git
a/csharp/test/SmokeTests/FlightSql/Apache.Arrow.Adbc.SmokeTests.Drivers.FlightSql.csproj
b/csharp/test/SmokeTests/FlightSql/Apache.Arrow.Adbc.SmokeTests.Drivers.FlightSql.csproj
index 74c3409e1..0f54ea995 100644
---
a/csharp/test/SmokeTests/FlightSql/Apache.Arrow.Adbc.SmokeTests.Drivers.FlightSql.csproj
+++
b/csharp/test/SmokeTests/FlightSql/Apache.Arrow.Adbc.SmokeTests.Drivers.FlightSql.csproj
@@ -1,6 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
- <TargetFrameworks>net472;net8.0</TargetFrameworks>
+ <IsWindows
Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Windows)))'
== 'true'">true</IsWindows>
+ <TargetFrameworks
Condition="'$(IsWindows)'=='true'">net8.0;net472</TargetFrameworks>
+ <TargetFrameworks
Condition="'$(TargetFrameworks)'==''">net8.0</TargetFrameworks>
<ImplicitUsings>disable</ImplicitUsings>
<SignAssembly>False</SignAssembly>
</PropertyGroup>
diff --git
a/csharp/test/SmokeTests/Interop/Snowflake/Apache.Arrow.Adbc.SmokeTests.Drivers.Interop.Snowflake.csproj
b/csharp/test/SmokeTests/Interop/Snowflake/Apache.Arrow.Adbc.SmokeTests.Drivers.Interop.Snowflake.csproj
index 66e6b1375..2949800ad 100644
---
a/csharp/test/SmokeTests/Interop/Snowflake/Apache.Arrow.Adbc.SmokeTests.Drivers.Interop.Snowflake.csproj
+++
b/csharp/test/SmokeTests/Interop/Snowflake/Apache.Arrow.Adbc.SmokeTests.Drivers.Interop.Snowflake.csproj
@@ -1,8 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">
- <Import Project="..\..\Build.props" />
- <PropertyGroup>
- <TargetFrameworks>net472;net8.0</TargetFrameworks>
- </PropertyGroup>
+ <Import Project="..\..\Build.props" />
+ <PropertyGroup>
+ <IsWindows
Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Windows)))'
== 'true'">true</IsWindows>
+ <TargetFrameworks
Condition="'$(IsWindows)'=='true'">net8.0;net472</TargetFrameworks>
+ <TargetFrameworks
Condition="'$(TargetFrameworks)'==''">net8.0</TargetFrameworks>
+ </PropertyGroup>
<ItemGroup>
<Compile Include="..\..\..\Drivers\Interop\Snowflake\ClientTests.cs"
Link="ClientTests.cs" />
<Compile Include="..\..\..\Drivers\Interop\Snowflake\SnowflakeData.cs"
Link="SnowflakeData.cs" />