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

isapego pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git


The following commit(s) were added to refs/heads/master by this push:
     new 78f5788  IGNITE-13187 Skip spring-data module as classpath for 
platforms tests.
78f5788 is described below

commit 78f5788af5e00a1e1312aa462a2effe041e75de4
Author: Ivan Daschinskiy <[email protected]>
AuthorDate: Fri Jun 26 16:29:35 2020 +0300

    IGNITE-13187 Skip spring-data module as classpath for platforms tests.
    
    This closes #7963
---
 modules/platforms/cpp/jni/os/linux/src/utils.cpp   | 24 +++++++++++++++++++++-
 modules/platforms/cpp/jni/os/win/src/utils.cpp     | 24 +++++++++++++++++++++-
 .../Apache.Ignite.Core/Impl/Common/Classpath.cs    |  9 +++++++-
 3 files changed, 54 insertions(+), 3 deletions(-)

diff --git a/modules/platforms/cpp/jni/os/linux/src/utils.cpp 
b/modules/platforms/cpp/jni/os/linux/src/utils.cpp
index 1fcdb31..1b958eb 100644
--- a/modules/platforms/cpp/jni/os/linux/src/utils.cpp
+++ b/modules/platforms/cpp/jni/os/linux/src/utils.cpp
@@ -18,6 +18,7 @@
 
 #include <pthread.h>
 
+#include <algorithm>
 #include <sys/stat.h>
 #include <dirent.h>
 #include <dlfcn.h>
@@ -45,6 +46,9 @@ namespace ignite
 
         const char* IGNITE_NATIVE_TEST_CLASSPATH = 
"IGNITE_NATIVE_TEST_CLASSPATH";
 
+        /** Excluded modules from test classpath. */
+        const char* TEST_EXCLUDED_MODULES[] = { "rest-http", "spring-data" };
+
         /** Key indicating that the thread is attached. */
         static pthread_key_t attachKey;
 
@@ -174,6 +178,24 @@ namespace ignite
         }
 
         /**
+         * Check if path corresponds to excluded module.
+         *
+         * @path Path.
+         * @return True if path should be excluded.
+         */
+        bool IsExcludedModule(const std::string& path) {
+            std::string lower_path = path;
+            std::transform(path.begin(), path.end(), lower_path.begin(), 
::tolower);
+
+            for (size_t i = 0; i < sizeof(TEST_EXCLUDED_MODULES) / 
sizeof(char*); i++) {
+                if (lower_path.find(TEST_EXCLUDED_MODULES[i]) != 
std::string::npos)
+                    return true;
+            }
+
+            return false;
+        }
+
+        /**
          * Create classpath picking compiled classes from the given path.
          *
          * @path Path.
@@ -183,7 +205,7 @@ namespace ignite
         {
             std::string res;
 
-            if (FileExists(path))
+            if (FileExists(path) && !IsExcludedModule(path))
             {
                 // 1. Append "target\classes".
                 std::string classesPath = path + "/target/classes";
diff --git a/modules/platforms/cpp/jni/os/win/src/utils.cpp 
b/modules/platforms/cpp/jni/os/win/src/utils.cpp
index 22b47dc..d657fdc 100644
--- a/modules/platforms/cpp/jni/os/win/src/utils.cpp
+++ b/modules/platforms/cpp/jni/os/win/src/utils.cpp
@@ -15,6 +15,7 @@
  * limitations under the License.
  */
 
+#include <algorithm>
 #include <windows.h>
 
 #include "ignite/common/concurrent.h"
@@ -41,6 +42,9 @@ namespace ignite
 
         const char* IGNITE_NATIVE_TEST_CLASSPATH = 
"IGNITE_NATIVE_TEST_CLASSPATH";
 
+        /** Excluded modules from test classpath. */
+        const char* TEST_EXCLUDED_MODULES[] = { "rest-http", "spring-data" };
+
         AttachHelper::~AttachHelper()
         {
             // No-op.
@@ -147,6 +151,24 @@ namespace ignite
         }
 
         /**
+         * Check if path corresponds to excluded module.
+         *
+         * @path Path.
+         * @return True if path should be excluded.
+         */
+        bool IsExcludedModule(const std::string& path) {
+            std::string lower_path = path;
+            std::transform(path.begin(), path.end(), lower_path.begin(), 
::tolower);
+
+            for (size_t i = 0; i < sizeof(TEST_EXCLUDED_MODULES) / 
sizeof(char*); i++) {
+                if (lower_path.find(TEST_EXCLUDED_MODULES[i]) != 
std::string::npos)
+                    return true;
+            }
+
+            return false;
+        }
+
+        /**
          * Create classpath picking compiled classes from the given path.
          *
          * @path Path.
@@ -156,7 +178,7 @@ namespace ignite
         {
             std::string res;
 
-            if (FileExists(path))
+            if (FileExists(path) && !IsExcludedModule(path))
             {
                 // 1. Append "target\classes".
                 std::string classesPath = path + "\\target\\classes";
diff --git 
a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Common/Classpath.cs 
b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Common/Classpath.cs
index 93d2d32..c81f59b 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Common/Classpath.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Common/Classpath.cs
@@ -21,6 +21,7 @@ namespace Apache.Ignite.Core.Impl.Common
     using System.Diagnostics.CodeAnalysis;
     using System.Text;
     using System.IO;
+    using System.Linq;
     using Apache.Ignite.Core.Impl.Unmanaged;
     using Apache.Ignite.Core.Log;
 
@@ -38,6 +39,9 @@ namespace Apache.Ignite.Core.Impl.Common
         /** Classpath separator. */
         [SuppressMessage("Microsoft.Performance", 
"CA1802:UseLiteralsWhereAppropriate")]
         private static readonly string ClasspathSeparator = Os.IsWindows ? ";" 
: ":";
+        
+        /** Excluded modules from test classpath */
+        private static readonly string[] TestExcludedModules = { "rest-http", 
"spring-data" };
 
         /// <summary>
         /// Creates classpath from the given configuration, or default 
classpath if given config is null.
@@ -133,7 +137,10 @@ namespace Apache.Ignite.Core.Impl.Common
         /// <param name="cp">Classpath builder.</param>
         private static void AppendTestClasses0(string path, StringBuilder cp)
         {
-            if (path.EndsWith("rest-http", StringComparison.OrdinalIgnoreCase))
+            var shouldExcluded = TestExcludedModules.Any(excl => 
+                path.IndexOf(excl, StringComparison.OrdinalIgnoreCase) >= 0);
+            
+            if (shouldExcluded)
                 return;
 
             var dir = Path.Combine(path, "target", "classes");

Reply via email to