You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by ra...@apache.org on 2023/04/17 12:58:39 UTC
[arrow] 05/11: GH-35063: [CI] Fix Python requirement in C# tests (#35091)
This is an automated email from the ASF dual-hosted git repository.
raulcd pushed a commit to branch maint-12.0.0
in repository https://gitbox.apache.org/repos/asf/arrow.git
commit b2b9aaeac544bf80609b6f7412775fc9e2a6e486
Author: Will Jones <wi...@gmail.com>
AuthorDate: Thu Apr 13 13:38:54 2023 -0700
GH-35063: [CI] Fix Python requirement in C# tests (#35091)
### Rationale for this change
We need to install Python shared libraries in order to use them in C# tests.
We can also skip the tests in the verification script.
### What changes are included in this PR?
<!--
There is no need to duplicate the description in the issue here but it is sometimes worth providing a summary of the individual changes in this PR.
-->
### Are these changes tested?
* [x] Validate in crossbow jobs
### Are there any user-facing changes?
No, these are just for CI.
* Closes: #35063
Authored-by: Will Jones <wi...@gmail.com>
Signed-off-by: Will Jones <wi...@gmail.com>
---
ci/docker/ubuntu-22.04-csharp.dockerfile | 2 +-
csharp/test/Apache.Arrow.Tests/CDataInterfacePythonTests.cs | 11 ++++++++++-
2 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/ci/docker/ubuntu-22.04-csharp.dockerfile b/ci/docker/ubuntu-22.04-csharp.dockerfile
index 13c3468096..aebbd8fab7 100644
--- a/ci/docker/ubuntu-22.04-csharp.dockerfile
+++ b/ci/docker/ubuntu-22.04-csharp.dockerfile
@@ -21,7 +21,7 @@ ARG platform=jammy
FROM mcr.microsoft.com/dotnet/sdk:${dotnet}-${platform}-${arch}
RUN apt-get update -y -q && \
- apt-get install -y --no-install-recommends python3 python3-pip && \
+ apt-get install -y python3 python3-pip && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
diff --git a/csharp/test/Apache.Arrow.Tests/CDataInterfacePythonTests.cs b/csharp/test/Apache.Arrow.Tests/CDataInterfacePythonTests.cs
index 7f7fa83a8a..750877cc8d 100644
--- a/csharp/test/Apache.Arrow.Tests/CDataInterfacePythonTests.cs
+++ b/csharp/test/Apache.Arrow.Tests/CDataInterfacePythonTests.cs
@@ -30,9 +30,18 @@ namespace Apache.Arrow.Tests
public CDataSchemaPythonTest()
{
bool inCIJob = Environment.GetEnvironmentVariable("GITHUB_ACTIONS") == "true";
+ bool inVerificationJob = Environment.GetEnvironmentVariable("TEST_CSHARP") == "1";
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.");
+ if (inCIJob && !inVerificationJob && !pythonSet)
+ {
+ throw new Exception("PYTHONNET_PYDLL not set; skipping C Data Interface tests.");
+ }
+ else
+ {
+ Skip.If(!pythonSet, "PYTHONNET_PYDLL not set; skipping C Data Interface tests.");
+ }
+
PythonEngine.Initialize();