Skip to content

Commit

Permalink
Publish deephaven-server-test-utils jar (#5467)
Browse files Browse the repository at this point in the history
Ultimately, this PR makes the `server-test-utils` jar public so external integrators can write unit tests against it. As part of this effort, all transitive dependencies of `server-test-utils` need to be made public as well. test-configs was elevated to a public jar, and in other cases, "test library code" was extracted from "test code" (in these cases, we already had appropriate public testing jars the code could be moved to).

Fixes #5341
  • Loading branch information
devinrsmith authored and stanbrub committed May 17, 2024
1 parent b3d1d61 commit 25d097a
Show file tree
Hide file tree
Showing 52 changed files with 96 additions and 120 deletions.
3 changes: 1 addition & 2 deletions BenchmarkSupport/BenchmarkSupport.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ dependencies {
implementation project(':Configuration')
implementation 'org.openjdk.jmh:jmh-core:1.20'

testImplementation TestTools.projectDependency(project, 'Util')
testImplementation TestTools.projectDependency(project, 'engine-table')
testImplementation project(':engine-test-utils')

testRuntimeOnly project(path: ':configs')
testRuntimeOnly project(path: ':test-configs')
Expand Down
3 changes: 2 additions & 1 deletion Integrations/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ dependencies {
implementation project(':log-factory')

testImplementation project(':engine-test-utils')
testImplementation TestTools.projectDependency(project, 'engine-time')

// Needed for CalendarInit
testRuntimeOnly TestTools.projectDependency(project, 'engine-time')
testRuntimeOnly project(':log-to-slf4j')
// add configs, and some runtime dependencies to test classpaths
testRuntimeOnly project(':configs')
Expand Down
6 changes: 3 additions & 3 deletions ModelFarm/ModelFarm.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ dependencies {

runtimeOnly project(':configs')

testImplementation TestTools.projectDependency(project, 'engine-table')
testImplementation project(':engine-test-utils')
testRuntimeOnly project(':Numerics')

testRuntimeOnly project(':log-to-slf4j')
testRuntimeOnly project(path: ':configs')
testRuntimeOnly project(path: ':test-configs')
testRuntimeOnly project(':configs')
testRuntimeOnly project(':test-configs')
Classpaths.inheritSlf4j(project, 'slf4j-simple', 'testRuntimeOnly')
}
7 changes: 3 additions & 4 deletions Plot/Plot.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,11 @@ dependencies {

Classpaths.inheritGuava(project)

testImplementation TestTools.projectDependency(project, 'Util')
testImplementation TestTools.projectDependency(project, 'engine-table')
testImplementation project(':engine-test-utils')
testImplementation TestTools.projectDependency(project, 'engine-time')

testRuntimeOnly project(path: ':configs')
testRuntimeOnly project(path: ':test-configs')
testRuntimeOnly project(':configs')
testRuntimeOnly project(':test-configs')
testRuntimeOnly project(':Numerics')

testRuntimeOnly project(':log-to-slf4j')
Expand Down
4 changes: 2 additions & 2 deletions base-test-utils/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ dependencies {

api 'io.deephaven:hash:0.1.0'

Classpaths.inheritJUnitClassic(project, 'implementation')
Classpaths.inheritJMock(project, 'implementation')
Classpaths.inheritJUnitClassic(project, 'api')
Classpaths.inheritJMock(project, 'api')
}
8 changes: 7 additions & 1 deletion engine/api/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,13 @@ dependencies {

compileOnly 'com.google.code.findbugs:jsr305:3.0.2'

testImplementation TestTools.projectDependency(project, 'engine-table')
testImplementation project(':engine-test-utils')
testImplementation depCommonsLang3

Classpaths.inheritJUnitClassic(project, 'testImplementation')

testRuntimeOnly project(':log-to-slf4j')
testRuntimeOnly project(':configs')
testRuntimeOnly project(':test-configs')
Classpaths.inheritSlf4j(project, 'slf4j-simple', 'testRuntimeOnly')
}
1 change: 0 additions & 1 deletion engine/context/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ dependencies {
Classpaths.inheritCommonsText(project, 'implementation')
Classpaths.inheritImmutables(project)

testImplementation TestTools.projectDependency(project, 'Base')
testImplementation project(':engine-test-utils')

testRuntimeOnly project(':log-to-slf4j'),
Expand Down
2 changes: 1 addition & 1 deletion engine/function/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ dependencies {
implementation project(':Base')
implementation depCommonsLang3

testImplementation TestTools.projectDependency(project, 'Base')
testImplementation project(':base-test-utils')
}

def generatedFiles = []
Expand Down
8 changes: 3 additions & 5 deletions engine/table/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,9 @@ dependencies {

Classpaths.inheritGuava(project)

testImplementation TestTools.projectDependency(project, 'Util')
testImplementation TestTools.projectDependency(project, 'engine-chunk')
testImplementation TestTools.projectDependency(project, 'engine-vector')
testImplementation TestTools.projectDependency(project, 'Numerics')
testImplementation TestTools.projectDependency(project, 'engine-context')
testImplementation TestTools.projectDependency(project, 'engine-time')
testImplementation project(':base-test-utils')
testImplementation project(':engine-rowset-test-utils')
Expand All @@ -76,9 +74,9 @@ dependencies {
Classpaths.inheritJUnitPlatform(project)
Classpaths.inheritAssertJ(project)

testRuntimeOnly project(':log-to-slf4j'),
project(path: ':configs'),
project(path: ':test-configs')
testRuntimeOnly project(':log-to-slf4j')
testRuntimeOnly project(':configs')
testRuntimeOnly project(':test-configs')
Classpaths.inheritSlf4j(project, 'slf4j-simple', 'testRuntimeOnly')
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import org.junit.Rule;
import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.opentest4j.AssertionFailedError;
import junit.framework.AssertionFailedError;

import java.lang.reflect.Array;
import java.time.Instant;
Expand Down Expand Up @@ -504,7 +504,7 @@ private static void joinAndVerify(
assertThat(actualRangeSize).isEqualTo(expectedRangeSize);
}
} catch (AssertionFailedError e) {
throw new AssertionFailedError(String.format("Failure for type %s at row position %s",
throw new AssertionError(String.format("Failure for type %s at row position %s",
type, rowPosition), e);
}
++rowPosition;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
import static io.deephaven.engine.testutil.TstUtils.*;
import static io.deephaven.engine.util.TableTools.intCol;
import static io.deephaven.engine.util.TableTools.stringCol;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.assertEquals;

public class TestAddOnlyToBlinkTableAdapter {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,11 @@
import io.deephaven.engine.table.impl.QueryCompilerRequestProcessor;
import io.deephaven.engine.table.impl.lang.QueryLanguageParser.QueryLanguageParseException;
import io.deephaven.engine.testutil.ControlledUpdateGraph;
import io.deephaven.engine.util.PropertySaver;
import io.deephaven.engine.util.PyCallableWrapper;
import io.deephaven.time.TimeLiteralReplacedExpression;
import io.deephaven.util.QueryConstants;
import io.deephaven.util.SafeCloseable;
import io.deephaven.util.type.TypeUtils;
import io.deephaven.utils.test.PropertySaver;
import io.deephaven.vector.Vector;
import io.deephaven.vector.*;
import org.apache.commons.lang3.exception.ExceptionUtils;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
import static io.deephaven.util.QueryConstants.*;
import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.fail;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.Assert.assertThrows;

@Category(OutOfBandTest.class)
public class TestEmMinMax extends BaseUpdateByTest {
Expand Down Expand Up @@ -511,10 +511,11 @@ public void testTimeThrowBehaviors() {
}

private void testThrowsInternal(TableDefaults table) {
assertThrows(TableDataException.class,
assertThrows(
"Encountered negative delta time during EMS processing",
TableDataException.class,
() -> table.updateBy(UpdateByOperation.EmMin(
OperationControl.builder().build(), "ts", 100)),
"Encountered negative delta time during EMS processing");
OperationControl.builder().build(), "ts", 100)));
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
import static io.deephaven.util.QueryConstants.*;
import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.fail;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.Assert.assertThrows;

@Category(OutOfBandTest.class)
public class TestEmStd extends BaseUpdateByTest {
Expand Down Expand Up @@ -525,10 +525,11 @@ public void testTimeThrowBehaviors() {
}

private void testThrowsInternal(TableDefaults table) {
assertThrows(TableDataException.class,
assertThrows(
"Encountered negative delta time during EMS processing",
TableDataException.class,
() -> table.updateBy(UpdateByOperation.EmStd(
OperationControl.builder().build(), "ts", 100)),
"Encountered negative delta time during EMS processing");
OperationControl.builder().build(), "ts", 100)));
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
import static io.deephaven.engine.util.TableTools.*;
import static io.deephaven.time.DateTimeUtils.*;
import static io.deephaven.util.QueryConstants.*;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.Assert.assertThrows;

@Category(OutOfBandTest.class)
public class TestEma extends BaseUpdateByTest {
Expand Down Expand Up @@ -272,10 +272,11 @@ public void testTimeThrowBehaviors() {
}

private void testThrowsInternal(TableDefaults table) {
assertThrows(TableDataException.class,
assertThrows(
"Encountered negative delta time during EMA processing",
TableDataException.class,
() -> table.updateBy(UpdateByOperation.Ema(
OperationControl.builder().build(), "ts", 100)),
"Encountered negative delta time during EMA processing");
OperationControl.builder().build(), "ts", 100)));
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
import static io.deephaven.util.QueryConstants.*;
import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.fail;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.Assert.assertThrows;

@Category(OutOfBandTest.class)
public class TestEms extends BaseUpdateByTest {
Expand Down Expand Up @@ -386,10 +386,11 @@ public void testTimeThrowBehaviors() {
}

private void testThrowsInternal(TableDefaults table) {
assertThrows(TableDataException.class,
assertThrows(
"Encountered negative delta time during EMS processing",
TableDataException.class,
() -> table.updateBy(UpdateByOperation.Ems(
OperationControl.builder().build(), "ts", 100)),
"Encountered negative delta time during EMS processing");
OperationControl.builder().build(), "ts", 100)));
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
import static io.deephaven.engine.util.TableTools.stringCol;
import static io.deephaven.engine.testutil.junit4.EngineCleanup.printTableUpdates;
import static io.deephaven.util.QueryConstants.NULL_INT;
import static org.junit.jupiter.api.Assertions.assertArrayEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;

@Category(OutOfBandTest.class)
public class TestForwardFill extends BaseUpdateByTest {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//
// Copyright (c) 2016-2024 Deephaven Data Labs and Patent Pending
//
package io.deephaven.utils.test;
package io.deephaven.engine.util;

import io.deephaven.configuration.Configuration;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//
// Copyright (c) 2016-2024 Deephaven Data Labs and Patent Pending
//
package io.deephaven.utils.test;
package io.deephaven.engine.util;

import io.deephaven.configuration.Configuration;
import io.deephaven.configuration.PropertyException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
import static io.deephaven.engine.testutil.TstUtils.*;
import static io.deephaven.engine.util.TableTools.col;
import static io.deephaven.engine.util.TableTools.intCol;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.junit.Assert.assertTrue;

@Category(OutOfBandTest.class)
public class TestWindowCheck {
Expand Down
2 changes: 1 addition & 1 deletion engine/test-utils/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ dependencies {

implementation project(':Configuration')
implementation project(':engine-tuple')
implementation project(':base-test-utils')
api project(':base-test-utils')
implementation project(':engine-rowset-test-utils')
implementation project(':extensions-source-support')

Expand Down
2 changes: 1 addition & 1 deletion engine/time/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ dependencies {
implementation depJdom2
Classpaths.inheritDagger(project)

testImplementation TestTools.projectDependency(project, 'Base')
testImplementation project(':base-test-utils')

testRuntimeOnly project(':log-to-slf4j'),
project(path: ':configs'),
Expand Down
3 changes: 1 addition & 2 deletions extensions/arrow/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ dependencies {
Classpaths.inheritArrow(project, 'arrow-vector', 'implementation')
Classpaths.inheritArrow(project, 'arrow-compression', 'implementation')

testImplementation TestTools.projectDependency(project, 'engine-table'),
TestTools.projectDependency(project, 'Util')
testImplementation TestTools.projectDependency(project, 'engine-table')

Classpaths.inheritSlf4j(project, 'slf4j-api', 'implementation')
Classpaths.inheritSlf4j(project, 'slf4j-simple', 'testRuntimeOnly')
Expand Down
4 changes: 2 additions & 2 deletions extensions/barrage/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ dependencies {

Classpaths.inheritImmutables(project)

testImplementation TestTools.projectDependency(project, 'engine-table'),
TestTools.projectDependency(project, 'Util')
testImplementation project(':engine-test-utils')

Classpaths.inheritSlf4j(project, 'slf4j-api', 'implementation')
Classpaths.inheritSlf4j(project, 'slf4j-simple', 'testRuntimeOnly')
testRuntimeOnly project(':log-to-slf4j')
testRuntimeOnly project(':test-configs')

Classpaths.inheritJUnitPlatform(project)
Classpaths.inheritAssertJ(project)
Expand Down
3 changes: 1 addition & 2 deletions extensions/csv/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ dependencies {

testImplementation depCommonsCompress
testImplementation depCommonsIo
testImplementation project(':engine-test-utils'),
TestTools.projectDependency(project, 'engine-base')
testImplementation project(':engine-test-utils')

Classpaths.inheritJUnitClassic(project, 'testImplementation')

Expand Down
11 changes: 5 additions & 6 deletions extensions/jdbc/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,11 @@ dependencies {
Classpaths.inheritJUnitPlatform(project)
Classpaths.inheritAssertJ(project)

testImplementation TestTools.projectDependency(project, 'engine-table'),
TestTools.projectDependency(project, 'Util'),
'com.h2database:h2:2.1.212'
testImplementation project(':engine-test-utils')
testImplementation 'com.h2database:h2:2.1.212'

testRuntimeOnly project(':log-to-slf4j'),
project(path: ':configs'),
project(path: ':test-configs')
testRuntimeOnly project(':log-to-slf4j')
testRuntimeOnly project(':configs')
testRuntimeOnly project(':test-configs')
Classpaths.inheritSlf4j(project, 'slf4j-simple', 'testRuntimeOnly')
}
8 changes: 4 additions & 4 deletions extensions/kafka/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ dependencies {

Classpaths.inheritImmutables(project)

testImplementation TestTools.projectDependency(project, 'engine-table')
testImplementation project(':engine-test-utils')
Classpaths.inheritJUnitClassic(project, 'testImplementation')

testRuntimeOnly project(':log-to-slf4j'),
project(path: ':configs'),
project(path: ':test-configs')
testRuntimeOnly project(':log-to-slf4j')
testRuntimeOnly project(':configs')
testRuntimeOnly project(':test-configs')
Classpaths.inheritSlf4j(project, 'slf4j-simple', 'testRuntimeOnly')

Classpaths.inheritAssertJ(project)
Expand Down
10 changes: 5 additions & 5 deletions extensions/parquet/benchmark/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ sourceSets {
}

dependencies {
testImplementation project(':extensions-parquet-table'),
project(':engine-table'),
project(':BenchmarkSupport'),
TestTools.projectDependency(project, 'engine-rowset'),
TestTools.projectDependency(project, 'engine-table')
testImplementation project(':extensions-parquet-table')
testImplementation project(':engine-table')
testImplementation project(':BenchmarkSupport')
testImplementation TestTools.projectDependency(project, 'engine-rowset')
testImplementation TestTools.projectDependency(project, 'engine-table')

testAnnotationProcessor 'org.openjdk.jmh:jmh-generator-annprocess:1.21'
testCompileOnly 'org.openjdk.jmh:jmh-generator-annprocess:1.21'
Expand Down
Loading

0 comments on commit 25d097a

Please sign in to comment.