You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@plc4x.apache.org by cd...@apache.org on 2022/11/07 14:52:05 UTC
[plc4x] branch feature/cdutz/go-ads-ng updated: fix(test) Not all tests are executed when enabling the "jenkins-build" or the "with-all-tests" profiles.
This is an automated email from the ASF dual-hosted git repository.
cdutz pushed a commit to branch feature/cdutz/go-ads-ng
in repository https://gitbox.apache.org/repos/asf/plc4x.git
The following commit(s) were added to refs/heads/feature/cdutz/go-ads-ng by this push:
new 8e9b4afc0a fix(test) Not all tests are executed when enabling the "jenkins-build" or the "with-all-tests" profiles.
8e9b4afc0a is described below
commit 8e9b4afc0ae6c7bed2f9a3a577c444e95c6118d0
Author: Christofer Dutz <ch...@c-ware.de>
AuthorDate: Mon Nov 7 15:51:56 2022 +0100
fix(test) Not all tests are executed when enabling the "jenkins-build" or the "with-all-tests" profiles.
- Got the "all-tests" profile working again.
---
Jenkinsfile | 2 ++
.../plc4x/java/bacnetip/RandomPackagesTest.java | 2 +-
.../eip/readwrite/protocol/EipProtocolLogic.java | 6 +++---
plc4j/pom.xml | 1 +
.../plc4x/test/RequireAllTestsFlagCondition.java | 1 +
.../apache/plc4x/test/RequirePcapCondition.java | 2 ++
.../apache/plc4x/test/RequirePcapNgCondition.java | 4 ++++
.../knxnetip/readwrite/model/KnxManufacturer.cs | 19 ++++++++++++------
pom.xml | 23 ++++------------------
9 files changed, 31 insertions(+), 29 deletions(-)
diff --git a/Jenkinsfile b/Jenkinsfile
index 1ee8f7c8d7..0df46e1b9d 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -38,6 +38,8 @@ pipeline {
// Test failures will be handled by the jenkins junit steps and mark the build as unstable.
MVN_TEST_FAIL_IGNORE = '-Dmaven.test.failure.ignore=true'
+ ENABLE_ALL_TESTS = true
+
SONARCLOUD_PARAMS = "-Dsonar.host.url=https://sonarcloud.io -Dsonar.organization=apache -Dsonar.projectKey=apache_plc4x -Dsonar.branch.name=develop"
}
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 baa9039505..03ed071a61 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
@@ -54,7 +54,7 @@ import static org.junit.jupiter.api.Assumptions.assumeTrue;
// Tests from http://kargs.net/captures
@RequirePcapNg
-@RequireAllTestsFlag
+//@RequireAllTestsFlag
@Tag("require-all-tests")
@Tag("bacnet-regression")
public class RandomPackagesTest {
diff --git a/plc4j/drivers/eip/src/main/java/org/apache/plc4x/java/eip/readwrite/protocol/EipProtocolLogic.java b/plc4j/drivers/eip/src/main/java/org/apache/plc4x/java/eip/readwrite/protocol/EipProtocolLogic.java
index 9a87a5a80b..b86edfc488 100644
--- a/plc4j/drivers/eip/src/main/java/org/apache/plc4x/java/eip/readwrite/protocol/EipProtocolLogic.java
+++ b/plc4j/drivers/eip/src/main/java/org/apache/plc4x/java/eip/readwrite/protocol/EipProtocolLogic.java
@@ -367,7 +367,7 @@ public class EipProtocolLogic extends Plc4xProtocolBase<EipPacket> implements Ha
list.add(new PlcBOOL(data.getBoolean(index)));
index += type.getSize();
break;
- case STRUCTURED: {
+ case Struct: {
Short structuredType = Short.reverseBytes(data.getShort(0));
Short structuredLen = Short.reverseBytes(data.getShort(STRING_LEN_OFFSET));
if (structuredType == CIPStructTypeCode.STRING.getValue()) {
@@ -402,7 +402,7 @@ public class EipProtocolLogic extends Plc4xProtocolBase<EipPacket> implements Ha
case BOOL:
return new PlcBOOL(data.getBoolean(0));
case STRING:
- case STRUCTURED: {
+ case Struct: {
Short structuredType = Short.reverseBytes(data.getShort(0));
Short structuredLen = Short.reverseBytes(data.getShort(STRING_LEN_OFFSET));
if (structuredType == CIPStructTypeCode.STRING.getValue()) {
@@ -617,7 +617,7 @@ public class EipProtocolLogic extends Plc4xProtocolBase<EipPacket> implements Ha
buffer.putInt(value.getString().length());
buffer.put(value.getString().getBytes(), 0, value.getString().length());
break;
- case STRUCTURED:
+ case Struct:
// Need to handle
break;
default:
diff --git a/plc4j/pom.xml b/plc4j/pom.xml
index 4c24a84484..b5e1ed1157 100644
--- a/plc4j/pom.xml
+++ b/plc4j/pom.xml
@@ -203,6 +203,7 @@
<!-- Pass in to the build, if all tests should be run -->
<ENABLE_ALL_TESTS>${enable-all-tests}</ENABLE_ALL_TESTS>
</environmentVariables>
+ <excludedGroups>${excluded-test-groups}</excludedGroups>
</configuration>
</plugin>
diff --git a/plc4j/utils/test-utils/src/main/java/org/apache/plc4x/test/RequireAllTestsFlagCondition.java b/plc4j/utils/test-utils/src/main/java/org/apache/plc4x/test/RequireAllTestsFlagCondition.java
index a92732a823..cef714b345 100644
--- a/plc4j/utils/test-utils/src/main/java/org/apache/plc4x/test/RequireAllTestsFlagCondition.java
+++ b/plc4j/utils/test-utils/src/main/java/org/apache/plc4x/test/RequireAllTestsFlagCondition.java
@@ -30,6 +30,7 @@ public class RequireAllTestsFlagCondition implements ExecutionCondition {
if("true".equalsIgnoreCase(propertyValue)) {
return ConditionEvaluationResult.enabled("ENABLE_ALL_TESTS variable set to 'true'.");
}
+ System.out.println("DISABLED-RequireAllTestsFlagCondition");
return ConditionEvaluationResult.disabled("ENABLE_ALL_TESTS variable not set to 'true', therefore disabling this test.");
}
diff --git a/plc4j/utils/test-utils/src/main/java/org/apache/plc4x/test/RequirePcapCondition.java b/plc4j/utils/test-utils/src/main/java/org/apache/plc4x/test/RequirePcapCondition.java
index b0d47967f4..6f04e9aea4 100644
--- a/plc4j/utils/test-utils/src/main/java/org/apache/plc4x/test/RequirePcapCondition.java
+++ b/plc4j/utils/test-utils/src/main/java/org/apache/plc4x/test/RequirePcapCondition.java
@@ -47,8 +47,10 @@ public class RequirePcapCondition implements ExecutionCondition {
logger.info("Error detecting libpcap version.", e);
}
if (SystemUtils.IS_OS_WINDOWS) {
+ System.out.println("DISABLED-RequirePcapCondition");
return ConditionEvaluationResult.disabled("Test disabled due to missing or invalid Npcap version. Please install from here: https://npcap.com/ as this version supports all needed features.");
} else {
+ System.out.println("DISABLED-RequirePcapCondition");
return ConditionEvaluationResult.disabled("Test disabled due to missing or invalid libpcap version. Please install at least version 1.1.0 to support all features.");
}
}
diff --git a/plc4j/utils/test-utils/src/main/java/org/apache/plc4x/test/RequirePcapNgCondition.java b/plc4j/utils/test-utils/src/main/java/org/apache/plc4x/test/RequirePcapNgCondition.java
index 238a5cadff..3a0e266748 100644
--- a/plc4j/utils/test-utils/src/main/java/org/apache/plc4x/test/RequirePcapNgCondition.java
+++ b/plc4j/utils/test-utils/src/main/java/org/apache/plc4x/test/RequirePcapNgCondition.java
@@ -57,8 +57,10 @@ public class RequirePcapNgCondition implements ExecutionCondition {
if (curVersion.compareTo(minVersion) >= 0) {
return ConditionEvaluationResult.enabled("Found libpcap version " + versionString);
} else if (SystemUtils.IS_OS_WINDOWS) {
+ System.out.println("DISABLED-RequirePcapNgCondition");
return ConditionEvaluationResult.disabled("Test disabled due to too old Npcap version. Please install from here: https://npcap.com/ as this version supports all needed features.");
} else {
+ System.out.println("DISABLED-RequirePcapNgCondition");
return ConditionEvaluationResult.disabled("Test disabled due to too old libpcap version. Please install at least version 1.10.1 to support all features.");
}
}
@@ -66,8 +68,10 @@ public class RequirePcapNgCondition implements ExecutionCondition {
logger.info("Error detecting libpcap version.", e);
}
if(SystemUtils.IS_OS_WINDOWS) {
+ System.out.println("DISABLED-RequirePcapNgCondition");
return ConditionEvaluationResult.disabled("Test disabled due to missing or invalid Npcap version. Please install from here: https://npcap.com/ as this version supports all needed features.");
} else {
+ System.out.println("DISABLED-RequirePcapNgCondition");
return ConditionEvaluationResult.disabled("Test disabled due to missing or invalid libpcap version. Please install at least version 1.10.1 to support all features.");
}
}
diff --git a/plc4net/drivers/knxnetip/src/drivers/knxnetip/readwrite/model/KnxManufacturer.cs b/plc4net/drivers/knxnetip/src/drivers/knxnetip/readwrite/model/KnxManufacturer.cs
index 1893caca62..ca4351c296 100644
--- a/plc4net/drivers/knxnetip/src/drivers/knxnetip/readwrite/model/KnxManufacturer.cs
+++ b/plc4net/drivers/knxnetip/src/drivers/knxnetip/readwrite/model/KnxManufacturer.cs
@@ -628,8 +628,9 @@ namespace org.apache.plc4net.drivers.knxnetip.readwrite.model
M_SPLENDID_MINDS_GMBH = 601,
M_ESTADA = 602,
M_ZHONGYUNXINZHIKONGGUJITUANYOUXIANGONGSI = 603,
- M_ABB___RESERVED = 604,
- M_BUSCH_JAEGER_ELEKTRO___RESERVED = 605,
+ M_STUHL_REGELSYSTEME_GMBH = 604,
+ M_ABB___RESERVED = 605,
+ M_BUSCH_JAEGER_ELEKTRO___RESERVED = 606,
}
public static class KnxManufacturerInfo
@@ -2325,10 +2326,13 @@ namespace org.apache.plc4net.drivers.knxnetip.readwrite.model
case KnxManufacturer.M_ZHONGYUNXINZHIKONGGUJITUANYOUXIANGONGSI: { /* '603' */
return 661;
}
- case KnxManufacturer.M_ABB___RESERVED: { /* '604' */
+ case KnxManufacturer.M_STUHL_REGELSYSTEME_GMBH: { /* '604' */
+ return 662;
+ }
+ case KnxManufacturer.M_ABB___RESERVED: { /* '605' */
return 43954;
}
- case KnxManufacturer.M_BUSCH_JAEGER_ELEKTRO___RESERVED: { /* '605' */
+ case KnxManufacturer.M_BUSCH_JAEGER_ELEKTRO___RESERVED: { /* '606' */
return 43959;
}
case KnxManufacturer.M_SCHNEIDER_ELECTRIC_INDUSTRIES_SAS: { /* '61' */
@@ -4153,10 +4157,13 @@ namespace org.apache.plc4net.drivers.knxnetip.readwrite.model
case KnxManufacturer.M_ZHONGYUNXINZHIKONGGUJITUANYOUXIANGONGSI: { /* '603' */
return "zhongyunxinzhikonggujituanyouxiangongsi";
}
- case KnxManufacturer.M_ABB___RESERVED: { /* '604' */
+ case KnxManufacturer.M_STUHL_REGELSYSTEME_GMBH: { /* '604' */
+ return "Stuhl Regelsysteme GmbH";
+ }
+ case KnxManufacturer.M_ABB___RESERVED: { /* '605' */
return "ABB - reserved";
}
- case KnxManufacturer.M_BUSCH_JAEGER_ELEKTRO___RESERVED: { /* '605' */
+ case KnxManufacturer.M_BUSCH_JAEGER_ELEKTRO___RESERVED: { /* '606' */
return "Busch-Jaeger Elektro - reserved";
}
case KnxManufacturer.M_SCHNEIDER_ELECTRIC_INDUSTRIES_SAS: { /* '61' */
diff --git a/pom.xml b/pom.xml
index bc46d63eb0..f0173568a7 100644
--- a/pom.xml
+++ b/pom.xml
@@ -163,8 +163,8 @@
<asciidoctorj.diagram.version>2.2.3</asciidoctorj.diagram.version>
<skip-code-generation-tests>true</skip-code-generation-tests>
- <skip-dependency-cve-scan>true</skip-dependency-cve-scan>
<enable-all-tests>false</enable-all-tests>
+ <excluded-test-groups>require-all-tests</excluded-test-groups>
</properties>
<modules>
@@ -1128,7 +1128,7 @@
</dependency>
</dependencies>
<configuration>
- <excludedGroups>require-all-tests</excludedGroups>
+ <excludedGroups>${excluded-test-groups}</excludedGroups>
</configuration>
</plugin>
@@ -1704,9 +1704,8 @@
<id>jenkins-build</id>
<properties>
<skip-code-generation-tests>false</skip-code-generation-tests>
- <!-- Disabled this for now as it was just continiuously reporting false positives -->
- <skip-dependency-cve-scan>true</skip-dependency-cve-scan>
<enable-all-tests>true</enable-all-tests>
+ <excluded-test-groups/>
</properties>
</profile>
@@ -1714,23 +1713,9 @@
<id>enable-all-checks</id>
<properties>
<skip-code-generation-tests>false</skip-code-generation-tests>
- <!-- Disabled this for now as it was just continiuously reporting false positives -->
- <skip-dependency-cve-scan>true</skip-dependency-cve-scan>
<enable-all-tests>true</enable-all-tests>
+ <excluded-test-groups/>
</properties>
- <build>
- <pluginManagement>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <excludedGroups />
- </configuration>
- </plugin>
- </plugins>
- </pluginManagement>
- </build>
</profile>
<!--