Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,21 @@ concurrency:
cancel-in-progress: true

env:
VALKEY_HOSTNAME: valkey
VALKEY_HOSTNAME: database
REDIS_HOSTNAME: database
jobs:
unit-tests:
runs-on: ubuntu-latest
timeout-minutes: 15
strategy:
matrix:
image: ["swift:6.1", "swift:6.2"]
swift: ["swift:6.1", "swift:6.2"]
database: ["valkey/valkey:latest", "redis:latest"]
container:
image: ${{ matrix.image }}
image: ${{ matrix.swift }}
services:
valkey:
image: valkey/valkey:8.0
ports:
- 6379:6379
options: --entrypoint valkey-server
database:
image: ${{ matrix.database }}
steps:
- name: Install jemalloc
run: |
Expand All @@ -34,6 +33,8 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
- name: Test
env:
IS_VALKEY: ${{ matrix.database == 'valkey/valkey:latest' && 'true' || 'false' }}
run: |
swift test --enable-code-coverage
- name: Convert coverage files
Expand Down
7 changes: 4 additions & 3 deletions Tests/IntegrationTests/CommandIntegrationTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import Valkey
@Suite("Command Integration Tests")
struct CommandIntegratedTests {
let valkeyHostname = ProcessInfo.processInfo.environment["VALKEY_HOSTNAME"] ?? "localhost"
static let isValkey = ProcessInfo.processInfo.environment["IS_VALKEY"] == "true"

@available(valkeySwift 1.0, *)
func withKey<Value>(connection: some ValkeyClientProtocol, _ operation: (ValkeyKey) async throws -> Value) async throws -> Value {
Expand Down Expand Up @@ -175,8 +176,8 @@ struct CommandIntegratedTests {
return redis.call("SET", keys[1], args[1])
end

server.register_function('valkey_swift_test_set', test_set)
server.register_function('valkey_swift_test_get', test_get)
redis.register_function('valkey_swift_test_set', test_set)
redis.register_function('valkey_swift_test_get', test_get)
Comment on lines +179 to +180
Copy link
Contributor Author

@zunda-pixel zunda-pixel Nov 14, 2025

Choose a reason for hiding this comment

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

rename to fix testFUNCTIONLIST() for Redis

"""
)
let list = try await client.functionList(libraryNamePattern: "_valkey_swift_tests", withcode: true)
Expand All @@ -193,7 +194,7 @@ struct CommandIntegratedTests {
}

@available(valkeySwift 1.0, *)
@Test
@Test(.enabled(if: Self.isValkey))
Copy link
Contributor Author

@zunda-pixel zunda-pixel Nov 14, 2025

Choose a reason for hiding this comment

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

testSCRIPTfunctions() is enabled for Valkey not Redis
Redis has no SCRIPT SHOW

func testSCRIPTfunctions() async throws {
var logger = Logger(label: "Valkey")
logger.logLevel = .trace
Expand Down
Loading