From 7c66a59c35809926c2e491b24e680b5cd640c52c Mon Sep 17 00:00:00 2001 From: Yingjian Wu Date: Sun, 14 Apr 2024 19:10:29 -0400 Subject: [PATCH] add test --- .../com/netflix/metacat/MetacatSmokeSpec.groovy | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/metacat-functional-tests/src/functionalTest/groovy/com/netflix/metacat/MetacatSmokeSpec.groovy b/metacat-functional-tests/src/functionalTest/groovy/com/netflix/metacat/MetacatSmokeSpec.groovy index bad37ccf3..2f60e6440 100644 --- a/metacat-functional-tests/src/functionalTest/groovy/com/netflix/metacat/MetacatSmokeSpec.groovy +++ b/metacat-functional-tests/src/functionalTest/groovy/com/netflix/metacat/MetacatSmokeSpec.groovy @@ -168,7 +168,7 @@ class MetacatSmokeSpec extends Specification { } @Unroll - def "Test create/get iceberg table with nested fields with upper case"() { + def "Test create/get table with nested fields with upper case"() { given: def catalogName = 'embedded-fast-hive-metastore' def databaseName = 'iceberg_db' @@ -208,8 +208,10 @@ class MetacatSmokeSpec extends Specification { def metadataLocation = String.format('/tmp/data/metadata/00000-0b60cc39-438f-413e-96c2-2694d7926529.metadata.json') - def metadata = [table_type: 'ICEBERG', metadata_location: metadataLocation] - tableDto.setMetadata(metadata) + if (isIcebergTable) { + def metadata = [table_type: 'ICEBERG', metadata_location: metadataLocation] + tableDto.setMetadata(metadata) + } when: try {api.createDatabase(catalogName, databaseName, new DatabaseCreateRequestDto()) } catch (Exception ignored) { @@ -219,7 +221,9 @@ class MetacatSmokeSpec extends Specification { then: noExceptionThrown() - tableDTO.metadata.get("metadata_location").equals(metadataLocation) + if (isIcebergTable) { + tableDTO.metadata.get("metadata_location").equals(metadataLocation) + } tableDTO.getFields().size() == 2 def nestedFieldDto = tableDTO.getFields().find { it.pos == 1 } // assert that the type field also keeps the name fidelity @@ -272,6 +276,10 @@ class MetacatSmokeSpec extends Specification { JSONAssert.assertEquals(nestedFieldDto.jsonType.toString(), expectedJsonString, false) cleanup: api.deleteTable(catalogName, databaseName, tableName) + where: + isIcebergTable + true + false } @Unroll