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

Fix compatibility tests #664

Merged
merged 8 commits into from
Feb 9, 2024
Merged
Show file tree
Hide file tree
Changes from 5 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
2 changes: 1 addition & 1 deletion .github/workflows/coverage_runner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '8'
java-version: '17'

- name: Checkout code for PR
if: github.event_name == 'pull_request_target'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/nightly_runner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '8'
java-version: '17'
- name: Checkout to code
uses: actions/checkout@v2
- name: Install dependencies
Expand Down
2 changes: 1 addition & 1 deletion hazelcast/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "5.3.0"
__version__ = "5.4.0"

# Set the default handler to "hazelcast" loggers
# to avoid "No handlers could be found" warnings.
Expand Down
2 changes: 1 addition & 1 deletion start_rc.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import sys
from os.path import isfile

SERVER_VERSION = "5.3.0"
SERVER_VERSION = "5.4.0-SNAPSHOT"
RC_VERSION = "0.8-SNAPSHOT"

RELEASE_REPO = "https://repo1.maven.apache.org/maven2"
Expand Down
6 changes: 5 additions & 1 deletion tests/integration/backward_compatible/predicate_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
write_string_to_writer,
read_string_from_reader,
)
from tests.util import random_string, get_abs_path
from tests.util import random_string, get_abs_path, skip_if_server_version_newer_than_or_equal
from hazelcast import HazelcastClient


Expand Down Expand Up @@ -171,6 +171,8 @@ def test_false(self):
self.assertCountEqual(self.map.key_set(predicate), [])

def test_paging(self):
# https://hazelcast.atlassian.net/browse/API-2187
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Os repo, better if we have issue number in github for community.

skip_if_server_version_newer_than_or_equal(self, self.client, "5.4")
self.fill_map_numeric()
predicate = paging(less("this", 4), 2)
self.assertCountEqual([0, 1], self.map.key_set(predicate))
Expand Down Expand Up @@ -336,6 +338,8 @@ def setUpClass(cls):
cls.cluster.start_member()
cls.cluster.start_member()
cls.client = HazelcastClient(cluster_name=cls.cluster.id)
# https://hazelcast.atlassian.net/browse/API-2187
skip_if_server_version_newer_than_or_equal(cls, cls.client, "5.4")
cls.map = cls.client.get_map(random_string()).blocking()

def setUp(self):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,8 @@ def on_cancel(self) -> None:
# Should be cancelled since on_message raised error
self.assertTrueEventually(lambda: self.assertEqual(0, len(topic._wrapped._runners)))

self.assertEqual(1, on_cancel_call_count.get())
if compare_client_version("5.4") >= 0:
self.assertEqual(1, on_cancel_call_count.get())

def test_add_listener_when_on_message_and_is_terminal_raises_error(self):
topic = self.get_topic(random_string())
Expand Down Expand Up @@ -319,7 +320,8 @@ def on_cancel(self) -> None:
# Should be cancelled since on_message raised error
self.assertTrueEventually(lambda: self.assertEqual(0, len(topic._wrapped._runners)))

self.assertEqual(1, on_cancel_call_count.get())
if compare_client_version("5.4") >= 0:
self.assertEqual(1, on_cancel_call_count.get())

def test_add_listener_with_non_callable(self):
topic = self.get_topic(random_string())
Expand Down Expand Up @@ -352,7 +354,8 @@ def on_cancel(self) -> None:

registration_id = topic.add_listener(Listener())
self.assertTrue(topic.remove_listener(registration_id))
self.assertEqual(1, on_cancel_call_count.get())
if compare_client_version("5.4") >= 0:
self.assertEqual(1, on_cancel_call_count.get())

def test_remove_listener_does_not_receive_messages_after_removal(self):
topic = self.get_topic(random_string())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
compare_server_version_with_rc,
skip_if_client_version_older_than,
skip_if_server_version_older_than,
skip_if_server_version_newer_than_or_equal,
)

try:
Expand Down Expand Up @@ -672,6 +673,8 @@ def test_entry_set_with_predicate(self):
)

def test_entry_set_with_paging_predicate(self):
# https://hazelcast.atlassian.net/browse/API-2187
skip_if_server_version_newer_than_or_equal(self, self.client, "5.4")
self._put_from_another_client(INNER_COMPACT_INSTANCE, OUTER_COMPACT_INSTANCE)
self.assertEqual(
[(INNER_COMPACT_INSTANCE, OUTER_COMPACT_INSTANCE)],
Expand Down Expand Up @@ -751,6 +754,8 @@ def test_key_set_with_predicate(self):
)

def test_key_set_with_paging_predicate(self):
# https://hazelcast.atlassian.net/browse/API-2187
skip_if_server_version_newer_than_or_equal(self, self.client, "5.4")
self._put_from_another_client(OUTER_COMPACT_INSTANCE, INNER_COMPACT_INSTANCE)
self.assertEqual(
[OUTER_COMPACT_INSTANCE],
Expand Down Expand Up @@ -882,6 +887,8 @@ def test_values_with_predicate(self):
self.assertEqual([OUTER_COMPACT_INSTANCE], self.map.values(CompactPredicate()))

def test_values_with_paging_predicate(self):
# https://hazelcast.atlassian.net/browse/API-2187
skip_if_server_version_newer_than_or_equal(self, self.client, "5.4")
self._put_from_another_client(INNER_COMPACT_INSTANCE, OUTER_COMPACT_INSTANCE)
self.assertEqual([OUTER_COMPACT_INSTANCE], self.map.values(paging(CompactPredicate(), 1)))

Expand Down
Loading