From 96d0e73cf4f9a17d3a491ed4428eaec1ec3d4aff Mon Sep 17 00:00:00 2001 From: Joshua Date: Fri, 9 Jul 2021 18:31:05 -0700 Subject: [PATCH] Fix IT for notebooks frontend and backend (#56) * Test CI Signed-off-by: Joshua Li * Test CI 2 Signed-off-by: Joshua Li * Remove opendistro Signed-off-by: Joshua Li * Update cypress test Signed-off-by: Joshua Li --- dashboards-notebooks/.cypress/integration/ui.spec.js | 2 +- opensearch-notebooks/build.gradle | 8 +++++++- .../opensearch}/notebooks/NotebooksPluginIT.kt | 0 .../opensearch}/notebooks/NotebooksPluginTests.kt | 0 .../opensearch}/notebooks/PluginRestTestCase.kt | 0 .../opensearch}/notebooks/TestHelpers.kt | 0 .../opensearch}/notebooks/rest/NotebooksIT.kt | 0 7 files changed, 8 insertions(+), 2 deletions(-) rename opensearch-notebooks/src/test/kotlin/{com/amazon/opendistroforelasticsearch => org/opensearch}/notebooks/NotebooksPluginIT.kt (100%) rename opensearch-notebooks/src/test/kotlin/{com/amazon/opendistroforelasticsearch => org/opensearch}/notebooks/NotebooksPluginTests.kt (100%) rename opensearch-notebooks/src/test/kotlin/{com/amazon/opendistroforelasticsearch => org/opensearch}/notebooks/PluginRestTestCase.kt (100%) rename opensearch-notebooks/src/test/kotlin/{com/amazon/opendistroforelasticsearch => org/opensearch}/notebooks/TestHelpers.kt (100%) rename opensearch-notebooks/src/test/kotlin/{com/amazon/opendistroforelasticsearch => org/opensearch}/notebooks/rest/NotebooksIT.kt (100%) diff --git a/dashboards-notebooks/.cypress/integration/ui.spec.js b/dashboards-notebooks/.cypress/integration/ui.spec.js index 26f124f..727a032 100644 --- a/dashboards-notebooks/.cypress/integration/ui.spec.js +++ b/dashboards-notebooks/.cypress/integration/ui.spec.js @@ -67,7 +67,7 @@ describe('Testing notebooks table', () => { cy.get('.euiButton__text').contains(/^Create$/).click(); cy.wait(delay); - cy.get('.euiPageHeaderSection').contains(TEST_NOTEBOOK).should('exist'); + cy.contains(TEST_NOTEBOOK).should('exist'); }); it('Duplicates and renames a notebook', () => { diff --git a/opensearch-notebooks/build.gradle b/opensearch-notebooks/build.gradle index d8d80fd..b1005a0 100644 --- a/opensearch-notebooks/build.gradle +++ b/opensearch-notebooks/build.gradle @@ -235,14 +235,20 @@ integTest { if (System.getProperty("test.debug") != null) { jvmArgs '-agentlib:jdwp=transport=dt_socket,server=n,suspend=y,address=8000' } + + // https://github.com/opensearch-project/index-management/pull/93 + if (System.getProperty("tests.clustername") != null) { + exclude 'org/opensearch/notebooks/NotebooksPluginIT.class' + } } + Zip bundle = (Zip) project.getTasks().getByName("bundlePlugin"); integTest.dependsOn(bundle) integTest.getClusters().forEach{c -> c.plugin(project.getObjects().fileProperty().value(bundle.getArchiveFile()))} testClusters.integTest { - testDistribution = 'INTEG_TEST' + testDistribution = "ARCHIVE" // Cluster shrink exception thrown if we try to set numberOfNodes to 1, so only apply if > 1 if (_numNodes > 1) numberOfNodes = _numNodes // When running integration tests it doesn't forward the --debug-jvm to the cluster anymore diff --git a/opensearch-notebooks/src/test/kotlin/com/amazon/opendistroforelasticsearch/notebooks/NotebooksPluginIT.kt b/opensearch-notebooks/src/test/kotlin/org/opensearch/notebooks/NotebooksPluginIT.kt similarity index 100% rename from opensearch-notebooks/src/test/kotlin/com/amazon/opendistroforelasticsearch/notebooks/NotebooksPluginIT.kt rename to opensearch-notebooks/src/test/kotlin/org/opensearch/notebooks/NotebooksPluginIT.kt diff --git a/opensearch-notebooks/src/test/kotlin/com/amazon/opendistroforelasticsearch/notebooks/NotebooksPluginTests.kt b/opensearch-notebooks/src/test/kotlin/org/opensearch/notebooks/NotebooksPluginTests.kt similarity index 100% rename from opensearch-notebooks/src/test/kotlin/com/amazon/opendistroforelasticsearch/notebooks/NotebooksPluginTests.kt rename to opensearch-notebooks/src/test/kotlin/org/opensearch/notebooks/NotebooksPluginTests.kt diff --git a/opensearch-notebooks/src/test/kotlin/com/amazon/opendistroforelasticsearch/notebooks/PluginRestTestCase.kt b/opensearch-notebooks/src/test/kotlin/org/opensearch/notebooks/PluginRestTestCase.kt similarity index 100% rename from opensearch-notebooks/src/test/kotlin/com/amazon/opendistroforelasticsearch/notebooks/PluginRestTestCase.kt rename to opensearch-notebooks/src/test/kotlin/org/opensearch/notebooks/PluginRestTestCase.kt diff --git a/opensearch-notebooks/src/test/kotlin/com/amazon/opendistroforelasticsearch/notebooks/TestHelpers.kt b/opensearch-notebooks/src/test/kotlin/org/opensearch/notebooks/TestHelpers.kt similarity index 100% rename from opensearch-notebooks/src/test/kotlin/com/amazon/opendistroforelasticsearch/notebooks/TestHelpers.kt rename to opensearch-notebooks/src/test/kotlin/org/opensearch/notebooks/TestHelpers.kt diff --git a/opensearch-notebooks/src/test/kotlin/com/amazon/opendistroforelasticsearch/notebooks/rest/NotebooksIT.kt b/opensearch-notebooks/src/test/kotlin/org/opensearch/notebooks/rest/NotebooksIT.kt similarity index 100% rename from opensearch-notebooks/src/test/kotlin/com/amazon/opendistroforelasticsearch/notebooks/rest/NotebooksIT.kt rename to opensearch-notebooks/src/test/kotlin/org/opensearch/notebooks/rest/NotebooksIT.kt