Skip to content

New Container: TestContainer for Valkey #936

Closed

Description

@daric93

What is the new container you'd like to have?

I’d like to add Valkey, the open-source fork of Redis, as a dedicated Testcontainers module.

Why not just use a generic container for this?

  • Valkey adoption is growing as an alternative to Redis to avoid licensing constraints, so reliable test coverage with real Valkey instances is important.
  • Valkey‑Search enables advanced features like vector search and hybrid queries with tags/filters—common in GenAI workloads. Having a container with correct modules ensures realistic integration tests.
  • Valkey GLIDE provides multi-language clients (Python/Java/Node/Go) with async support and best practices; a ValkeyContainer would align with this ecosystem for integration testing.
  • Parity with existing Testcontainers DB modules: Similar to RedisContainer, a dedicated ValkeyContainer simplifies setup (config, wait strategy, connection helpers) beyond what a generic container can offer.

Activity

  1. daric93 commented on Dec 8, 2025

    @daric93
    ContributorAuthor

    I’ll start working on this issue and plan to submit a PR soon.

  2. alexanderankin commented on Dec 8, 2025

    @alexanderankin
    Member

    aren't they drop in compatible? or is that no longer the case, like different log messages? another reason i initially dont want to accept is that redis went back to agpl (although it seems very confusing so i can see that being a weak driver of adoption for valkey still)

  3. alexanderankin commented on Dec 8, 2025

    @alexanderankin
    Member

    glide also supports redis, the search module is interesting and would be the only reason i dont have a response for, if in fact a separate module is needed (e.g. to listen for different log messages)

  4. daric93 commented on Dec 8, 2025

    @daric93
    ContributorAuthor

    You’re right—Valkey is largely drop-in compatible with Redis for core commands, and GLIDE supports both. For most basic use cases, a generic container or even RedisContainer works fine.

    The main reasons for proposing a dedicated module are:

    • Valkey-Search (vector search, hybrid queries) is unique to Valkey and increasingly used in GenAI workloads. Tests that rely on these features need a container with the module preloaded.
    • Parity and simplicity: Similar to RedisContainer, a ValkeyContainer provides API for developers adopting Valkey without manual tweaks.
  5. jbrinkman commented on Dec 11, 2025

    @jbrinkman

    While Valkey is largely drop in compatible for older versions of Redis, the latest Valkey versions include some features that are not supported in Redis like Multi-db support for cluster configurations. Additionally, there are small differences in some commands. Also, the various modules can have significant differences especially in Valkey-Search and Valkey-JSON modules. Effective testing requires testing against the actual db you will use in production and not something that is "close".

  6. alexanderankin commented on Dec 11, 2025

    @alexanderankin
    Member

    drop in support in this context means you can change the redis container image argument and it works

  7. jbrinkman commented on Feb 16, 2026

    @jbrinkman

    drop in support in this context means you can change the redis container image argument and it works

    While we can change the container image, we can't easily change the internal client being used. The best we can do is tell users to avoid the use of the get_client method and instead create a client using their client library. We are trying to create a first class experience for Valkey users, and right now they have to jump through extra hoops to use python TestContainers with Valkey. These same restrictions do not exist for Go, Java, Node or Rust languages which all have a Valkey module.

  8. Tranquility2 commented on Apr 3, 2026

    @Tranquility2
    Contributor

    @jbrinkman @daric93 the motivation is clear :) can you please recheck the PR it still has some gaps.

  9. linked a pull request that will close this issuefeat(valkey): add Valkey module #947on Apr 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions