mirror of
https://github.com/swift-server/RediStack.git
synced 2026-05-03 07:32:28 +00:00
a09c434612
Motivation: After working with RedisKit with RediStackTestUtils as a dependency, it was realized how opinionated the module is in how RedisConnections can be created in test environments. Modifications: Require more information, with reasonable defaults for `RedisConnection.init()`. Provide subclass hooks for `RedisIntegrationTestCase` for implementors to make decisions for themselves at how to connect to Redis. Result: Users should have more freedom in how they connect to Redis in their units tests.
26 lines
842 B
Swift
26 lines
842 B
Swift
//===----------------------------------------------------------------------===//
|
|
//
|
|
// This source file is part of the RediStack open source project
|
|
//
|
|
// Copyright (c) 2019 RediStack project authors
|
|
// Licensed under Apache License v2.0
|
|
//
|
|
// See LICENSE.txt for license information
|
|
// See CONTRIBUTORS.txt for the list of RediStack project authors
|
|
//
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
import class Foundation.ProcessInfo
|
|
import RediStackTestUtils
|
|
|
|
class RediStackIntegrationTestCase: RedisIntegrationTestCase {
|
|
override var redisHostname: String {
|
|
return ProcessInfo.processInfo.environment["REDIS_URL"] ?? "localhost"
|
|
}
|
|
override var redisPassword: String? {
|
|
return ProcessInfo.processInfo.environment["REDIS_PW"]
|
|
}
|
|
}
|