You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by di...@apache.org on 2020/06/10 02:07:59 UTC
[flink] branch release-1.11 updated: [FLINK-18104][python][windows]
Fix the test failures on Windows.
This is an automated email from the ASF dual-hosted git repository.
dianfu pushed a commit to branch release-1.11
in repository https://gitbox.apache.org/repos/asf/flink.git
The following commit(s) were added to refs/heads/release-1.11 by this push:
new 54fb17c [FLINK-18104][python][windows] Fix the test failures on Windows.
54fb17c is described below
commit 54fb17c88f40e7ed16701117a5e0e6f3e88191dd
Author: Wei Zhong <we...@gmail.com>
AuthorDate: Tue Jun 9 20:42:22 2020 +0800
[FLINK-18104][python][windows] Fix the test failures on Windows.
This closes #12552.
---
.../org/apache/flink/client/python/PythonEnvUtilsTest.java | 14 ++++++++++++--
.../apache/flink/python/env/PythonDependencyInfoTest.java | 11 +++++++++++
2 files changed, 23 insertions(+), 2 deletions(-)
diff --git a/flink-python/src/test/java/org/apache/flink/client/python/PythonEnvUtilsTest.java b/flink-python/src/test/java/org/apache/flink/client/python/PythonEnvUtilsTest.java
index b25fd38..e6fa18e 100644
--- a/flink-python/src/test/java/org/apache/flink/client/python/PythonEnvUtilsTest.java
+++ b/flink-python/src/test/java/org/apache/flink/client/python/PythonEnvUtilsTest.java
@@ -22,9 +22,11 @@ import org.apache.flink.configuration.Configuration;
import org.apache.flink.core.fs.Path;
import org.apache.flink.core.testutils.CommonTestUtils;
import org.apache.flink.util.FileUtils;
+import org.apache.flink.util.OperatingSystem;
import org.junit.After;
import org.junit.Assert;
+import org.junit.Assume;
import org.junit.Before;
import org.junit.Test;
@@ -65,6 +67,9 @@ public class PythonEnvUtilsTest {
@Test
public void testPreparePythonEnvironment() throws IOException {
+ // Skip this test on Windows as we can not control the Window Driver letters.
+ Assume.assumeFalse(OperatingSystem.isWindows());
+
// xxx/a.zip, xxx/subdir/b.py, xxx/subdir/c.zip
File zipFile = new File(tmpDirPath + File.separator + "a.zip");
File dirFile = new File(tmpDirPath + File.separator + "module_dir");
@@ -161,7 +166,11 @@ public class PythonEnvUtilsTest {
Configuration config = new Configuration();
PythonEnvUtils.PythonEnvironment env = preparePythonEnvironment(config, null, tmpDirPath);
- Assert.assertEquals("python", env.pythonExec);
+ if (OperatingSystem.isWindows()) {
+ Assert.assertEquals("python.exe", env.pythonExec);
+ } else {
+ Assert.assertEquals("python", env.pythonExec);
+ }
Map<String, String> systemEnv = new HashMap<>(System.getenv());
systemEnv.put(PYFLINK_CLIENT_EXECUTABLE, "python3");
@@ -190,7 +199,8 @@ public class PythonEnvUtilsTest {
PythonEnvUtils.PythonEnvironment env = preparePythonEnvironment(config, entryFilePath, tmpDirPath);
Set<String> expectedPythonPaths = new HashSet<>();
- expectedPythonPaths.add(String.join(File.separator, replaceUUID(env.tempDirectory), "{uuid}"));
+ expectedPythonPaths.add(
+ new Path(String.join(File.separator, replaceUUID(env.tempDirectory), "{uuid}")).toString());
Set<String> actualPaths = Arrays.stream(env.pythonPath.split(File.pathSeparator))
.map(PythonEnvUtilsTest::replaceUUID)
diff --git a/flink-python/src/test/java/org/apache/flink/python/env/PythonDependencyInfoTest.java b/flink-python/src/test/java/org/apache/flink/python/env/PythonDependencyInfoTest.java
index 919fb51..ae83dbe 100644
--- a/flink-python/src/test/java/org/apache/flink/python/env/PythonDependencyInfoTest.java
+++ b/flink-python/src/test/java/org/apache/flink/python/env/PythonDependencyInfoTest.java
@@ -24,7 +24,9 @@ import org.apache.flink.core.fs.Path;
import org.apache.flink.python.PythonConfig;
import org.apache.flink.python.PythonOptions;
import org.apache.flink.python.util.PythonDependencyUtils;
+import org.apache.flink.util.OperatingSystem;
+import org.junit.Assume;
import org.junit.Test;
import java.io.IOException;
@@ -68,6 +70,9 @@ public class PythonDependencyInfoTest {
@Test
public void testParsePythonFiles() {
+ // Skip this test on Windows as we can not control the Window Driver letters.
+ Assume.assumeFalse(OperatingSystem.isWindows());
+
Configuration config = new Configuration();
Map<String, String> pythonFiles = new HashMap<>();
pythonFiles.put("python_file_{SHA256_0}", "test_file1.py");
@@ -83,6 +88,9 @@ public class PythonDependencyInfoTest {
@Test
public void testParsePythonRequirements() throws IOException {
+ // Skip this test on Windows as we can not control the Window Driver letters.
+ Assume.assumeFalse(OperatingSystem.isWindows());
+
Configuration config = new Configuration();
config.set(PythonDependencyUtils.PYTHON_REQUIREMENTS_FILE, new HashMap<>());
config.get(PythonDependencyUtils.PYTHON_REQUIREMENTS_FILE)
@@ -102,6 +110,9 @@ public class PythonDependencyInfoTest {
@Test
public void testParsePythonArchives() {
+ // Skip this test on Windows as we can not control the Window Driver letters.
+ Assume.assumeFalse(OperatingSystem.isWindows());
+
Configuration config = new Configuration();
Map<String, String> pythonArchives = new HashMap<>();
pythonArchives.put("python_archive_{SHA256_0}", "py27.zip");