-
Notifications
You must be signed in to change notification settings - Fork 905
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add support for Lettuce 6 * Finish * Remove unnecessary null check
- Loading branch information
Anuraag Agrawal
authored
Mar 18, 2021
1 parent
6ea1e8d
commit 2fd933b
Showing
8 changed files
with
162 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
...ting/src/main/groovy/io/opentelemetry/instrumentation/lettuce/v5_1/LettuceTestUtil.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* | ||
* Copyright The OpenTelemetry Authors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package io.opentelemetry.instrumentation.lettuce.v5_1 | ||
|
||
import groovy.transform.PackageScope | ||
import io.lettuce.core.ClientOptions | ||
|
||
@PackageScope | ||
final class LettuceTestUtil { | ||
|
||
static final ClientOptions CLIENT_OPTIONS | ||
|
||
static { | ||
def options = ClientOptions.builder() | ||
// Disable autoreconnect so we do not get stray traces popping up on server shutdown | ||
.autoReconnect(false) | ||
if (Boolean.getBoolean("testLatestDeps")) { | ||
// Force RESP2 on 6+ for consistency in tests | ||
options | ||
.pingBeforeActivateConnection(false) | ||
.protocolVersion(Class.forName("io.lettuce.core.protocol.ProtocolVersion").getField("RESP2").get(null)) | ||
} | ||
CLIENT_OPTIONS = options.build() | ||
} | ||
|
||
private LettuceTestUtil() {} | ||
} |