You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@plc4x.apache.org by sr...@apache.org on 2022/07/30 08:58:48 UTC

[plc4x] branch develop updated: test: add ParserSerializerTestsuiteGeneratorSpec to the ENABLE_ALL_TESTS group

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

sruehl pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/plc4x.git


The following commit(s) were added to refs/heads/develop by this push:
     new 64c52c7cf test: add ParserSerializerTestsuiteGeneratorSpec to the ENABLE_ALL_TESTS group
64c52c7cf is described below

commit 64c52c7cfee56445647caec1b8a084d7c805677e
Author: Sebastian Rühl <sr...@apache.org>
AuthorDate: Sat Jul 30 10:58:31 2022 +0200

    test: add ParserSerializerTestsuiteGeneratorSpec to the ENABLE_ALL_TESTS group
---
 .../apache/plc4x/java/bacnetip/RandomPackagesTest.java   |  1 +
 .../ParserSerializerTestsuiteGeneratorSpec.groovy        |  7 +++++--
 .../java/org/apache/plc4x/test/RequireAllTestsFlag.java  |  2 ++
 pom.xml                                                  | 16 ++++++++++++++++
 4 files changed, 24 insertions(+), 2 deletions(-)

diff --git a/plc4j/drivers/bacnet/src/test/java/org/apache/plc4x/java/bacnetip/RandomPackagesTest.java b/plc4j/drivers/bacnet/src/test/java/org/apache/plc4x/java/bacnetip/RandomPackagesTest.java
index bbe1c5ac4..7dbf4ad8e 100644
--- a/plc4j/drivers/bacnet/src/test/java/org/apache/plc4x/java/bacnetip/RandomPackagesTest.java
+++ b/plc4j/drivers/bacnet/src/test/java/org/apache/plc4x/java/bacnetip/RandomPackagesTest.java
@@ -55,6 +55,7 @@ import static org.junit.jupiter.api.Assumptions.assumeTrue;
 // Tests from http://kargs.net/captures
 @RequirePcapNg
 @RequireAllTestsFlag
+@Tag("require-all-tests")
 @Tag("bacnet-regression")
 public class RandomPackagesTest {
 
diff --git a/plc4j/utils/test-generator/src/test/groovy/org/apache/plc4x/test/generator/ParserSerializerTestsuiteGeneratorSpec.groovy b/plc4j/utils/test-generator/src/test/groovy/org/apache/plc4x/test/generator/ParserSerializerTestsuiteGeneratorSpec.groovy
index fb6295a08..cb4efb914 100644
--- a/plc4j/utils/test-generator/src/test/groovy/org/apache/plc4x/test/generator/ParserSerializerTestsuiteGeneratorSpec.groovy
+++ b/plc4j/utils/test-generator/src/test/groovy/org/apache/plc4x/test/generator/ParserSerializerTestsuiteGeneratorSpec.groovy
@@ -19,6 +19,7 @@
 package org.apache.plc4x.test.generator
 
 import org.opentest4j.TestAbortedException
+import spock.lang.IgnoreIf
 
 import static org.xmlunit.matchers.CompareMatcher.isIdenticalTo
 import static spock.util.matcher.HamcrestSupport.*
@@ -27,6 +28,8 @@ import spock.lang.Specification
 
 import java.nio.file.Files
 
+// TODO: find out how to access surefire groups...
+@IgnoreIf({ env["ENABLE_ALL_TESTS"] == null || env["ENABLE_ALL_TESTS"] == "false" })
 class ParserSerializerTestsuiteGeneratorSpec extends Specification {
     def "Test main with an example pcap"() {
         given:
@@ -48,13 +51,13 @@ class ParserSerializerTestsuiteGeneratorSpec extends Specification {
             proc.consumeProcessOutput(sout, serr)
             proc.waitForOrKill(1000)
             def output = serr + sout
-            if(!output.contains("libpcap")) {
+            if (!output.contains("libpcap")) {
                 throw new TestAbortedException("no libpcap")
             }
             def libpcapVersion = output.substring(output.indexOf("libpcap version ") + 16)
             libpcapVersion = libpcapVersion.substring(0, libpcapVersion.indexOf("\n"))
             // Check the libpcapVersion is at least 1.10.0
-            if(!libpcapVersion.startsWith("1.10")) {
+            if (!libpcapVersion.startsWith("1.10")) {
                 throw new TestAbortedException("minimum libpcap version 1.10.0 expected")
             }
         } catch (e) {
diff --git a/plc4j/utils/test-utils/src/main/java/org/apache/plc4x/test/RequireAllTestsFlag.java b/plc4j/utils/test-utils/src/main/java/org/apache/plc4x/test/RequireAllTestsFlag.java
index 5e274c6a9..4b3111c76 100644
--- a/plc4j/utils/test-utils/src/main/java/org/apache/plc4x/test/RequireAllTestsFlag.java
+++ b/plc4j/utils/test-utils/src/main/java/org/apache/plc4x/test/RequireAllTestsFlag.java
@@ -30,7 +30,9 @@ import java.lang.annotation.Target;
  * for which we want the tests to only be executed if the "enable-all-checks"
  * profile is enabled. (Actually it works by setting an environment variable
  * named "ENABLE_ALL_TESTS" to "true".
+ * @deprecated we should use tags like "@Tag("require-all-tests")"
  */
+@Deprecated
 @Target({ ElementType.TYPE, ElementType.METHOD })
 @Retention(RetentionPolicy.RUNTIME)
 @ExtendWith(RequireAllTestsFlagCondition.class)
diff --git a/pom.xml b/pom.xml
index 44821c7cd..989181f2d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1158,6 +1158,9 @@
               <version>${junit.jupiter.version}</version>
             </dependency>
           </dependencies>
+          <configuration>
+            <excludedGroups>require-all-tests</excludedGroups>
+          </configuration>
         </plugin>
 
         <plugin>
@@ -1678,6 +1681,19 @@
         <skip-dependency-cve-scan>false</skip-dependency-cve-scan>
         <enable-all-tests>true</enable-all-tests>
       </properties>
+      <build>
+        <pluginManagement>
+          <plugins>
+            <plugin>
+              <groupId>org.apache.maven.plugins</groupId>
+              <artifactId>maven-surefire-plugin</artifactId>
+              <configuration>
+                <excludedGroups/>
+              </configuration>
+            </plugin>
+          </plugins>
+        </pluginManagement>
+      </build>
     </profile>
 
     <!--