Skip to content

Commit eeb820c

Browse files
authored
speed up local build time by 97% (#82)
* skip the exhaustive `generateBucketValueDistribution` when we're not testing on Travis builds * Check for ENV variable set to true by default by travis. * use exhaustive test for gradles
1 parent dbb352f commit eeb820c

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ jdk:
66
install: true
77
script:
88
- "./gradlew clean"
9+
- "./gradlew exhaustiveTest"
910
- "if [[ -n $TRAVIS_TAG ]]; then
1011
./gradlew ship;
1112
else

core-api/src/test/java/com/optimizely/ab/bucketing/BucketerTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,16 @@
1616
*/
1717
package com.optimizely.ab.bucketing;
1818

19+
import ch.qos.logback.classic.Level;
1920
import com.optimizely.ab.bucketing.internal.MurmurHash3;
2021
import com.optimizely.ab.categories.ExhaustiveTest;
2122
import com.optimizely.ab.config.Experiment;
2223
import com.optimizely.ab.config.ProjectConfig;
2324
import com.optimizely.ab.config.TrafficAllocation;
2425
import com.optimizely.ab.config.Variation;
2526
import com.optimizely.ab.internal.LogbackVerifier;
26-
27+
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
28+
import org.junit.Assume;
2729
import org.junit.Rule;
2830
import org.junit.Test;
2931
import org.junit.experimental.categories.Category;
@@ -36,9 +38,6 @@
3638
import java.util.Map;
3739
import java.util.concurrent.atomic.AtomicInteger;
3840

39-
import ch.qos.logback.classic.Level;
40-
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
41-
4241
import static com.optimizely.ab.config.ProjectConfigTestUtils.validProjectConfigV2;
4342
import static org.hamcrest.CoreMatchers.is;
4443
import static org.hamcrest.MatcherAssert.assertThat;
@@ -79,6 +78,7 @@ public void generateBucketValueForNegativeHashCodes() throws Exception {
7978
@Test
8079
@Category(ExhaustiveTest.class)
8180
public void generateBucketValueDistribution() throws Exception {
81+
Assume.assumeTrue(Boolean.valueOf(System.getenv("CI")));
8282
long lowerHalfCount = 0;
8383
long totalCount = 0;
8484
int outOfRangeCount = 0;

0 commit comments

Comments
 (0)