Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable compatibility tests on macOS #6857

Merged
merged 2 commits into from
May 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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