Skip to content
This repository was archived by the owner on May 30, 2024. It is now read-only.

Commit 2e2e50b

Browse files
committed
skip Redis tests in release
1 parent 56ad169 commit 2e2e50b

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

.ldrelease/config.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ publications:
88

99
template:
1010
name: gradle
11+
env:
12+
LD_SKIP_DATABASE_TESTS: 1
1113

1214
documentation:
1315
githubPages: true

CONTRIBUTING.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,5 @@ To build the SDK and run all unit tests:
4040
```
4141
./gradlew test
4242
```
43+
44+
By default, the full unit test suite includes live tests of the Redis integration. Those tests expect you to have Redis running locally. To skip them, set the environment variable `LD_SKIP_DATABASE_TESTS=1` before running the tests.

src/test/java/com/launchdarkly/client/RedisFeatureStoreTest.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,13 @@
22

33
import com.launchdarkly.client.RedisFeatureStore.UpdateListener;
44

5+
import org.junit.Assume;
6+
import org.junit.BeforeClass;
7+
58
import java.net.URI;
69

10+
import static org.junit.Assume.assumeTrue;
11+
712
import redis.clients.jedis.Jedis;
813

914
public class RedisFeatureStoreTest extends FeatureStoreDatabaseTestBase<RedisFeatureStore> {
@@ -14,6 +19,12 @@ public RedisFeatureStoreTest(boolean cached) {
1419
super(cached);
1520
}
1621

22+
@BeforeClass
23+
public static void maybeSkipDatabaseTests() {
24+
String skipParam = System.getenv("LD_SKIP_DATABASE_TESTS");
25+
assumeTrue(skipParam == null || skipParam.equals(""));
26+
}
27+
1728
@Override
1829
protected RedisFeatureStore makeStore() {
1930
RedisFeatureStoreBuilder builder = new RedisFeatureStoreBuilder(REDIS_URI);

0 commit comments

Comments
 (0)