From a655e8daf54c9fb7049fde5e2a794b7984562f4d Mon Sep 17 00:00:00 2001 From: Sean Kao Date: Mon, 11 Mar 2024 12:01:54 -0700 Subject: [PATCH] fix test Signed-off-by: Sean Kao --- .../flint/core/FlintTransactionITSuite.scala | 3 +-- .../spark/FlintSparkIndexSqlITSuite.scala | 20 +++++++------------ 2 files changed, 8 insertions(+), 15 deletions(-) diff --git a/integ-test/src/test/scala/org/opensearch/flint/core/FlintTransactionITSuite.scala b/integ-test/src/test/scala/org/opensearch/flint/core/FlintTransactionITSuite.scala index ebff01885..6df25aafb 100644 --- a/integ-test/src/test/scala/org/opensearch/flint/core/FlintTransactionITSuite.scala +++ b/integ-test/src/test/scala/org/opensearch/flint/core/FlintTransactionITSuite.scala @@ -66,8 +66,7 @@ class FlintTransactionITSuite extends OpenSearchTransactionSuite with Matchers { test("should get empty if no metadata log entry for index") { flintClient - .getIndexMetadataLatestLogEntry(testFlintIndex, testDataSourceName) - .isEmpty shouldBe true + .getIndexMetadataLatestLogEntry(testFlintIndex, testDataSourceName) shouldBe empty } test("should preserve original values when transition") { diff --git a/integ-test/src/test/scala/org/opensearch/flint/spark/FlintSparkIndexSqlITSuite.scala b/integ-test/src/test/scala/org/opensearch/flint/spark/FlintSparkIndexSqlITSuite.scala index 113c38c97..ed4e18398 100644 --- a/integ-test/src/test/scala/org/opensearch/flint/spark/FlintSparkIndexSqlITSuite.scala +++ b/integ-test/src/test/scala/org/opensearch/flint/spark/FlintSparkIndexSqlITSuite.scala @@ -67,15 +67,16 @@ class FlintSparkIndexSqlITSuite extends FlintSparkSuite { "active"), Row(testSkippingFlintIndex, "skipping", "default", testTableName, null, false, "active"))) - // Show in catalog.database + // Create index in other database flint .materializedView() - .name("spark_catalog.default.mv2") + .name("spark_catalog.other.mv2") .query(testMvQuery) .create() + // Show in catalog.database shouldn't show index in other database checkAnswer( - sql(s"SHOW FLINT INDEX IN spark_catalog"), + sql(s"SHOW FLINT INDEX IN spark_catalog.default"), Seq( Row(testMvFlintIndex, "mv", "default", null, testMvIndexShortName, false, "active"), Row( @@ -86,21 +87,13 @@ class FlintSparkIndexSqlITSuite extends FlintSparkSuite { testCoveringIndex, false, "active"), - Row(testSkippingFlintIndex, "skipping", "default", testTableName, null, false, "active"), - Row( - FlintSparkMaterializedView.getFlintIndexName("spark_catalog.default.mv2"), - "mv", - "default", - null, - "mv2", - false, - "active"))) + Row(testSkippingFlintIndex, "skipping", "default", testTableName, null, false, "active"))) deleteTestIndex( testMvFlintIndex, testCoveringFlintIndex, testSkippingFlintIndex, - FlintSparkMaterializedView.getFlintIndexName("spark_catalog.default.mv2")) + FlintSparkMaterializedView.getFlintIndexName("spark_catalog.other.mv2")) } test("should return empty when show flint index in empty database") { @@ -128,5 +121,6 @@ class FlintSparkIndexSqlITSuite extends FlintSparkSuite { testCoveringIndex, true, "refreshing"))) + deleteTestIndex(testCoveringFlintIndex) } }