This is an automated email from the ASF dual-hosted git repository.
adutra pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/polaris.git
The following commit(s) were added to refs/heads/main by this push:
new bdc23f3c Fix catalog names in integration tests (#769)
bdc23f3c is described below
commit bdc23f3c3f3811dadce9f74ae5de999353e541ed
Author: Alexandre Dutra <[email protected]>
AuthorDate: Wed Jan 15 16:05:26 2025 +0100
Fix catalog names in integration tests (#769)
A few tests were still creating catalog names "manually".
Depending on the order of test execution, you could see
test failures, because some catalogs created in previous tests weren't
deleted.
---
.../it/test/PolarisApplicationIntegrationTest.java | 23 +++++++++++-----------
.../PolarisManagementServiceIntegrationTest.java | 3 ++-
2 files changed, 13 insertions(+), 13 deletions(-)
diff --git
a/integration-tests/src/main/java/org/apache/polaris/service/it/test/PolarisApplicationIntegrationTest.java
b/integration-tests/src/main/java/org/apache/polaris/service/it/test/PolarisApplicationIntegrationTest.java
index d6c5c24a..26fbdc32 100644
---
a/integration-tests/src/main/java/org/apache/polaris/service/it/test/PolarisApplicationIntegrationTest.java
+++
b/integration-tests/src/main/java/org/apache/polaris/service/it/test/PolarisApplicationIntegrationTest.java
@@ -353,8 +353,8 @@ public class PolarisApplicationIntegrationTest {
}
@Test
- public void testIcebergCreateTablesInExternalCatalog(TestInfo testInfo)
throws IOException {
- String catalogName = testInfo.getTestMethod().orElseThrow().getName() +
"External";
+ public void testIcebergCreateTablesInExternalCatalog() throws IOException {
+ String catalogName =
client.newEntityName("testIcebergCreateTablesInExternalCatalogExternal");
createCatalog(catalogName, Catalog.TypeEnum.EXTERNAL, principalRoleName);
try (RESTSessionCatalog sessionCatalog = newSessionCatalog(catalogName)) {
SessionCatalog.SessionContext sessionContext =
SessionCatalog.SessionContext.createEmpty();
@@ -380,8 +380,9 @@ public class PolarisApplicationIntegrationTest {
}
@Test
- public void testIcebergCreateTablesWithWritePathBlocked(TestInfo testInfo)
throws IOException {
- String catalogName = testInfo.getTestMethod().orElseThrow().getName() +
"Internal";
+ public void testIcebergCreateTablesWithWritePathBlocked() throws IOException
{
+ String catalogName =
+
client.newEntityName("testIcebergCreateTablesWithWritePathBlockedInternal");
createCatalog(catalogName, Catalog.TypeEnum.INTERNAL, principalRoleName);
try (RESTSessionCatalog sessionCatalog = newSessionCatalog(catalogName)) {
SessionCatalog.SessionContext sessionContext =
SessionCatalog.SessionContext.createEmpty();
@@ -424,8 +425,8 @@ public class PolarisApplicationIntegrationTest {
}
@Test
- public void testIcebergRegisterTableInExternalCatalog(TestInfo testInfo)
throws IOException {
- String catalogName = testInfo.getTestMethod().orElseThrow().getName() +
"External";
+ public void testIcebergRegisterTableInExternalCatalog() throws IOException {
+ String catalogName =
client.newEntityName("testIcebergRegisterTableInExternalCatalogExternal");
createCatalog(
catalogName,
Catalog.TypeEnum.EXTERNAL,
@@ -443,8 +444,7 @@ public class PolarisApplicationIntegrationTest {
String location =
"file://"
+ testDir.toFile().getAbsolutePath()
- + "/"
- + testInfo.getTestMethod().get().getName();
+ + "/testIcebergRegisterTableInExternalCatalog";
String metadataLocation = location +
"/metadata/000001-494949494949494949.metadata.json";
TableMetadata tableMetadata =
@@ -471,8 +471,8 @@ public class PolarisApplicationIntegrationTest {
}
@Test
- public void testIcebergUpdateTableInExternalCatalog(TestInfo testInfo)
throws IOException {
- String catalogName = testInfo.getTestMethod().orElseThrow().getName() +
"External";
+ public void testIcebergUpdateTableInExternalCatalog() throws IOException {
+ String catalogName =
client.newEntityName("testIcebergUpdateTableInExternalCatalogExternal");
createCatalog(
catalogName,
Catalog.TypeEnum.EXTERNAL,
@@ -490,8 +490,7 @@ public class PolarisApplicationIntegrationTest {
String location =
"file://"
+ testDir.toFile().getAbsolutePath()
- + "/"
- + testInfo.getTestMethod().get().getName();
+ + "/testIcebergUpdateTableInExternalCatalog";
String metadataLocation = location +
"/metadata/000001-494949494949494949.metadata.json";
Types.NestedField col1 = Types.NestedField.of(1, false, "col1",
Types.StringType.get());
diff --git
a/integration-tests/src/main/java/org/apache/polaris/service/it/test/PolarisManagementServiceIntegrationTest.java
b/integration-tests/src/main/java/org/apache/polaris/service/it/test/PolarisManagementServiceIntegrationTest.java
index efe91ae6..523fc940 100644
---
a/integration-tests/src/main/java/org/apache/polaris/service/it/test/PolarisManagementServiceIntegrationTest.java
+++
b/integration-tests/src/main/java/org/apache/polaris/service/it/test/PolarisManagementServiceIntegrationTest.java
@@ -396,7 +396,8 @@ public class PolarisManagementServiceIntegrationTest {
.setStorageType(StorageConfigInfo.StorageTypeEnum.S3)
.setAllowedLocations(List.of("s3://my-old-bucket/path/to/data"))
.build();
- String catalogName = "mycatalog";
+ String catalogName =
+
client.newEntityName("testUpdateCatalogWithoutDefaultBaseLocationInUpdate");
Catalog catalog =
PolarisCatalog.builder()
.setType(Catalog.TypeEnum.INTERNAL)