Skip to content

Commit

Permalink
Activate IT.
Browse files Browse the repository at this point in the history
Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com>
  • Loading branch information
Yury-Fridlyand committed Aug 12, 2024
1 parent 73a9a78 commit bead836
Showing 1 changed file with 0 additions and 34 deletions.
34 changes: 0 additions & 34 deletions java/integTest/src/test/java/glide/PubSubTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.junit.jupiter.api.Assertions.fail;
import static org.junit.jupiter.api.Assumptions.assumeFalse;
import static org.junit.jupiter.api.Assumptions.assumeTrue;

import glide.api.BaseClient;
Expand Down Expand Up @@ -51,7 +50,6 @@
import lombok.SneakyThrows;
import org.apache.commons.lang3.tuple.Pair;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.Timeout;
import org.junit.jupiter.params.ParameterizedTest;
Expand Down Expand Up @@ -217,19 +215,11 @@ private BaseClient createListener(
// meanwhile, all pubsubMessages are delivered.
// debug this and add checks for `publish` return value

// TODO: remove once fixed
private void skipTestsOnMac() {
assumeFalse(
System.getProperty("os.name").toLowerCase().contains("mac"),
"PubSub doesn't work on mac OS");
}

/** Similar to `test_pubsub_exact_happy_path` in python client tests. */
@SneakyThrows
@ParameterizedTest(name = "standalone = {0}, read messages via {1}")
@MethodSource("getTestScenarios")
public void exact_happy_path(boolean standalone, MessageReadMethod method) {
skipTestsOnMac();
GlideString channel = gs(UUID.randomUUID().toString());
GlideString message = gs(UUID.randomUUID().toString());
var subscriptions = Map.of(exact(standalone), Set.of(channel));
Expand All @@ -251,7 +241,6 @@ public void exact_happy_path(boolean standalone, MessageReadMethod method) {
@ParameterizedTest(name = "standalone = {0}, read messages via {1}")
@MethodSource("getTestScenarios")
public void exact_happy_path_many_channels(boolean standalone, MessageReadMethod method) {
skipTestsOnMac();
int numChannels = 256;
int messagesPerChannel = 256;
var messages = new ArrayList<PubSubMessage>(numChannels * messagesPerChannel);
Expand Down Expand Up @@ -288,7 +277,6 @@ public void exact_happy_path_many_channels(boolean standalone, MessageReadMethod
@EnumSource(MessageReadMethod.class)
public void sharded_pubsub(MessageReadMethod method) {
assumeTrue(SERVER_VERSION.isGreaterThanOrEqualTo("7.0.0"), "This feature added in version 7");
skipTestsOnMac();

GlideString channel = gs(UUID.randomUUID().toString());
GlideString pubsubMessage = gs(UUID.randomUUID().toString());
Expand All @@ -311,7 +299,6 @@ public void sharded_pubsub(MessageReadMethod method) {
@EnumSource(MessageReadMethod.class)
public void sharded_pubsub_many_channels(MessageReadMethod method) {
assumeTrue(SERVER_VERSION.isGreaterThanOrEqualTo("7.0.0"), "This feature added in version 7");
skipTestsOnMac();

int numChannels = 256;
int pubsubMessagesPerChannel = 256;
Expand Down Expand Up @@ -350,7 +337,6 @@ public void sharded_pubsub_many_channels(MessageReadMethod method) {
@ParameterizedTest(name = "standalone = {0}, read messages via {1}")
@MethodSource("getTestScenarios")
public void pattern(boolean standalone, MessageReadMethod method) {
skipTestsOnMac();
String prefix = "channel.";
GlideString pattern = gs(prefix + "*");
Map<GlideString, GlideString> message2channels =
Expand Down Expand Up @@ -390,7 +376,6 @@ public void pattern(boolean standalone, MessageReadMethod method) {
@ParameterizedTest(name = "standalone = {0}, read messages via {1}")
@MethodSource("getTestScenarios")
public void pattern_many_channels(boolean standalone, MessageReadMethod method) {
skipTestsOnMac();
String prefix = "channel.";
GlideString pattern = gs(prefix + "*");
int numChannels = 256;
Expand Down Expand Up @@ -429,7 +414,6 @@ public void pattern_many_channels(boolean standalone, MessageReadMethod method)
@ParameterizedTest(name = "standalone = {0}, read messages via {1}")
@MethodSource("getTestScenarios")
public void combined_exact_and_pattern_one_client(boolean standalone, MessageReadMethod method) {
skipTestsOnMac();
String prefix = "channel.";
GlideString pattern = gs(prefix + "*");
int numChannels = 256;
Expand Down Expand Up @@ -481,7 +465,6 @@ public void combined_exact_and_pattern_one_client(boolean standalone, MessageRea
@MethodSource("getTestScenarios")
public void combined_exact_and_pattern_multiple_clients(
boolean standalone, MessageReadMethod method) {
skipTestsOnMac();
String prefix = "channel.";
GlideString pattern = gs(prefix + "*");
int numChannels = 256;
Expand Down Expand Up @@ -551,7 +534,6 @@ public void combined_exact_and_pattern_multiple_clients(
@EnumSource(MessageReadMethod.class)
public void combined_exact_pattern_and_sharded_one_client(MessageReadMethod method) {
assumeTrue(SERVER_VERSION.isGreaterThanOrEqualTo("7.0.0"), "This feature added in version 7");
skipTestsOnMac();

String prefix = "channel.";
GlideString pattern = gs(prefix + "*");
Expand Down Expand Up @@ -608,7 +590,6 @@ public void combined_exact_pattern_and_sharded_one_client(MessageReadMethod meth
@Test
public void coexistense_of_sync_and_async_read() {
assumeTrue(SERVER_VERSION.isGreaterThanOrEqualTo("7.0.0"), "This feature added in version 7");
skipTestsOnMac();

String prefix = "channel.";
String pattern = prefix + "*";
Expand Down Expand Up @@ -691,7 +672,6 @@ public void coexistense_of_sync_and_async_read() {
@EnumSource(MessageReadMethod.class)
public void combined_exact_pattern_and_sharded_multi_client(MessageReadMethod method) {
assumeTrue(SERVER_VERSION.isGreaterThanOrEqualTo("7.0.0"), "This feature added in version 7");
skipTestsOnMac();

String prefix = "channel.";
GlideString pattern = gs(prefix + "*");
Expand Down Expand Up @@ -808,7 +788,6 @@ public void combined_exact_pattern_and_sharded_multi_client(MessageReadMethod me
@EnumSource(MessageReadMethod.class)
public void three_publishing_clients_same_name_with_sharded(MessageReadMethod method) {
assumeTrue(SERVER_VERSION.isGreaterThanOrEqualTo("7.0.0"), "This feature added in version 7");
skipTestsOnMac();

GlideString channel = gs(UUID.randomUUID().toString());
var exactMessage = new PubSubMessage(gs(UUID.randomUUID().toString()), channel);
Expand Down Expand Up @@ -889,7 +868,6 @@ public void three_publishing_clients_same_name_with_sharded(MessageReadMethod me
@SneakyThrows
@Test
public void error_cases() {
skipTestsOnMac();
// client isn't configured with subscriptions
var client = createClient(true);
assertThrows(ConfigurationError.class, client::tryGetPubSubMessage);
Expand Down Expand Up @@ -921,10 +899,6 @@ public void error_cases() {
@MethodSource("getTestScenarios")
public void transaction_with_all_types_of_messages(boolean standalone, MessageReadMethod method) {
assumeTrue(SERVER_VERSION.isGreaterThanOrEqualTo("7.0.0"), "This feature added in version 7");
skipTestsOnMac();
assumeTrue(
standalone, // TODO activate tests after fix
"Test doesn't work on cluster due to Cross Slot error, probably a bug in `redis-rs`");

String prefix = "channel";
GlideString pattern = gs(prefix + "*");
Expand Down Expand Up @@ -982,8 +956,6 @@ public void transaction_with_all_types_of_messages(boolean standalone, MessageRe
@SneakyThrows
@ParameterizedTest(name = "standalone = {0}")
@ValueSource(booleans = {true, false})
@Disabled(
"No way of currently testing this, see https://github.com/valkey-io/valkey-glide/issues/1649")
public void pubsub_exact_max_size_message(boolean standalone) {
final GlideString channel = gs(UUID.randomUUID().toString());
final GlideString message = gs("1".repeat(512 * 1024 * 1024)); // 512MB
Expand Down Expand Up @@ -1022,8 +994,6 @@ public void pubsub_exact_max_size_message(boolean standalone) {
@SneakyThrows
@ParameterizedTest(name = "standalone = {0}")
@ValueSource(booleans = {false})
@Disabled(
"No way of currently testing this, see https://github.com/valkey-io/valkey-glide/issues/1649")
public void pubsub_sharded_max_size_message(boolean standalone) {
assumeTrue(SERVER_VERSION.isGreaterThanOrEqualTo("7.0.0"), "This feature added in version 7");

Expand Down Expand Up @@ -1067,8 +1037,6 @@ public void pubsub_sharded_max_size_message(boolean standalone) {
@SneakyThrows
@ParameterizedTest(name = "standalone = {0}")
@ValueSource(booleans = {true, false})
@Disabled(
"No way of currently testing this, see https://github.com/valkey-io/valkey-glide/issues/1649")
public void pubsub_exact_max_size_message_callback(boolean standalone) {
final GlideString channel = gs(UUID.randomUUID().toString());
final GlideString message = gs("1".repeat(512 * 1024 * 1024)); // 512MB
Expand Down Expand Up @@ -1109,8 +1077,6 @@ public void pubsub_exact_max_size_message_callback(boolean standalone) {
@SneakyThrows
@ParameterizedTest(name = "standalone = {0}")
@ValueSource(booleans = {false})
@Disabled(
"No way of currently testing this, see https://github.com/valkey-io/valkey-glide/issues/1649")
public void pubsub_sharded_max_size_message_callback(boolean standalone) {
assumeTrue(SERVER_VERSION.isGreaterThanOrEqualTo("7.0.0"), "This feature added in version 7");

Expand Down

0 comments on commit bead836

Please sign in to comment.