This is an automated email from the ASF dual-hosted git repository.

wjones127 pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow.git


The following commit(s) were added to refs/heads/main by this push:
     new 634b0e99bd GH-35063: [CI] Fix Python requirement in C# tests (#35091)
634b0e99bd is described below

commit 634b0e99bd32715e148457fc29f3e576436b00ac
Author: Will Jones <[email protected]>
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 <[email protected]>
    Signed-off-by: Will Jones <[email protected]>
---
 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();
 

Reply via email to