gianm commented on code in PR #18207:
URL: https://github.com/apache/druid/pull/18207#discussion_r2238708169
##########
embedded-tests/src/test/java/org/apache/druid/testing/embedded/compact/AutoCompactionTest.java:
##########
@@ -85,68 +88,141 @@
import org.joda.time.Interval;
import org.joda.time.Period;
import org.joda.time.chrono.ISOChronology;
-import org.testng.Assert;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.DataProvider;
-import org.testng.annotations.Guice;
-import org.testng.annotations.Test;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.MethodSource;
+import org.junit.jupiter.params.provider.ValueSource;
import java.io.Closeable;
-import java.io.IOException;
-import java.io.InputStream;
-import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.Arrays;
-import java.util.HashSet;
import java.util.List;
-import java.util.Map;
import java.util.Set;
-import java.util.UUID;
+import java.util.function.Supplier;
import java.util.stream.Collectors;
-@Test(groups = {TestNGGroup.COMPACTION})
-@Guice(moduleFactory = DruidTestModuleFactory.class)
-public class ITAutoCompactionTest extends AbstractIndexerTest
+/**
+ * Embedded mode of integration-tests originally present in {@code
ITAutoCompactionTest}.
+ */
+public class AutoCompactionTest extends CompactionTestBase
{
- private static final Logger LOG = new Logger(ITAutoCompactionTest.class);
- private static final String INDEX_TASK =
"/indexer/wikipedia_index_task.json";
- private static final String INDEX_TASK_WITH_GRANULARITY_SPEC =
"/indexer/wikipedia_index_task_with_granularity_spec.json";
- private static final String INDEX_TASK_WITH_DIMENSION_SPEC =
"/indexer/wikipedia_index_task_with_dimension_spec.json";
- private static final String INDEX_ROLLUP_QUERIES_RESOURCE =
"/indexer/wikipedia_index_rollup_queries.json";
- private static final String INDEX_ROLLUP_SKETCH_QUERIES_RESOURCE =
"/indexer/wikipedia_index_sketch_queries.json";
- private static final String INDEX_QUERIES_RESOURCE =
"/indexer/wikipedia_index_queries.json";
- private static final String INDEX_TASK_WITH_ROLLUP_FOR_PRESERVE_METRICS =
"/indexer/wikipedia_index_rollup_preserve_metric.json";
- private static final String INDEX_TASK_WITHOUT_ROLLUP_FOR_PRESERVE_METRICS =
"/indexer/wikipedia_index_no_rollup_preserve_metric.json";
+ private static final Logger LOG = new Logger(AutoCompactionTest.class);
+ private static final Supplier<TaskBuilder.Index> INDEX_TASK =
Resources.Task.BASIC_INDEX;
+
+ private static final Supplier<TaskBuilder.Index>
INDEX_TASK_WITH_GRANULARITY_SPEC =
+ () ->
INDEX_TASK.get().dimensions("language").dynamicPartitionWithMaxRows(10);
+ private static final Supplier<TaskBuilder.Index>
INDEX_TASK_WITH_DIMENSION_SPEC =
+ () -> INDEX_TASK.get().granularitySpec("DAY", "DAY", true);
+
+ private static final String SELECT_APPROX_COUNT_DISTINCT =
Resources.Query.SELECT_APPROX_COUNT_DISTINCT;
+ private static final List<Pair<String, String>> INDEX_QUERIES_RESOURCE =
List.of(
+ Pair.of(Resources.Query.SELECT_MIN_MAX_TIME,
"2013-08-31T01:02:33.000Z,2013-09-01T12:41:27.000Z"),
+ Pair.of(Resources.Query.SELECT_APPROX_COUNT_DISTINCT, "5,5"),
+ Pair.of(Resources.Query.SELECT_EARLIEST_LATEST_USER, "nuclear,stringer"),
+ Pair.of(Resources.Query.SELECT_COUNT_OF_CHINESE_PAGES, "Crimson
Typhoon,1,905.0,9050.0")
+ );
+ private static final Supplier<TaskBuilder.IndexParallel>
INDEX_TASK_WITH_ROLLUP_FOR_PRESERVE_METRICS =
+ () -> TaskBuilder
+ .ofTypeIndexParallel()
+ .jsonInputFormat()
+ .inlineInputSourceWithData(Resources.InlineData.JSON_2_ROWS)
+ .isoTimestampColumn("timestamp")
Review Comment:
I'm ok with either one.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]