From c8d0c524b72bc03bd37d0ce4f9220dea85c611ad Mon Sep 17 00:00:00 2001 From: Will Jones Date: Tue, 28 Feb 2023 13:18:18 -0800 Subject: [PATCH] test: optionally skip python test when local --- .../Apache.Arrow.Tests.csproj | 1 + .../CDataInterfaceSchemaTests.cs | 17 +++++++++++------ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/csharp/test/Apache.Arrow.Tests/Apache.Arrow.Tests.csproj b/csharp/test/Apache.Arrow.Tests/Apache.Arrow.Tests.csproj index f956c2141ed52..cdbfe479470a4 100644 --- a/csharp/test/Apache.Arrow.Tests/Apache.Arrow.Tests.csproj +++ b/csharp/test/Apache.Arrow.Tests/Apache.Arrow.Tests.csproj @@ -13,6 +13,7 @@ all runtime; build; native; contentfiles; analyzers + diff --git a/csharp/test/Apache.Arrow.Tests/CDataInterfaceSchemaTests.cs b/csharp/test/Apache.Arrow.Tests/CDataInterfaceSchemaTests.cs index 8d9bfd9de826d..6aece3d8a3ab3 100644 --- a/csharp/test/Apache.Arrow.Tests/CDataInterfaceSchemaTests.cs +++ b/csharp/test/Apache.Arrow.Tests/CDataInterfaceSchemaTests.cs @@ -28,6 +28,11 @@ public class CDataSchemaTest { public CDataSchemaTest() { + bool inCIJob = Environment.GetEnvironmentVariable("GITHUB_ACTIONS") == "true"; + bool pythonSet = Environment.GetEnvironmentVariable("PYTHONNET_PYDLL") != null; + // We only skip if this is not in CI + Skip.If(!pythonSet && !inCIJob, "PYTHONNET_PYDLL not set; skipping C Data Interface tests."); + PythonEngine.Initialize(); } @@ -123,7 +128,7 @@ private static dynamic GetPythonSchema() } // Schemas created in Python, used in CSharp - [Fact] + [SkippableFact] public void ImportType() { Schema schema = GetTestSchema(); @@ -150,7 +155,7 @@ public void ImportType() } } - [Fact] + [SkippableFact] public void ImportField() { Schema schema = GetTestSchema(); @@ -175,7 +180,7 @@ public void ImportField() } } - [Fact] + [SkippableFact] public void ImportSchema() { Schema schema = GetTestSchema(); @@ -198,7 +203,7 @@ public void ImportSchema() // Schemas created in CSharp, exported to Python - [Fact] + [SkippableFact] public void ExportType() { Schema schema = GetTestSchema(); @@ -234,7 +239,7 @@ public void ExportType() } } - [Fact] + [SkippableFact] public void ExportField() { Schema schema = GetTestSchema(); @@ -266,7 +271,7 @@ public void ExportField() } } - [Fact] + [SkippableFact] public void ExportSchema() { Schema schema = GetTestSchema();