Skip to content

Commit

Permalink
Fix Iceberg Tests
Browse files Browse the repository at this point in the history
1. Iceberg Tests that requires constructor arguments are pickedup
in TestNG 7.5. TestNG 6.10 ignores them, but newer version marks
them as failure.
2. Remove the @test annotation and rename it to be not picked up by
the TestNG 7.5 rules.
3. Fix the @test annotation on the final test classes.
  • Loading branch information
Arunachalam Thirupathi committed Jul 5, 2022
1 parent 15058ec commit e4fc261
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@
import static org.testng.Assert.assertFalse;
import static org.testng.Assert.assertTrue;

public class TestAbstractIcebergSmoke
public class IcebergDistributedSmokeTestBase
extends AbstractTestIntegrationSmokeTest
{
private final CatalogType catalogType;

private static final Pattern WITH_CLAUSE_EXTRACTER = Pattern.compile(".*(WITH\\s*\\([^)]*\\))\\s*$", Pattern.DOTALL);

protected TestAbstractIcebergSmoke(CatalogType catalogType)
protected IcebergDistributedSmokeTestBase(CatalogType catalogType)
{
this.catalogType = requireNonNull(catalogType, "catalogType is null");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,18 @@
import com.facebook.presto.testing.QueryRunner;
import com.facebook.presto.tests.AbstractTestDistributedQueries;
import com.google.common.collect.ImmutableMap;
import org.testng.annotations.Test;

import static com.facebook.presto.common.type.VarcharType.VARCHAR;
import static com.facebook.presto.testing.MaterializedResult.resultBuilder;
import static com.facebook.presto.testing.assertions.Assert.assertEquals;
import static java.util.Objects.requireNonNull;

@Test
public class TestAbstractIcebergDistributed
public class IcebergDistributedTestBase
extends AbstractTestDistributedQueries
{
private final CatalogType catalogType;

protected TestAbstractIcebergDistributed(CatalogType catalogType)
protected IcebergDistributedTestBase(CatalogType catalogType)
{
this.catalogType = requireNonNull(catalogType, "catalogType is null");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@
*/
package com.facebook.presto.iceberg.hadoop;

import com.facebook.presto.iceberg.TestAbstractIcebergDistributed;
import com.facebook.presto.iceberg.IcebergDistributedTestBase;
import org.testng.annotations.Test;

import static com.facebook.presto.iceberg.CatalogType.HADOOP;

@Test
public class TestIcebergDistributedHadoop
extends TestAbstractIcebergDistributed
extends IcebergDistributedTestBase
{
public TestIcebergDistributedHadoop()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,14 @@
*/
package com.facebook.presto.iceberg.hadoop;

import com.facebook.presto.iceberg.TestAbstractIcebergSmoke;
import com.facebook.presto.iceberg.IcebergDistributedSmokeTestBase;
import org.testng.annotations.Test;

import static com.facebook.presto.iceberg.CatalogType.HADOOP;

@Test
public class TestIcebergSmokeHadoop
extends TestAbstractIcebergSmoke
extends IcebergDistributedSmokeTestBase
{
public TestIcebergSmokeHadoop()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@
*/
package com.facebook.presto.iceberg.hive;

import com.facebook.presto.iceberg.TestAbstractIcebergDistributed;
import com.facebook.presto.iceberg.IcebergDistributedTestBase;
import org.testng.annotations.Test;

import static com.facebook.presto.iceberg.CatalogType.HIVE;

@Test
public class TestIcebergDistributedHive
extends TestAbstractIcebergDistributed
extends IcebergDistributedTestBase
{
public TestIcebergDistributedHive()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
package com.facebook.presto.iceberg.hive;

import com.facebook.presto.Session;
import com.facebook.presto.iceberg.TestAbstractIcebergSmoke;
import com.facebook.presto.iceberg.IcebergDistributedSmokeTestBase;
import org.testng.annotations.Test;

import java.util.List;
Expand All @@ -31,7 +31,7 @@
import static org.testng.Assert.fail;

public class TestIcebergSmokeHive
extends TestAbstractIcebergSmoke
extends IcebergDistributedSmokeTestBase
{
public TestIcebergSmokeHive()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
*/
package com.facebook.presto.iceberg.nessie;

import com.facebook.presto.iceberg.IcebergDistributedTestBase;
import com.facebook.presto.iceberg.IcebergQueryRunner;
import com.facebook.presto.iceberg.TestAbstractIcebergDistributed;
import com.facebook.presto.testing.QueryRunner;
import com.facebook.presto.testing.containers.NessieContainer;
import com.google.common.collect.ImmutableMap;
Expand All @@ -27,7 +27,7 @@

@Test
public class TestIcebergDistributedNessie
extends TestAbstractIcebergDistributed
extends IcebergDistributedTestBase
{
private NessieContainer nessieContainer;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,21 @@
*/
package com.facebook.presto.iceberg.nessie;

import com.facebook.presto.iceberg.IcebergDistributedSmokeTestBase;
import com.facebook.presto.iceberg.IcebergQueryRunner;
import com.facebook.presto.iceberg.TestAbstractIcebergSmoke;
import com.facebook.presto.testing.QueryRunner;
import com.facebook.presto.testing.containers.NessieContainer;
import com.google.common.collect.ImmutableMap;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;

import static com.facebook.presto.iceberg.CatalogType.NESSIE;
import static com.facebook.presto.iceberg.nessie.NessieTestUtil.nessieConnectorProperties;

@Test
public class TestIcebergSmokeNessie
extends TestAbstractIcebergSmoke
extends IcebergDistributedSmokeTestBase
{
private NessieContainer nessieContainer;

Expand Down

0 comments on commit e4fc261

Please sign in to comment.