You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nlpcraft.apache.org by se...@apache.org on 2020/09/22 06:54:36 UTC

[incubator-nlpcraft] branch master updated: Tests configuration improvements.

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

sergeykamov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nlpcraft.git


The following commit(s) were added to refs/heads/master by this push:
     new 88e8c86  Tests configuration improvements.
88e8c86 is described below

commit 88e8c86e90e7f0f09869bc3ca25a6298871c6cdd
Author: Sergey Kamov <se...@apache.org>
AuthorDate: Tue Sep 22 09:54:30 2020 +0300

    Tests configuration improvements.
---
 nlpcraft/pom.xml                                               | 10 ++++++++++
 .../scala/org/apache/nlpcraft/NCTestExampleModelsSpec.scala    |  7 ++++++-
 .../server/nlp/enrichers/date/tools/NCDateGeneratorSpec.scala  |  5 ++---
 3 files changed, 18 insertions(+), 4 deletions(-)

diff --git a/nlpcraft/pom.xml b/nlpcraft/pom.xml
index 67a57bb..77f64e1 100644
--- a/nlpcraft/pom.xml
+++ b/nlpcraft/pom.xml
@@ -321,6 +321,12 @@
                 <configuration>
                     <!-- Skips all tests on phase `test`. -->
                     <skip>true</skip>
+                    <systemProperties>
+                        <property>
+                            <name>NLPCRAFT_TEST_MAVEN_ENV</name>
+                            <value>true</value>
+                        </property>
+                    </systemProperties>
                 </configuration>
                 <executions>
                     <!-- All tests are defined as integration. -->
@@ -336,6 +342,10 @@
                             <includes>
                                 <include>**/*.*</include>
                             </includes>
+                            <excludes>
+                                <exclude>**/NCConversationSpec.*</exclude>
+                                <exclude>**/NCDateGeneratorSpec.*</exclude>
+                            </excludes>
                         </configuration>
                     </execution>
                 </executions>
diff --git a/nlpcraft/src/test/scala/org/apache/nlpcraft/NCTestExampleModelsSpec.scala b/nlpcraft/src/test/scala/org/apache/nlpcraft/NCTestExampleModelsSpec.scala
index 2e57177..713eae6 100644
--- a/nlpcraft/src/test/scala/org/apache/nlpcraft/NCTestExampleModelsSpec.scala
+++ b/nlpcraft/src/test/scala/org/apache/nlpcraft/NCTestExampleModelsSpec.scala
@@ -26,12 +26,17 @@ import org.junit.jupiter.api.{Assertions, Test}
 class NCTestExampleModelsSpec {
     @Test
     def test(): Unit = {
-        val models = "" +
+        var models = "" +
             "org.apache.nlpcraft.examples.alarm.AlarmModel," +
             "org.apache.nlpcraft.examples.time.TimeModel," +
             "org.apache.nlpcraft.examples.lightswitch.LightSwitchModel," +
             "org.apache.nlpcraft.examples.echo.EchoModel"
 
+        val maven = System.getProperty("NLPCRAFT_TEST_MAVEN_ENV")
+
+        if (maven == null || maven.toLowerCase != "true")
+            models = s"$models,org.apache.nlpcraft.examples.weather.WeatherModel"
+
         // Instruct auto-validator what models to test.
         System.setProperty("NLPCRAFT_TEST_MODELS", models)
 
diff --git a/nlpcraft/src/test/scala/org/apache/nlpcraft/server/nlp/enrichers/date/tools/NCDateGeneratorSpec.scala b/nlpcraft/src/test/scala/org/apache/nlpcraft/server/nlp/enrichers/date/tools/NCDateGeneratorSpec.scala
index 4db3503..7c817e3 100644
--- a/nlpcraft/src/test/scala/org/apache/nlpcraft/server/nlp/enrichers/date/tools/NCDateGeneratorSpec.scala
+++ b/nlpcraft/src/test/scala/org/apache/nlpcraft/server/nlp/enrichers/date/tools/NCDateGeneratorSpec.scala
@@ -26,18 +26,17 @@ import org.apache.nlpcraft.server.nlp.enrichers.date.NCDateFormatType._
 import org.apache.nlpcraft.server.nlp.enrichers.date.tools.NCDateGenerator.LHM_SS
 import org.apache.nlpcraft.server.nlp.enrichers.date.{NCDateParser, NCDateRange}
 import org.junit.jupiter.api.Assertions.{assertTrue, fail}
-import org.junit.jupiter.api.{Disabled, Test}
+import org.junit.jupiter.api.Test
 
 import scala.collection.JavaConverters._
 import scala.collection._
-import scala.collection.mutable.{LinkedHashMap ⇒ LHM}
+import scala.collection.mutable.{LinkedHashMap => LHM}
 import scala.language.implicitConversions
 
 /**
  * Tests for dates templates generators.
  * Excluded from suite because added for manual testing.
  */
-@Disabled
 class NCDateGeneratorSpec  {
     private def print(
         f: LHM[String, String] ⇒ Unit, cnt: Int = 500, asc: Boolean = true, keys2Check: Option[Seq[String]] = None