From 724bc97b6d572c461f0488f927b21e76477575c9 Mon Sep 17 00:00:00 2001 From: Vamsi Manohar Date: Wed, 20 Mar 2024 21:56:56 -0700 Subject: [PATCH] Integ test logging Signed-off-by: Vamsi Manohar --- .../opensearch/sql/datasource/DataSourceAPIsIT.java | 11 ++++++++++- .../org/opensearch/sql/legacy/SQLIntegTestCase.java | 7 +++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/integ-test/src/test/java/org/opensearch/sql/datasource/DataSourceAPIsIT.java b/integ-test/src/test/java/org/opensearch/sql/datasource/DataSourceAPIsIT.java index bafa14c517..7864ab46bd 100644 --- a/integ-test/src/test/java/org/opensearch/sql/datasource/DataSourceAPIsIT.java +++ b/integ-test/src/test/java/org/opensearch/sql/datasource/DataSourceAPIsIT.java @@ -24,6 +24,8 @@ import java.util.List; import java.util.Map; import lombok.SneakyThrows; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.junit.After; import org.junit.AfterClass; import org.junit.Assert; @@ -37,22 +39,29 @@ public class DataSourceAPIsIT extends PPLIntegTestCase { + public static final Logger LOGGER = LogManager.getLogger(DataSourceAPIsIT.class); + @Override protected void init() throws Exception { + LOGGER.error("Before init"); loadIndex(Index.DATASOURCES); + LOGGER.error("After init"); } @After public void cleanUp() throws IOException { + LOGGER.error("Before cleanUp"); wipeAllClusterSettings(); + LOGGER.error("After cleanUp"); } @AfterClass protected static void deleteDataSourcesCreated() throws IOException { + LOGGER.error("After cleanUp"); Request deleteRequest = getDeleteDataSourceRequest("create_prometheus"); Response deleteResponse = client().performRequest(deleteRequest); Assert.assertEquals(204, deleteResponse.getStatusLine().getStatusCode()); - + deleteRequest = getDeleteDataSourceRequest("update_prometheus"); deleteResponse = client().performRequest(deleteRequest); Assert.assertEquals(204, deleteResponse.getStatusLine().getStatusCode()); diff --git a/integ-test/src/test/java/org/opensearch/sql/legacy/SQLIntegTestCase.java b/integ-test/src/test/java/org/opensearch/sql/legacy/SQLIntegTestCase.java index 303654ea37..f588bfd56f 100644 --- a/integ-test/src/test/java/org/opensearch/sql/legacy/SQLIntegTestCase.java +++ b/integ-test/src/test/java/org/opensearch/sql/legacy/SQLIntegTestCase.java @@ -56,6 +56,8 @@ import javax.management.remote.JMXConnectorFactory; import javax.management.remote.JMXServiceURL; import org.apache.commons.lang3.StringUtils; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.json.JSONArray; import org.json.JSONObject; import org.junit.AfterClass; @@ -71,6 +73,8 @@ /** OpenSearch Rest integration test base for SQL testing */ public abstract class SQLIntegTestCase extends OpenSearchSQLRestTestCase { + public static final Logger LOGGER = LogManager.getLogger(SQLIntegTestCase.class); + public static final String PERSISTENT = "persistent"; public static final String TRANSIENT = "transient"; public static final Integer DEFAULT_QUERY_SIZE_LIMIT = @@ -84,6 +88,7 @@ public boolean shouldResetQuerySizeLimit() { @Before public void setUpIndices() throws Exception { + LOGGER.error("Setting up indices"); if (client() == null) { initClient(); } @@ -147,7 +152,9 @@ public static void dumpCoverage() { */ @AfterClass public static void cleanUpIndices() throws IOException { + LOGGER.error("Cleaning up indices"); if (System.getProperty("tests.rest.bwcsuite") == null) { + LOGGER.error("Cleaning up indices"); wipeAllOpenSearchIndices(); wipeAllClusterSettings(); }