Skip to content

Commit

Permalink
test: optionally skip python test when local
Browse files Browse the repository at this point in the history
  • Loading branch information
wjones127 committed Feb 28, 2023
1 parent ad853f8 commit c8d0c52
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
1 change: 1 addition & 0 deletions csharp/test/Apache.Arrow.Tests/Apache.Arrow.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<PackageReference Include="xunit.skippablefact" Version="1.4.13" />
<PackageReference Include="pythonnet" Version="3.0.1" />
</ItemGroup>

Expand Down
17 changes: 11 additions & 6 deletions csharp/test/Apache.Arrow.Tests/CDataInterfaceSchemaTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down Expand Up @@ -123,7 +128,7 @@ private static dynamic GetPythonSchema()
}

// Schemas created in Python, used in CSharp
[Fact]
[SkippableFact]
public void ImportType()
{
Schema schema = GetTestSchema();
Expand All @@ -150,7 +155,7 @@ public void ImportType()
}
}

[Fact]
[SkippableFact]
public void ImportField()
{
Schema schema = GetTestSchema();
Expand All @@ -175,7 +180,7 @@ public void ImportField()
}
}

[Fact]
[SkippableFact]
public void ImportSchema()
{
Schema schema = GetTestSchema();
Expand All @@ -198,7 +203,7 @@ public void ImportSchema()


// Schemas created in CSharp, exported to Python
[Fact]
[SkippableFact]
public void ExportType()
{
Schema schema = GetTestSchema();
Expand Down Expand Up @@ -234,7 +239,7 @@ public void ExportType()
}
}

[Fact]
[SkippableFact]
public void ExportField()
{
Schema schema = GetTestSchema();
Expand Down Expand Up @@ -266,7 +271,7 @@ public void ExportField()
}
}

[Fact]
[SkippableFact]
public void ExportSchema()
{
Schema schema = GetTestSchema();
Expand Down

0 comments on commit c8d0c52

Please sign in to comment.