This is an automated email from the ASF dual-hosted git repository.
sergeykamov pushed a commit to branch NLPCRAFT-381
in repository https://gitbox.apache.org/repos/asf/incubator-nlpcraft.git
The following commit(s) were added to refs/heads/NLPCRAFT-381 by this push:
new 0230d8e WIP.
0230d8e is described below
commit 0230d8eef40b0d68898606d99b4f231e633ca359
Author: Sergey Kamov <[email protected]>
AuthorDate: Thu Aug 12 11:16:11 2021 +0300
WIP.
---
nlpcraft-tests/cli/pom.xml | 51 +++++++++++++++++-----
.../nlpcraft/model/tools/cmdline/NCCliSpec.scala | 17 ++++++--
pom.xml | 2 +-
3 files changed, 55 insertions(+), 15 deletions(-)
diff --git a/nlpcraft-tests/cli/pom.xml b/nlpcraft-tests/cli/pom.xml
index 7c2f588..0c8f8bb 100644
--- a/nlpcraft-tests/cli/pom.xml
+++ b/nlpcraft-tests/cli/pom.xml
@@ -47,16 +47,45 @@
</dependencies>
<build>
- <resources>
- <resource>
- <directory>src/main/scala</directory>
- </resource>
- <resource>
- <directory>src/main/resources</directory>
- <includes>
- <include>**/*.*</include>
- </includes>
- </resource>
- </resources>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>${maven.compiler.plugin.ver}</version>
+ <configuration>
+ <source>${java.ver}</source>
+ <target>${java.ver}</target>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>${maven.surefire.plugin.ver}</version>
+ <configuration>
+ <skip>true</skip>
+ <environmentVariables>
+
<DNLPCRAFT_CLI_TEST_ENABLED>true</DNLPCRAFT_CLI_TEST_ENABLED>
+ </environmentVariables>
+ </configuration>
+ <executions>
+ <!-- All tests are defined as integration. -->
+ <execution>
+ <id>integration-tests</id>
+ <phase>integration-test</phase>
+ <goals>
+ <goal>test</goal>
+ </goals>
+ <configuration>
+ <skip>false</skip>
+ <!-- Mandatory part. -->
+ <includes>
+ <include>**/*.*</include>
+ </includes>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
</build>
</project>
diff --git
a/nlpcraft-tests/cli/src/test/java/org/apache/nlpcraft/model/tools/cmdline/NCCliSpec.scala
b/nlpcraft-tests/cli/src/test/java/org/apache/nlpcraft/model/tools/cmdline/NCCliSpec.scala
index 5a066c7..77b6841 100644
---
a/nlpcraft-tests/cli/src/test/java/org/apache/nlpcraft/model/tools/cmdline/NCCliSpec.scala
+++
b/nlpcraft-tests/cli/src/test/java/org/apache/nlpcraft/model/tools/cmdline/NCCliSpec.scala
@@ -32,6 +32,8 @@ import scala.util.Using
* - This test cannot be started together with other server instances.
*/
class NCCliSpec {
+ private lazy val SKIP = !U.isSysEnvSet("DNLPCRAFT_CLI_TEST_ENABLED")
+
private var dirBin: File = _
private var script: File = _
private var allDepsJar: File = _
@@ -45,6 +47,9 @@ class NCCliSpec {
@BeforeEach
def before(): Unit = {
+ if (SKIP)
+ return
+
val dirUsr = new File(SystemUtils.USER_DIR).getParentFile.getParentFile
val dirTarget = new File(dirUsr, "nlpcraft/target")
@@ -109,21 +114,27 @@ class NCCliSpec {
thread.start()
- val w = ProcessWrapper(proc, thread)
+ val wrapper = ProcessWrapper(proc, thread)
cdl.await(timeoutSecs, TimeUnit.SECONDS)
if (!isStarted) {
- w.destroy()
+ wrapper.destroy()
throw new RuntimeException(s"Command cannot be started: $arg")
}
- w
+ wrapper
}
@Test
def test(): Unit = {
+ if (SKIP) {
+ println(s"Test disabled: ${this.getClass}")
+
+ return
+ }
+
val procs = mutable.Buffer.empty[ProcessWrapper]
def stopInstances(): Unit = {
diff --git a/pom.xml b/pom.xml
index b27bfe7..f06819c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -648,7 +648,7 @@
</profile>
<profile>
- <id>tests</id>
+ <id>mvntests</id>
<modules>
<module>nlpcraft-tests/cli</module>
</modules>