Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Core: Cleanup unit tests #12666

Merged
merged 1 commit into from
Mar 28, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@
import static org.assertj.core.api.Assertions.assertThat;

import java.io.IOException;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
Expand All @@ -38,11 +36,6 @@
@ExtendWith(ParameterizedTestExtension.class)
public abstract class MetadataTableScanTestBase extends TestBase {

@Parameters(name = "formatVersion = {0}")
protected static List<Object> parameters() {
return Arrays.asList(1, 2, 3);
}

protected Set<String> scannedPaths(TableScan scan) {
return StreamSupport.stream(scan.planFiles().spliterator(), false)
.map(t -> t.file().location().toString())
Expand Down
6 changes: 0 additions & 6 deletions core/src/test/java/org/apache/iceberg/TestBatchScans.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import static org.assertj.core.api.Assertions.assertThat;

import java.io.IOException;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
import org.apache.iceberg.io.CloseableIterable;
Expand All @@ -32,11 +31,6 @@
@ExtendWith(ParameterizedTestExtension.class)
public class TestBatchScans extends TestBase {

@Parameters(name = "formatVersion = {0}")
protected static List<Object> parameters() {
return Arrays.asList(1, 2, 3);
}

@TestTemplate
public void testDataTableScan() {
table.newFastAppend().appendFile(FILE_A).appendFile(FILE_B).commit();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
import static org.assertj.core.api.Assertions.assertThatThrownBy;

import java.io.IOException;
import java.util.Arrays;
import java.util.List;
import org.apache.iceberg.exceptions.CommitFailedException;
import org.apache.iceberg.relocated.com.google.common.collect.Lists;
import org.apache.iceberg.relocated.com.google.common.collect.Sets;
Expand All @@ -36,10 +34,6 @@

@ExtendWith(ParameterizedTestExtension.class)
public class TestCreateTransaction extends TestBase {
@Parameters(name = "formatVersion = {0}")
protected static List<Object> parameters() {
return Arrays.asList(1, 2, 3);
}

@TestTemplate
public void testCreateTransaction() throws IOException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assumptions.assumeThat;

import java.util.Arrays;
import java.util.List;
import org.apache.iceberg.relocated.com.google.common.collect.ImmutableList;
import org.apache.iceberg.relocated.com.google.common.collect.Iterables;
Expand All @@ -32,11 +31,6 @@
@ExtendWith(ParameterizedTestExtension.class)
public class TestEntriesMetadataTable extends TestBase {

@Parameters(name = "formatVersion = {0}")
protected static List<Object> parameters() {
return Arrays.asList(1, 2, 3);
}

@TestTemplate
public void testEntriesTable() {
table.newAppend().appendFile(FILE_A).appendFile(FILE_B).commit();
Expand Down
5 changes: 0 additions & 5 deletions core/src/test/java/org/apache/iceberg/TestFastAppend.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@

import java.io.File;
import java.io.IOException;
import java.util.Arrays;
import java.util.List;
import java.util.Objects;
import java.util.Set;
Expand All @@ -39,10 +38,6 @@

@ExtendWith(ParameterizedTestExtension.class)
public class TestFastAppend extends TestBase {
@Parameters(name = "formatVersion = {0}")
protected static List<Object> parameters() {
return Arrays.asList(1, 2, 3);
}

@TestTemplate
public void testAddManyFiles() {
Expand Down
5 changes: 0 additions & 5 deletions core/src/test/java/org/apache/iceberg/TestFindFiles.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import static org.assertj.core.api.Assertions.assertThat;

import java.util.Arrays;
import java.util.List;
import java.util.Set;
import org.apache.iceberg.expressions.Expressions;
import org.apache.iceberg.relocated.com.google.common.collect.ImmutableMap;
Expand All @@ -34,10 +33,6 @@

@ExtendWith(ParameterizedTestExtension.class)
public class TestFindFiles extends TestBase {
@Parameters(name = "formatVersion = {0}")
protected static List<Object> parameters() {
return Arrays.asList(1, 2, 3);
}

@TestTemplate
public void testBasicBehavior() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import static org.assertj.core.api.Assertions.assertThatThrownBy;

import java.io.IOException;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.Executors;
Expand All @@ -41,10 +40,6 @@

@ExtendWith(ParameterizedTestExtension.class)
public class TestIncrementalDataTableScan extends TestBase {
@Parameters(name = "formatVersion = {0}")
protected static List<Object> parameters() {
return Arrays.asList(1, 2, 3);
}

@BeforeEach
public void setupTableProperties() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;

import java.util.Arrays;
import java.util.List;
import java.util.Map;
import org.apache.iceberg.io.LocationProvider;
Expand All @@ -32,10 +31,6 @@

@ExtendWith(ParameterizedTestExtension.class)
public class TestLocationProvider extends TestBase {
@Parameters(name = "formatVersion = {0}")
protected static List<Object> parameters() {
return Arrays.asList(1, 2, 3);
}

// publicly visible for testing to be dynamically loaded
public static class TwoArgDynamicallyLoadedLocationProvider implements LocationProvider {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,12 @@

import static org.assertj.core.api.Assertions.assertThat;

import java.util.Arrays;
import java.util.List;
import org.apache.iceberg.expressions.Expressions;
import org.junit.jupiter.api.TestTemplate;
import org.junit.jupiter.api.extension.ExtendWith;

@ExtendWith(ParameterizedTestExtension.class)
public class TestManifestCleanup extends TestBase {
@Parameters(name = "formatVersion = {0}")
protected static List<Object> parameters() {
return Arrays.asList(1, 2, 3);
}

@TestTemplate
public void testDelete() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@

import java.io.IOException;
import java.nio.ByteBuffer;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import org.apache.iceberg.expressions.Expressions;
import org.apache.iceberg.io.CloseableIterable;
Expand All @@ -37,11 +35,6 @@

@ExtendWith(ParameterizedTestExtension.class)
public class TestManifestReaderStats extends TestBase {
@Parameters(name = "formatVersion = {0}")
protected static List<Object> parameters() {
return Arrays.asList(1, 2, 3);
}

private static final Map<Integer, Long> VALUE_COUNT = ImmutableMap.of(3, 3L);
private static final Map<Integer, Long> NULL_VALUE_COUNTS = ImmutableMap.of(3, 0L);
private static final Map<Integer, Long> NAN_VALUE_COUNTS = ImmutableMap.of(3, 1L);
Expand Down
6 changes: 0 additions & 6 deletions core/src/test/java/org/apache/iceberg/TestManifestWriter.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import java.io.File;
import java.io.IOException;
import java.io.UncheckedIOException;
import java.util.Arrays;
import java.util.List;
import java.util.UUID;
import org.apache.iceberg.ManifestEntry.Status;
Expand All @@ -36,11 +35,6 @@

@ExtendWith(ParameterizedTestExtension.class)
public class TestManifestWriter extends TestBase {
@Parameters(name = "formatVersion = {0}")
protected static List<Object> parameters() {
return Arrays.asList(1, 2, 3);
}

private static final int FILE_SIZE_CHECK_ROWS_DIVISOR = 250;
private static final long SMALL_FILE_SIZE = 10L;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@

import static org.assertj.core.api.Assertions.assertThat;

import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import org.apache.iceberg.MicroBatches.MicroBatch;
Expand All @@ -32,10 +31,6 @@

@ExtendWith(ParameterizedTestExtension.class)
public class TestMicroBatchBuilder extends TestBase {
@Parameters(name = "formatVersion = {0}")
protected static List<Object> parameters() {
return Arrays.asList(1, 2, 3);
}

@BeforeEach
public void setupTableProperties() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@

import java.io.File;
import java.io.IOException;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.atomic.AtomicInteger;
Expand All @@ -47,10 +45,6 @@

@ExtendWith(ParameterizedTestExtension.class)
public class TestReplaceTransaction extends TestBase {
@Parameters(name = "formatVersion = {0}")
protected static List<Object> parameters() {
return Arrays.asList(1, 2, 3);
}

@TestTemplate
public void testReplaceTransactionWithCustomSortOrder() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,6 @@

@ExtendWith(ParameterizedTestExtension.class)
public class TestRewriteManifests extends TestBase {
@Parameters(name = "formatVersion = {0}")
protected static List<Object> parameters() {
return Arrays.asList(1, 2, 3);
}

@TestTemplate
public void testRewriteManifestsAppendedDirectly() throws IOException {
Expand Down
6 changes: 0 additions & 6 deletions core/src/test/java/org/apache/iceberg/TestScanSummary.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,13 @@
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;

import java.util.Arrays;
import java.util.List;
import org.apache.iceberg.relocated.com.google.common.collect.ImmutableList;
import org.apache.iceberg.util.Pair;
import org.junit.jupiter.api.TestTemplate;
import org.junit.jupiter.api.extension.ExtendWith;

@ExtendWith(ParameterizedTestExtension.class)
public class TestScanSummary extends TestBase {
@Parameters(name = "formatVersion = {0}")
protected static List<Object> parameters() {
return Arrays.asList(1, 2, 3);
}

@TestTemplate
public void testSnapshotTimeRangeValidation() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;

import java.util.Arrays;
import java.util.List;
import java.util.Objects;
import java.util.Set;
import org.apache.iceberg.exceptions.ValidationException;
Expand All @@ -41,10 +39,6 @@

@ExtendWith(ParameterizedTestExtension.class)
public class TestSchemaAndMappingUpdate extends TestBase {
@Parameters(name = "formatVersion = {0}")
protected static List<Object> parameters() {
return Arrays.asList(1, 2, 3);
}

@TestTemplate
public void testAddPrimitiveColumn() {
Expand Down
6 changes: 0 additions & 6 deletions core/src/test/java/org/apache/iceberg/TestSchemaID.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import static org.assertj.core.api.Assertions.assertThat;

import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.function.Function;
import java.util.stream.Collectors;
Expand All @@ -34,11 +33,6 @@
@ExtendWith(ParameterizedTestExtension.class)
public class TestSchemaID extends TestBase {

@Parameters(name = "formatVersion = {0}")
protected static List<Object> parameters() {
return Arrays.asList(1, 2, 3);
}

@TestTemplate
public void testNoChange() {
int onlyId = table.schema().schemaId();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,11 @@

import static org.assertj.core.api.Assertions.assertThat;

import java.util.Arrays;
import java.util.List;
import org.junit.jupiter.api.TestTemplate;
import org.junit.jupiter.api.extension.ExtendWith;

@ExtendWith(ParameterizedTestExtension.class)
public class TestSetPartitionStatistics extends TestBase {
@Parameters(name = "formatVersion = {0}")
protected static List<Object> parameters() {
return Arrays.asList(1, 2, 3);
}

@TestTemplate
public void testEmptyUpdateStatistics() {
Expand Down
6 changes: 0 additions & 6 deletions core/src/test/java/org/apache/iceberg/TestSetStatistics.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,13 @@

import static org.assertj.core.api.Assertions.assertThat;

import java.util.Arrays;
import java.util.List;
import org.apache.iceberg.relocated.com.google.common.collect.ImmutableList;
import org.apache.iceberg.relocated.com.google.common.collect.ImmutableMap;
import org.junit.jupiter.api.TestTemplate;
import org.junit.jupiter.api.extension.ExtendWith;

@ExtendWith(ParameterizedTestExtension.class)
public class TestSetStatistics extends TestBase {
@Parameters(name = "formatVersion = {0}")
protected static List<Object> parameters() {
return Arrays.asList(1, 2, 3);
}

@TestTemplate
public void testEmptyUpdateStatistics() {
Expand Down
6 changes: 0 additions & 6 deletions core/src/test/java/org/apache/iceberg/TestSnapshot.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assumptions.assumeThat;

import java.util.Arrays;
import java.util.List;
import org.apache.iceberg.expressions.Expressions;
import org.apache.iceberg.relocated.com.google.common.collect.ImmutableSet;
import org.apache.iceberg.relocated.com.google.common.collect.Iterables;
Expand All @@ -31,10 +29,6 @@

@ExtendWith(ParameterizedTestExtension.class)
public class TestSnapshot extends TestBase {
@Parameters(name = "formatVersion = {0}")
protected static List<Object> parameters() {
return Arrays.asList(1, 2, 3);
}

@TestTemplate
public void testAppendFilesFromTable() {
Expand Down
Loading