Testing with xUnit.net

Valkey

qianmoQqianmoQ· 更新于 2026-10-19· 阅读 2 分钟· 0 次阅读

登录后可跨设备保存划线和私人笔记登录

Valkey

Valkey is an open-source, Redis-compatible in-memory data store.

The Testcontainers Redis module is compatible with the Valkey container image. You can use the existing Testcontainers.Redis package without requiring a separate Valkey module.

Note

If Valkey introduces features or configuration options that require dedicated support in the future, we can introduce a separate module at that time.

Usage

Add the Redis module:

NuGet

1
dotnet add package Testcontainers.Redis

Start a Valkey container using the Redis builder:

1
2
var valkeyContainer = new RedisBuilder("valkey/valkey:9.0-alpine").Build();
await valkeyContainer.StartAsync();

Tip

For the complete source code of this example and additional information, please refer to our test projects.

评论

登录后参与评论

正在加载评论…