This is an automated email from the ASF dual-hosted git repository. jamesnetherton pushed a commit to branch 3.15.x in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git
commit e67c499e6014328d81e193fa8d0ee92b9929b785 Author: Andrej Vano <[email protected]> AuthorDate: Thu Oct 17 09:45:17 2024 +0200 [ARM] Skip tests for unsupported services --- .../component/jdbc/db2/CamelDb2JdbcTest.java | 2 + integration-test-groups/jdbc/mssql/pom.xml | 7 +++- .../component/jdbc/mssql/CamelMssqlJdbcTest.java | 2 + integration-test-groups/jdbc/oracle/pom.xml | 7 +++- .../component/jdbc/oracle/CamelOracleJdbcTest.java | 2 + .../apache/camel/quarkus/test/DisabledOnArm.java | 35 ++++++++++++++++ .../camel/quarkus/test/DisabledOnArmCondition.java | 47 ++++++++++++++++++++++ .../camel/quarkus/component/lra/it/LraTest.java | 2 + .../component/splunk/hec/it/SplunkHecTest.java | 2 + .../quarkus/component/splunk/it/SplunkTest.java | 2 + 10 files changed, 106 insertions(+), 2 deletions(-) diff --git a/integration-test-groups/jdbc/db2/src/test/java/org/apache/camel/quarkus/component/jdbc/db2/CamelDb2JdbcTest.java b/integration-test-groups/jdbc/db2/src/test/java/org/apache/camel/quarkus/component/jdbc/db2/CamelDb2JdbcTest.java index 199fd1e583..d091f7bc60 100644 --- a/integration-test-groups/jdbc/db2/src/test/java/org/apache/camel/quarkus/component/jdbc/db2/CamelDb2JdbcTest.java +++ b/integration-test-groups/jdbc/db2/src/test/java/org/apache/camel/quarkus/component/jdbc/db2/CamelDb2JdbcTest.java @@ -22,6 +22,7 @@ import io.quarkus.test.junit.QuarkusTest; import io.restassured.RestAssured; import io.restassured.http.ContentType; import org.apache.camel.quarkus.test.DisabledIfFipsMode; +import org.apache.camel.quarkus.test.DisabledOnArm; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.condition.DisabledIfSystemProperty; @@ -35,6 +36,7 @@ import static org.wildfly.common.Assert.assertNotNull; @QuarkusTest @DisabledIfSystemProperty(named = "cq.jdbcKind", matches = "derby") +@DisabledOnArm //https://github.com/quarkusio/quarkus/issues/23083 @DisabledIfFipsMode //https://github.com/apache/camel-quarkus/issues/5993 public class CamelDb2JdbcTest { diff --git a/integration-test-groups/jdbc/mssql/pom.xml b/integration-test-groups/jdbc/mssql/pom.xml index 1068df79e7..8355c0bbf5 100644 --- a/integration-test-groups/jdbc/mssql/pom.xml +++ b/integration-test-groups/jdbc/mssql/pom.xml @@ -99,6 +99,11 @@ <type>test-jar</type> <scope>test</scope> </dependency> + <dependency> + <groupId>org.apache.camel.quarkus</groupId> + <artifactId>camel-quarkus-integration-test-support</artifactId> + <scope>test</scope> + </dependency> </dependencies> @@ -266,4 +271,4 @@ </properties> </profile> </profiles> -</project> \ No newline at end of file +</project> diff --git a/integration-test-groups/jdbc/mssql/src/test/java/org/apache/camel/quarkus/component/jdbc/mssql/CamelMssqlJdbcTest.java b/integration-test-groups/jdbc/mssql/src/test/java/org/apache/camel/quarkus/component/jdbc/mssql/CamelMssqlJdbcTest.java index 97e2b89ba3..0c759355da 100644 --- a/integration-test-groups/jdbc/mssql/src/test/java/org/apache/camel/quarkus/component/jdbc/mssql/CamelMssqlJdbcTest.java +++ b/integration-test-groups/jdbc/mssql/src/test/java/org/apache/camel/quarkus/component/jdbc/mssql/CamelMssqlJdbcTest.java @@ -21,6 +21,7 @@ import java.util.List; import io.quarkus.test.junit.QuarkusTest; import io.restassured.RestAssured; import io.restassured.http.ContentType; +import org.apache.camel.quarkus.test.DisabledOnArm; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.condition.DisabledIfSystemProperty; @@ -34,6 +35,7 @@ import static org.wildfly.common.Assert.assertNotNull; @QuarkusTest @DisabledIfSystemProperty(named = "cq.jdbcKind", matches = "derby") +@DisabledOnArm //https://github.com/quarkusio/quarkus/issues/23083 public class CamelMssqlJdbcTest { String dbKind = "mssql"; diff --git a/integration-test-groups/jdbc/oracle/pom.xml b/integration-test-groups/jdbc/oracle/pom.xml index 455e5732ff..a1a90d8bdb 100644 --- a/integration-test-groups/jdbc/oracle/pom.xml +++ b/integration-test-groups/jdbc/oracle/pom.xml @@ -99,6 +99,11 @@ <type>test-jar</type> <scope>test</scope> </dependency> + <dependency> + <groupId>org.apache.camel.quarkus</groupId> + <artifactId>camel-quarkus-integration-test-support</artifactId> + <scope>test</scope> + </dependency> </dependencies> @@ -267,4 +272,4 @@ </profile> </profiles> -</project> \ No newline at end of file +</project> diff --git a/integration-test-groups/jdbc/oracle/src/test/java/org/apache/camel/quarkus/component/jdbc/oracle/CamelOracleJdbcTest.java b/integration-test-groups/jdbc/oracle/src/test/java/org/apache/camel/quarkus/component/jdbc/oracle/CamelOracleJdbcTest.java index b9382245d4..dd9d3c511a 100644 --- a/integration-test-groups/jdbc/oracle/src/test/java/org/apache/camel/quarkus/component/jdbc/oracle/CamelOracleJdbcTest.java +++ b/integration-test-groups/jdbc/oracle/src/test/java/org/apache/camel/quarkus/component/jdbc/oracle/CamelOracleJdbcTest.java @@ -21,6 +21,7 @@ import java.util.List; import io.quarkus.test.junit.QuarkusTest; import io.restassured.RestAssured; import io.restassured.http.ContentType; +import org.apache.camel.quarkus.test.DisabledOnArm; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.condition.DisabledIfSystemProperty; @@ -34,6 +35,7 @@ import static org.wildfly.common.Assert.assertNotNull; @QuarkusTest @DisabledIfSystemProperty(named = "cq.jdbcKind", matches = "derby") +@DisabledOnArm //https://github.com/quarkusio/quarkus/issues/23083 public class CamelOracleJdbcTest { String dbKind = "oracle"; diff --git a/integration-tests-support/test-support/src/main/java/org/apache/camel/quarkus/test/DisabledOnArm.java b/integration-tests-support/test-support/src/main/java/org/apache/camel/quarkus/test/DisabledOnArm.java new file mode 100644 index 0000000000..60785e57fc --- /dev/null +++ b/integration-tests-support/test-support/src/main/java/org/apache/camel/quarkus/test/DisabledOnArm.java @@ -0,0 +1,35 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.quarkus.test; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +import org.junit.jupiter.api.extension.ExtendWith; + +/** + * Skip test on ARM architecture when the operating system is not mac. + */ +@Target({ ElementType.TYPE, ElementType.METHOD }) +@Retention(RetentionPolicy.RUNTIME) +@Documented +@ExtendWith(DisabledOnArmCondition.class) +public @interface DisabledOnArm { +} diff --git a/integration-tests-support/test-support/src/main/java/org/apache/camel/quarkus/test/DisabledOnArmCondition.java b/integration-tests-support/test-support/src/main/java/org/apache/camel/quarkus/test/DisabledOnArmCondition.java new file mode 100644 index 0000000000..f3cda77b1f --- /dev/null +++ b/integration-tests-support/test-support/src/main/java/org/apache/camel/quarkus/test/DisabledOnArmCondition.java @@ -0,0 +1,47 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.quarkus.test; + +import org.junit.jupiter.api.extension.ConditionEvaluationResult; +import org.junit.jupiter.api.extension.ExecutionCondition; +import org.junit.jupiter.api.extension.ExtensionContext; + +import static org.junit.jupiter.api.extension.ConditionEvaluationResult.disabled; +import static org.junit.jupiter.api.extension.ConditionEvaluationResult.enabled; +import static org.junit.platform.commons.util.AnnotationUtils.findAnnotation; + +public class DisabledOnArmCondition implements ExecutionCondition { + private static final ConditionEvaluationResult ENABLED_BY_DEFAULT = enabled( + "@DisabledOnArm: enabled - annotation not present"); + + @Override + public ConditionEvaluationResult evaluateExecutionCondition(ExtensionContext context) { + return findAnnotation(context.getElement(), DisabledOnArm.class).isPresent() ? evaluate() : ENABLED_BY_DEFAULT; + } + + private ConditionEvaluationResult evaluate() { + if ("aarch64".equals(System.getProperty("os.arch"))) { + if (System.getProperty("os.name").toLowerCase().contains("mac")) { + return enabled("@DisabledOnArm: enable - MAC ARM"); + } else { + return disabled("@DisabledOnArm: disable - non-MAC ARM"); + } + } else { + return enabled("@DisabledOnArm: enabled - not an ARM architecture"); + } + } +} diff --git a/integration-tests/lra/src/test/java/org/apache/camel/quarkus/component/lra/it/LraTest.java b/integration-tests/lra/src/test/java/org/apache/camel/quarkus/component/lra/it/LraTest.java index 7b18325eb2..4267d2b99b 100644 --- a/integration-tests/lra/src/test/java/org/apache/camel/quarkus/component/lra/it/LraTest.java +++ b/integration-tests/lra/src/test/java/org/apache/camel/quarkus/component/lra/it/LraTest.java @@ -21,6 +21,7 @@ import java.util.concurrent.TimeUnit; import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.junit.QuarkusTest; import io.restassured.RestAssured; +import org.apache.camel.quarkus.test.DisabledOnArm; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; @@ -30,6 +31,7 @@ import static org.awaitility.Awaitility.await; @QuarkusTest @QuarkusTestResource(LraTestResource.class) +@DisabledOnArm class LraTest { @Test diff --git a/integration-tests/splunk-hec/src/test/java/org/apache/camel/quarkus/component/splunk/hec/it/SplunkHecTest.java b/integration-tests/splunk-hec/src/test/java/org/apache/camel/quarkus/component/splunk/hec/it/SplunkHecTest.java index 376f98d0f5..45fd3392b1 100644 --- a/integration-tests/splunk-hec/src/test/java/org/apache/camel/quarkus/component/splunk/hec/it/SplunkHecTest.java +++ b/integration-tests/splunk-hec/src/test/java/org/apache/camel/quarkus/component/splunk/hec/it/SplunkHecTest.java @@ -25,6 +25,7 @@ import io.quarkus.test.common.ResourceArg; import io.quarkus.test.junit.QuarkusTest; import io.restassured.RestAssured; import io.restassured.http.ContentType; +import org.apache.camel.quarkus.test.DisabledOnArm; import org.apache.camel.quarkus.test.support.splunk.SplunkConstants; import org.apache.camel.quarkus.test.support.splunk.SplunkTestResource; import org.eclipse.microprofile.config.ConfigProvider; @@ -39,6 +40,7 @@ import org.testcontainers.shaded.org.hamcrest.core.StringContains; @ResourceArg(name = "ca_cert", value = "target/certs/splunkca.pem"), @ResourceArg(name = "localhost_keystore", value = "target/certs/localhost.jks"), @ResourceArg(name = "keystore_password", value = "password") }) +@DisabledOnArm public class SplunkHecTest { @Test diff --git a/integration-tests/splunk/src/test/java/org/apache/camel/quarkus/component/splunk/it/SplunkTest.java b/integration-tests/splunk/src/test/java/org/apache/camel/quarkus/component/splunk/it/SplunkTest.java index d14dc6af7a..e484430270 100644 --- a/integration-tests/splunk/src/test/java/org/apache/camel/quarkus/component/splunk/it/SplunkTest.java +++ b/integration-tests/splunk/src/test/java/org/apache/camel/quarkus/component/splunk/it/SplunkTest.java @@ -30,6 +30,7 @@ import io.quarkus.test.junit.QuarkusTest; import io.restassured.RestAssured; import io.restassured.http.ContentType; import org.apache.camel.component.splunk.ProducerType; +import org.apache.camel.quarkus.test.DisabledOnArm; import org.apache.camel.quarkus.test.support.splunk.SplunkConstants; import org.apache.camel.quarkus.test.support.splunk.SplunkTestResource; import org.apache.http.NoHttpResponseException; @@ -46,6 +47,7 @@ import static org.hamcrest.Matchers.is; @QuarkusTest @QuarkusTestResource(value = SplunkTestResource.class) +@DisabledOnArm public class SplunkTest { private final static int TIMEOUT_IN_SECONDS = 60;
