File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change 3333 - name : Checkout
3434 uses : actions/checkout@v4
3535 - name : Test
36- env :
37- IS_VALKEY : ${{ matrix.database == 'valkey/valkey:latest' && 'true' || 'false' }}
3836 run : |
3937 swift test --enable-code-coverage
4038 - name : Convert coverage files
Original file line number Diff line number Diff line change @@ -16,7 +16,6 @@ import Valkey
1616@Suite ( " Command Integration Tests " )
1717struct CommandIntegratedTests {
1818 let valkeyHostname = ProcessInfo . processInfo. environment [ " VALKEY_HOSTNAME " ] ?? " localhost "
19- static let isValkey = ProcessInfo . processInfo. environment [ " IS_VALKEY " ] == " true "
2019
2120 @available ( valkeySwift 1 . 0 , * )
2221 func withKey< Value> ( connection: some ValkeyClientProtocol , _ operation: ( ValkeyKey ) async throws -> Value ) async throws -> Value {
@@ -194,11 +193,20 @@ struct CommandIntegratedTests {
194193 }
195194
196195 @available ( valkeySwift 1 . 0 , * )
197- @Test ( . enabled ( if : Self . isValkey ) )
196+ @Test
198197 func testSCRIPTfunctions( ) async throws {
199198 var logger = Logger ( label: " Valkey " )
200199 logger. logLevel = . trace
201200 try await withValkeyClient ( . hostname( valkeyHostname, port: 6379 ) , logger: logger) { client in
201+ let helloResponse = try await client. hello ( )
202+ let serverNameValue = try #require( helloResponse. first { $0. key. value == . bulkString( ByteBuffer ( string: " server " ) ) } ? . value. value)
203+ let serverName : String ? = if case . bulkString( let nameBuffer) = serverNameValue {
204+ String ( buffer: nameBuffer)
205+ } else {
206+ nil
207+ }
208+ guard serverName == " valkey " else { return }
209+
202210 let sha1 = try await client. scriptLoad (
203211 script: " return redis.call( \" GET \" , KEYS[1]) "
204212 )
You can’t perform that action at this time.
0 commit comments