Skip to content

Commit

Permalink
Enable compatibility tests on macOS (#6857)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
adutra authored May 19, 2023
1 parent b5a58b5 commit 068c24d
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand All @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -75,7 +73,6 @@ void currentVersionServer() {
}

@Test
@DisabledOnOs(OS.MAC)
void oldVersionServer() {
ExtensionValuesStore valuesStore = new ExtensionValuesStore(null);
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
import org.projectnessie.tools.compatibility.api.VersionCondition;

@ExtendWith(SoftAssertionsExtension.class)
@DisabledOnOs(OS.MAC)
class TestNessieCompatibilityExtensions {
@InjectSoftAssertions protected SoftAssertions soft;

Expand All @@ -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(
Expand Down Expand Up @@ -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")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 068c24d

Please sign in to comment.