Skip to content

Commit

Permalink
Some fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
barshaul committed Jun 29, 2024
1 parent c6bb6d2 commit ad0b76d
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 26 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/install-shared-dependencies/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ runs:
apk update
wget -O - https://sh.rustup.rs | sh -s -- -y
source "$HOME/.cargo/env"
apk add protobuf-dev musl-dev make gcc envsubst
apk add protobuf-dev musl-dev make gcc envsubst openssl
- name: Install software dependencies for Amazon-Linux
shell: bash
Expand Down
49 changes: 26 additions & 23 deletions java/integTest/src/test/java/glide/SharedCommandTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,30 @@
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.junit.jupiter.api.Assumptions.assumeTrue;
import static org.mockito.Mockito.timeout;

import java.time.Instant;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.UUID;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;

import org.apache.commons.lang3.ArrayUtils;
import org.apache.commons.lang3.tuple.Pair;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.Timeout;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;

import glide.api.BaseClient;
import glide.api.RedisClient;
Expand Down Expand Up @@ -90,29 +114,8 @@
import glide.api.models.configuration.RedisClientConfiguration;
import glide.api.models.configuration.RedisClusterClientConfiguration;
import glide.api.models.exceptions.RequestException;
import java.time.Instant;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.UUID;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
import lombok.Getter;
import lombok.SneakyThrows;
import org.apache.commons.lang3.ArrayUtils;
import org.apache.commons.lang3.tuple.Pair;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.Timeout;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;

@Timeout(10) // seconds
public class SharedCommandTests {
Expand Down Expand Up @@ -5172,10 +5175,10 @@ public void objectEncoding_binary_returns_string_embstr(BaseClient client) {
public void objectEncoding_returns_list_listpack(BaseClient client) {
String listListpackKey = UUID.randomUUID().toString();
assertEquals(1, client.lpush(listListpackKey, new String[] {"1"}).get());
// API documentation states that a ziplist should be returned for Redis versions <= 6.2, but
// API documentation states that a ziplist should be returned for Redis versions < 7.2, but
// actual behavior returns a quicklist.
assertEquals(
REDIS_VERSION.isLowerThan("7.0.0") ? "quicklist" : "listpack",
REDIS_VERSION.isLowerThan("7.2.0") ? "quicklist" : "listpack",
client.objectEncoding(listListpackKey).get());
}

Expand Down
2 changes: 1 addition & 1 deletion node/tests/SharedTests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3158,7 +3158,7 @@ export function runBaseTests<Context>(config: {

expect(await client.lpush(list_key, ["1"])).toEqual(1);

if (versionLessThan7) {
if (versionLessThan72) {
checkSimple(await client.objectEncoding(list_key)).toEqual(
"quicklist",
);
Expand Down
2 changes: 1 addition & 1 deletion python/python/tests/test_async_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -6547,7 +6547,7 @@ async def test_object_encoding(self, redis_client: TGlideClient):
assert await redis_client.object_encoding(string_key) == "embstr"

assert await redis_client.lpush(list_key, ["1"]) == 1
if await check_if_server_version_lt(redis_client, "7.0.0"):
if await check_if_server_version_lt(redis_client, "7.2.0"):
assert await redis_client.object_encoding(list_key) == "quicklist"
else:
assert await redis_client.object_encoding(list_key) == "listpack"
Expand Down

0 comments on commit ad0b76d

Please sign in to comment.