This is an automated email from the ASF dual-hosted git repository.

zehnder pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/incubator-streampipes.git


The following commit(s) were added to refs/heads/dev by this push:
     new d4c3fde  [STREAMPIPES-492] Test if pipelines are still running after a 
restart
d4c3fde is described below

commit d4c3fdef077b5a4624c4f62d55d58149c72122e2
Author: Philipp Zehnder <[email protected]>
AuthorDate: Thu Dec 30 11:18:29 2021 +0100

    [STREAMPIPES-492] Test if pipelines are still running after a restart
---
 .../restartStreamPipes/restartStreamPipes.sh       | 20 ++++++++
 .../restartStreamPipes/restartStreamPipes1.ts      | 58 ++++++++++++++++++++++
 .../restartStreamPipes/restartStreamPipes2.ts      | 36 ++++++++++++++
 3 files changed, 114 insertions(+)

diff --git 
a/ui/cypress/tests/experimental/restartStreamPipes/restartStreamPipes.sh 
b/ui/cypress/tests/experimental/restartStreamPipes/restartStreamPipes.sh
new file mode 100755
index 0000000..2b3fd46
--- /dev/null
+++ b/ui/cypress/tests/experimental/restartStreamPipes/restartStreamPipes.sh
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+cd ../../../../../installer/compose/
+docker-compose up -d
+sleep 30
+
+cd ../../ui
+npx cypress run --spec 
'cypress/tests/experimental/restartStreamPipes/restartStreamPipes1.ts'
+
+cd ../installer/compose/
+docker-compose down
+docker-compose up -d
+sleep 30
+
+cd ../../ui
+npx cypress run --spec 
'cypress/tests/experimental/restartStreamPipes/restartStreamPipes2.ts'
+
+cd ../installer/compose/
+docker-compose down -v
+
diff --git 
a/ui/cypress/tests/experimental/restartStreamPipes/restartStreamPipes1.ts 
b/ui/cypress/tests/experimental/restartStreamPipes/restartStreamPipes1.ts
new file mode 100644
index 0000000..a3a53f1
--- /dev/null
+++ b/ui/cypress/tests/experimental/restartStreamPipes/restartStreamPipes1.ts
@@ -0,0 +1,58 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+import { ConnectUtils } from '../../../support/utils/ConnectUtils';
+import { PipelineUtils } from '../../../support/utils/PipelineUtils';
+import { PipelineElementBuilder } from 
'../../../support/builder/PipelineElementBuilder';
+import { PipelineBuilder } from '../../../support/builder/PipelineBuilder';
+import { DashboardUtils } from '../../../support/utils/DashboardUtils';
+
+const adapterName = 'simulator';
+
+
+describe('Prepare StreamPipes for restart test', () => {
+  beforeEach('Setup Test', () => {
+    cy.initStreamPipesTest();
+    ConnectUtils.addMachineDataSimulator(adapterName);
+  });
+
+  it('Perform Test', () => {
+    const pipelineName = 'DashboardPipeline';
+    const pipelineInput = PipelineBuilder.create(pipelineName)
+        .addSource(adapterName)
+        .addSink(
+            PipelineElementBuilder.create('dashboard_sink')
+                .addInput('input', 'visualization-name', 'Demo')
+                .build())
+        .build();
+
+    PipelineUtils.testPipeline(pipelineInput);
+
+    DashboardUtils.goToDashboard();
+
+    // Add new dashboard
+    const dashboardName = 'testDashboard';
+    DashboardUtils.addAndEditDashboard(dashboardName);
+
+    DashboardUtils.addWidget(pipelineName, 'raw');
+
+    // Validate that data is coming (at least 3 events)
+    DashboardUtils.validateRawWidgetEvents(3);
+  });
+});
+
diff --git 
a/ui/cypress/tests/experimental/restartStreamPipes/restartStreamPipes2.ts 
b/ui/cypress/tests/experimental/restartStreamPipes/restartStreamPipes2.ts
new file mode 100644
index 0000000..0afacaf
--- /dev/null
+++ b/ui/cypress/tests/experimental/restartStreamPipes/restartStreamPipes2.ts
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+import { DashboardUtils } from '../../../support/utils/DashboardUtils';
+
+describe('Validate StreamPipes after restart', () => {
+  beforeEach('Setup Test', () => {
+    cy.login();
+  });
+
+  it('Perform Test', () => {
+
+    // open dashboard
+    DashboardUtils.goToDashboard();
+    DashboardUtils.showDashboard('testDashboard');
+
+    // validate that data is coming
+    DashboardUtils.validateRawWidgetEvents(3);
+  });
+});
+

Reply via email to