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

Introduces test matrix based on Redis versions [8.0-M1, 7.4.1, 7.2.6, 6.2.16] #4015

Merged
merged 81 commits into from
Jan 14, 2025

Conversation

ggivo
Copy link
Contributor

@ggivo ggivo commented Nov 10, 2024

We use docker composer to bring up the test env using redislabs/client-libs-test image.

Example command to bring up test env for dev/test

  • Redis 8.0-M01
      export REDIS_VERSION=8.0-M01
      docker compose --env-file src/test/resources/env/.env -f src/test/resources/env/docker-compose.yml up
  • Redis 7.4.1
      export REDIS_VERSION=7.4.1
      docker compose --env-file src/test/resources/env/.env -f src/test/resources/env/docker-compose.yml up
  • Redis 7.2.6
      export REDIS_VERSION=7.2.6
      docker compose --env-file src/test/resources/env/.env -f src/test/resources/env/docker-compose.yml up
  • Redis 6.2.16
    - NOTE : 6.2.16 uses a dedicated .env.v6.12.16 file, since some of the redis configuration settings are not supported in 6.2.16
    docker compose --env-file src/test/resources/env/.env.v6.12.16 -f src/test/resources/env/docker-compose.yml up

Introduces test matrix based on Redis versions [8.0-M1, 7.4.1, 7.2.6, 6.2.16]

When run against older Redis version it appears that some tests are using commands available only in newer Redis server versions. To resolve this we are introducing two new annotations/rules

  • Introduce SinceRedisVersion annotation/Rule - for conditionally running tests based on Redis server version contacted
  • Introduce EnableOnCommad annotation/Rule - for conditionally running tests based on command availability on the server

And mark respective tests with the least Redis Version required by the test

  • SinceRedisVersion ("7.4.0") - Mark tests using commands/modifiers introduced with Redis 7.4.0
  • SinceRedisVersion ("7.2.0") - Mark tests using commands/modifiers introduced with Redis 7.2.0
  • SinceRedisVersion ("7.0.0") - Mark tests using commands/modifiers introduced with Redis 7.0.0

The same approach used to mark CSC tests

  • Disabled client-side caching tests for versions below 7.4

Fix in Jedis Client (Redis 6.x)

Fixed Test failures against 6.x

  • Fix JedisPooledClientSideCacheTest
  • Fix AccessControlListCommandsTest.aclLogTest:372 » NullPointer
  • Fix AccessControlListCommandsTest.aclLogWithEntryID:473 » NullPointer
  • Fix StreamsCommandsTest
  • Fix StreamsPipelineCommandsTest xadd - Starting with Redis version 7.0.0: Added support for the -* explicit ID form.

- Test env migrated to use native Redis server TLS instead of using stunnel

  • There are still Cluster SSL tests failing against 6.2.16 env. see Revisit TLS Cluster tests to drop stunnel #4018
    The primary reason for those failures is the Redis server 6.2.16 is returning the non-TLS port in the CLUSTER SLOTS command in contrast to Redis Server 7.2.0+. I suggest reviewing & addressing Cluster SSL related test failures with follow-up PR.

Ignored tests during migration

  • Disabled ModuleTest in containerized test env.
    ModuleTest uses a custom test module to test load/unload/sendCommand. Requires pre-build test module on the same os like test container to avoid errors

  • Disable UDS tests in containerized test env
    No easy way to make unix sockets work on MAC with docker

Closes #4016, Closes #4017

@ggivo ggivo self-assigned this Nov 10, 2024
@ggivo ggivo force-pushed the migrate_to_clients_test_image branch 2 times, most recently from 68c372a to 0aa9343 Compare November 10, 2024 19:30
@ggivo ggivo marked this pull request as ready for review November 11, 2024 06:03
@ggivo ggivo force-pushed the migrate_to_clients_test_image branch from 77f7e4e to a691416 Compare November 11, 2024 08:36
@tishun
Copy link

tishun commented Nov 13, 2024

LGTM, the code looks much neater this way!

@ggivo ggivo force-pushed the migrate_to_clients_test_image branch 2 times, most recently from 5066271 to 1698b76 Compare November 19, 2024 18:40
@ggivo ggivo requested review from sazzad16 and atakavci November 19, 2024 19:48
atakavci
atakavci previously approved these changes Nov 21, 2024
Copy link
Contributor

@atakavci atakavci left a comment

Choose a reason for hiding this comment

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

this is hard work and i appreciate how we improve it.
i left a couple of comments and questions but none of them is a big deal TBH,
it looks pretty good to me.
one thing to note; we need to find our way through smaller PRs, at least for those not containing public API changes.

.github/CONTRIBUTING.md Outdated Show resolved Hide resolved
.github/workflows/test-on-docker.yml Outdated Show resolved Hide resolved
.github/workflows/test-on-docker.yml Show resolved Hide resolved
Makefile Show resolved Hide resolved
src/test/java/io/redis/test/utils/RedisVersionRule.java Outdated Show resolved Hide resolved
@ggivo ggivo force-pushed the migrate_to_clients_test_image branch from b5e04e4 to 6c58815 Compare November 25, 2024 12:42
sazzad16 and others added 19 commits January 8, 2025 22:31
"This uses , which is defined in  and trusts any certificate."
By mistake isEqualWithTolerance was using latitude instead of tolerance hiding  that mistakenly DEFAULT_TOLERANCE was changed from 1e-5 to 1e-14
Use .sslVerifyMode(SslVerifyMode.CA) to mimic tested behaviour of SSLJedisClusterTest.testSSLWithoutPortMap()

Fix actions/upload-artifact@v3 deprecation
Since we have removed the stunnel and using Redis server native TLS supporttest is failing on 6.2.x branch because CLUSTER SLOTS command is returning non-tls port when using (Redis 6.2.x).

Test is passing successfully against 7.x+ Redis instances.Considering previously nightly build was run only against latest Redis server (e.g 7.x+) it should be safe to mark this test with @SinceRedisVersion(value = "7.0.0")
"certificateLocation" point to root folder were certificates used by the server are stored for given endpoint.

Expected following set of certificates
redis.crt - RedisServer certificate
client.crt - Can be used by the client for mutual auth with the server
ca.crt - Root certificate for both (redis.crt & client.crt)

Replace hardcoded certificateLocation with one resol ved from EndpiintConfig were possible. e.g. Cluster tests are not yet migrated to EndpointConfig infra and still use hardcoded certificates.
SearchWithParamsTest.searchTextFieldsCondition:276 » JedisData Use `INDEXEMPTY` in field creation in order to index and query for empty strings
@sazzad16 sazzad16 force-pushed the migrate_to_clients_test_image branch from ae60523 to 174b933 Compare January 14, 2025 11:36
@sazzad16 sazzad16 merged commit f9977e4 into redis:master Jan 14, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
4 participants