Skip to content

Commit eaeedc1

Browse files
committed
Ignoring e2e tests for validate building and installing pipeline actions - second try + some test helpers improvements
1 parent 209fe7e commit eaeedc1

File tree

6 files changed

+24
-13
lines changed

6 files changed

+24
-13
lines changed

.github/workflows/install_and_test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ cd ${TESTDIR}
4040
# install, run tests
4141
pip install ${PKG}
4242
# Redis tests
43-
pytest -m 'not onlycluster'
43+
pytest -m 'not onlycluster' --ignore=tests/test_scenario
4444
# RedisCluster tests
4545
CLUSTER_URL="redis://localhost:16379/0"
4646
CLUSTER_SSL_URL="rediss://localhost:27379/0"

redis/_parsers/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ def parse_moving_msg(response):
191191
# Expected message format is: MOVING <seq_number> <time> <endpoint>
192192
id = response[1]
193193
ttl = response[2]
194-
if response[3] in [b"null", "null"]:
194+
if response[3] is None:
195195
host, port = None, None
196196
else:
197197
value = response[3]

tests/test_maintenance_events_handling.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -236,9 +236,7 @@ def send(self, data):
236236
# MOVING push message before SET key_receive_moving_none_X response
237237
# Format: >4\r\n$6\r\nMOVING\r\n:1\r\n:1\r\n+null\r\n (4 elements: MOVING, id, ttl, null)
238238
# Note: Using + instead of $ to send as simple string instead of bulk string
239-
moving_push = (
240-
f">4\r\n$6\r\nMOVING\r\n:1\r\n:{MOVING_TIMEOUT}\r\n+null\r\n"
241-
)
239+
moving_push = f">4\r\n$6\r\nMOVING\r\n:1\r\n:{MOVING_TIMEOUT}\r\n_\r\n"
242240
response = moving_push.encode() + response
243241
elif b"key_receive_moving_" in data:
244242
# MOVING push message before SET key_receive_moving_X response

tests/test_scenario/conftest.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,13 @@
1414
RELAX_TIMEOUT = 30
1515
CLIENT_TIMEOUT = 5
1616

17+
DEFAULT_ENDPOINT_NAME = "m-standard"
18+
1719

1820
@pytest.fixture()
1921
def endpoint_name(request):
2022
return request.config.getoption("--endpoint-name") or os.getenv(
21-
"REDIS_ENDPOINT_NAME", "m-standard"
23+
"REDIS_ENDPOINT_NAME", DEFAULT_ENDPOINT_NAME
2224
)
2325

2426

@@ -75,6 +77,8 @@ def _get_client_maint_events(
7577
host = parsed.hostname
7678
port = parsed.port
7779

80+
tls_enabled = True if parsed.scheme == "rediss" else False
81+
7882
if not host:
7983
raise ValueError(f"Could not parse host from endpoint URL: {endpoints[0]}")
8084

@@ -101,6 +105,9 @@ def _get_client_maint_events(
101105
socket_timeout=CLIENT_TIMEOUT if socket_timeout is None else socket_timeout,
102106
username=username,
103107
password=password,
108+
ssl=tls_enabled,
109+
ssl_cert_reqs="none",
110+
ssl_check_hostname=False,
104111
protocol=3, # RESP3 required for push notifications
105112
maintenance_events_config=maintenance_config,
106113
retry=retry,

tests/test_scenario/hitless_upgrade_helpers.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,7 @@ def find_target_node_and_empty_node(
220220
def find_endpoint_for_bind(
221221
fault_injector: FaultInjectorClient,
222222
endpoint_config: Dict[str, Any],
223+
endpoint_name: str,
223224
timeout: int = 60,
224225
) -> str:
225226
"""Find the endpoint ID from cluster status.
@@ -252,13 +253,13 @@ def find_endpoint_for_bind(
252253
elif endpoints_section_started and line and not line.startswith("DB:ID"):
253254
# Parse endpoint line: db:1 m-standard endpoint:1:1 node:2 single No
254255
parts = line.split()
255-
if len(parts) >= 3:
256+
if len(parts) >= 3 and parts[1] == endpoint_name:
256257
endpoint_full = parts[2] # endpoint:1:1
257258
if endpoint_full.startswith("endpoint:"):
258259
endpoint_id = endpoint_full.replace("endpoint:", "") # 1:1
259260
return endpoint_id
260261

261-
raise ValueError("No endpoint ID found in cluster status")
262+
raise ValueError(f"No endpoint ID for {endpoint_name} found in cluster status")
262263

263264
@staticmethod
264265
def execute_rladmin_migrate(

tests/test_scenario/test_hitless_upgrade.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ def setup_and_cleanup(
4848
client_maint_events: Redis,
4949
fault_injector_client: FaultInjectorClient,
5050
endpoints_config: Dict[str, Any],
51+
endpoint_name: str,
5152
):
5253
# Initialize cleanup flags first to ensure they exist even if setup fails
5354
self._migration_executed = False
@@ -70,7 +71,7 @@ def setup_and_cleanup(
7071

7172
try:
7273
self.endpoint_id = ClusterOperations.find_endpoint_for_bind(
73-
fault_injector_client, endpoints_config
74+
fault_injector_client, endpoints_config, endpoint_name
7475
)
7576
logging.info(f"Using endpoint: {self.endpoint_id}")
7677
except Exception as e:
@@ -396,7 +397,9 @@ def test_timeout_handling_during_migrating_and_moving(
396397
397398
"""
398399
logging.info(f"Testing timeout handling for endpoint type: {endpoint_type}")
399-
client = _get_client_maint_events(endpoints_config, endpoint_type)
400+
client = _get_client_maint_events(
401+
endpoints_config=endpoints_config, endpoint_type=endpoint_type
402+
)
400403

401404
# Create three connections in the pool
402405
logging.info("Creating three connections in the pool.")
@@ -501,7 +504,9 @@ def test_new_connection_handling_during_migrating_and_moving(
501504
endpoints_config: Dict[str, Any],
502505
):
503506
logging.info(f"Testing timeout handling for endpoint type: {endpoint_type}")
504-
client = _get_client_maint_events(endpoints_config, endpoint_type)
507+
client = _get_client_maint_events(
508+
endpoints_config=endpoints_config, endpoint_type=endpoint_type
509+
)
505510

506511
logging.info("Creating one connection in the pool.")
507512
first_conn = client.connection_pool.get_connection()
@@ -614,7 +619,7 @@ def test_disabled_handling_during_migrating_and_moving(
614619
):
615620
logging.info("Creating client with disabled notifications.")
616621
client = _get_client_maint_events(
617-
endpoints_config,
622+
endpoints_config=endpoints_config,
618623
enable_maintenance_events=False,
619624
)
620625

@@ -741,7 +746,7 @@ def test_command_execution_during_migrating_and_moving(
741746
socket_timeout = 0.5
742747

743748
client = _get_client_maint_events(
744-
endpoints_config,
749+
endpoints_config=endpoints_config,
745750
endpoint_type=endpoint_type,
746751
disable_retries=True,
747752
socket_timeout=socket_timeout,

0 commit comments

Comments
 (0)