From 068c24d00c33ccbfebf57979c41c9fa3eeb782f3 Mon Sep 17 00:00:00 2001 From: Alexandre Dutra Date: Fri, 19 May 2023 17:41:50 +0200 Subject: [PATCH] Enable compatibility tests on macOS (#6857) This commit enables all the compatibility tests that are currently doable on macOS, namely, all tests except the ones relying on RocksDB. Compatibility tests with RocksDB fail consistently with SIGSEGV on macOS. --- .../internal/NessieUpgradesExtension.java | 11 +++++++++++ .../compatibility/internal/TestNessieApiHolder.java | 3 --- .../internal/TestNessieCompatibilityExtensions.java | 7 ++++++- .../compatibility/internal/TestNessieServer.java | 3 --- 4 files changed, 17 insertions(+), 7 deletions(-) diff --git a/compatibility/common/src/main/java/org/projectnessie/tools/compatibility/internal/NessieUpgradesExtension.java b/compatibility/common/src/main/java/org/projectnessie/tools/compatibility/internal/NessieUpgradesExtension.java index 4acbd259526..7700f1cb6fa 100644 --- a/compatibility/common/src/main/java/org/projectnessie/tools/compatibility/internal/NessieUpgradesExtension.java +++ b/compatibility/common/src/main/java/org/projectnessie/tools/compatibility/internal/NessieUpgradesExtension.java @@ -15,6 +15,7 @@ */ package org.projectnessie.tools.compatibility.internal; +import static org.junit.jupiter.api.extension.ConditionEvaluationResult.disabled; import static org.projectnessie.tools.compatibility.internal.AbstractNessieApiHolder.apiInstanceForField; import static org.projectnessie.tools.compatibility.internal.AnnotatedFields.populateNessieApiFields; import static org.projectnessie.tools.compatibility.internal.GlobalForClass.globalForClass; @@ -27,6 +28,8 @@ import java.util.concurrent.atomic.AtomicBoolean; import java.util.function.BooleanSupplier; import java.util.function.Function; +import org.junit.jupiter.api.condition.OS; +import org.junit.jupiter.api.extension.ConditionEvaluationResult; import org.junit.jupiter.api.extension.ExtensionContext; import org.projectnessie.tools.compatibility.api.TargetVersion; import org.projectnessie.tools.compatibility.api.Version; @@ -41,6 +44,14 @@ */ public class NessieUpgradesExtension extends AbstractMultiVersionExtension { + @Override + public ConditionEvaluationResult evaluateExecutionCondition(ExtensionContext context) { + if (OS.MAC.isCurrentOs()) { + return disabled("Disabled on macOS due to SIGSEGV issues with RocksDB"); + } + return super.evaluateExecutionCondition(context); + } + @Override public void beforeAll(ExtensionContext context) { Version version = populateNessieVersionAnnotatedFields(context, null); diff --git a/compatibility/common/src/test/java/org/projectnessie/tools/compatibility/internal/TestNessieApiHolder.java b/compatibility/common/src/test/java/org/projectnessie/tools/compatibility/internal/TestNessieApiHolder.java index 45a16a85e3b..a2413af1799 100644 --- a/compatibility/common/src/test/java/org/projectnessie/tools/compatibility/internal/TestNessieApiHolder.java +++ b/compatibility/common/src/test/java/org/projectnessie/tools/compatibility/internal/TestNessieApiHolder.java @@ -26,8 +26,6 @@ import org.assertj.core.api.junit.jupiter.InjectSoftAssertions; import org.assertj.core.api.junit.jupiter.SoftAssertionsExtension; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.condition.DisabledOnOs; -import org.junit.jupiter.api.condition.OS; import org.junit.jupiter.api.extension.ExtendWith; import org.junit.jupiter.api.extension.ExtensionContext; import org.junit.jupiter.api.extension.ExtensionContext.Namespace; @@ -75,7 +73,6 @@ void currentVersionServer() { } @Test - @DisabledOnOs(OS.MAC) void oldVersionServer() { ExtensionValuesStore valuesStore = new ExtensionValuesStore(null); try { diff --git a/compatibility/common/src/test/java/org/projectnessie/tools/compatibility/internal/TestNessieCompatibilityExtensions.java b/compatibility/common/src/test/java/org/projectnessie/tools/compatibility/internal/TestNessieCompatibilityExtensions.java index 6391cad7e86..0fc521297b6 100644 --- a/compatibility/common/src/test/java/org/projectnessie/tools/compatibility/internal/TestNessieCompatibilityExtensions.java +++ b/compatibility/common/src/test/java/org/projectnessie/tools/compatibility/internal/TestNessieCompatibilityExtensions.java @@ -44,7 +44,6 @@ import org.projectnessie.tools.compatibility.api.VersionCondition; @ExtendWith(SoftAssertionsExtension.class) -@DisabledOnOs(OS.MAC) class TestNessieCompatibilityExtensions { @InjectSoftAssertions protected SoftAssertions soft; @@ -63,6 +62,9 @@ void noVersions() { } @Test + @DisabledOnOs( + value = OS.MAC, + disabledReason = "Uses NessieUpgradesExtension, which is not compatible with macOS") void tooManyExtensions() { soft.assertThat( Stream.of( @@ -138,6 +140,9 @@ void nestedTests() { } @Test + @DisabledOnOs( + value = OS.MAC, + disabledReason = "Uses NessieUpgradesExtension, which is not compatible with macOS") void upgrade() { EngineTestKit.engine(MultiEnvTestEngine.ENGINE_ID) .configurationParameter("nessie.versions", "0.42.0,current") diff --git a/compatibility/common/src/test/java/org/projectnessie/tools/compatibility/internal/TestNessieServer.java b/compatibility/common/src/test/java/org/projectnessie/tools/compatibility/internal/TestNessieServer.java index e0bd1845aa4..7524c39aacd 100644 --- a/compatibility/common/src/test/java/org/projectnessie/tools/compatibility/internal/TestNessieServer.java +++ b/compatibility/common/src/test/java/org/projectnessie/tools/compatibility/internal/TestNessieServer.java @@ -25,8 +25,6 @@ import org.assertj.core.api.junit.jupiter.InjectSoftAssertions; import org.assertj.core.api.junit.jupiter.SoftAssertionsExtension; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.condition.DisabledOnOs; -import org.junit.jupiter.api.condition.OS; import org.junit.jupiter.api.extension.ExtendWith; import org.junit.jupiter.api.extension.ExtensionContext; import org.junit.jupiter.api.extension.ExtensionContext.Namespace; @@ -79,7 +77,6 @@ void currentVersionServer() { @ParameterizedTest @ValueSource(strings = {"0.42.0"}) - @DisabledOnOs(OS.MAC) void oldNessieVersionServer(String nessieVersion) { ExtensionValuesStore valuesStore = new ExtensionValuesStore(null); NessieServer server;