You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@streampipes.apache.org by ri...@apache.org on 2022/01/18 22:24:53 UTC

[incubator-streampipes] 03/04: [test] Add e2e tests for trend detection

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

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

commit 94d65162b6365e712b5b856c0b4fa012563c16e2
Author: Dominik Riemer <do...@gmail.com>
AuthorDate: Tue Jan 18 23:22:12 2022 +0100

    [test] Add e2e tests for trend detection
---
 .../filters-siddhi/increase1/description.json      | 35 ++++++++++++++++++++++
 .../filters-siddhi/increase1/expected.csv          |  2 ++
 .../filters-siddhi/increase1/input.csv             |  3 ++
 .../filters-siddhi/increase2/description.json      | 35 ++++++++++++++++++++++
 .../filters-siddhi/increase2/expected.csv          |  0
 .../filters-siddhi/increase2/input.csv             |  3 ++
 .../filters-siddhi/increase3/description.json      | 35 ++++++++++++++++++++++
 .../filters-siddhi/increase3/expected.csv          |  2 ++
 .../filters-siddhi/increase3/input.csv             |  4 +++
 .../tests/pipelineElement/SinglePipelineElement.ts |  2 +-
 10 files changed, 120 insertions(+), 1 deletion(-)

diff --git a/ui/cypress/fixtures/pipelineElement/filters-siddhi/increase1/description.json b/ui/cypress/fixtures/pipelineElement/filters-siddhi/increase1/description.json
new file mode 100644
index 0000000..6635a5f
--- /dev/null
+++ b/ui/cypress/fixtures/pipelineElement/filters-siddhi/increase1/description.json
@@ -0,0 +1,35 @@
+{
+  "name": "trend",
+  "config": [
+    {
+      "type": "drop-down",
+      "selector": "mapping",
+      "value": "sensorValue"
+    },
+    {
+      "type": "radio",
+      "selector": "operation",
+      "value": "Increase"
+    },
+    {
+      "type": "input",
+      "selector": "increase",
+      "value": "100"
+    },
+    {
+      "type": "input",
+      "selector": "duration",
+      "value": "10"
+    },
+    {
+      "type": "checkbox",
+      "selector": "timestamp",
+      "value": "check"
+    },
+    {
+      "type": "checkbox",
+      "selector": "sensorValue",
+      "value": "check"
+    }
+  ]
+}
diff --git a/ui/cypress/fixtures/pipelineElement/filters-siddhi/increase1/expected.csv b/ui/cypress/fixtures/pipelineElement/filters-siddhi/increase1/expected.csv
new file mode 100644
index 0000000..b35c308
--- /dev/null
+++ b/ui/cypress/fixtures/pipelineElement/filters-siddhi/increase1/expected.csv
@@ -0,0 +1,2 @@
+time;sensorvalue
+1623871503078;10.0
diff --git a/ui/cypress/fixtures/pipelineElement/filters-siddhi/increase1/input.csv b/ui/cypress/fixtures/pipelineElement/filters-siddhi/increase1/input.csv
new file mode 100644
index 0000000..9b29df0
--- /dev/null
+++ b/ui/cypress/fixtures/pipelineElement/filters-siddhi/increase1/input.csv
@@ -0,0 +1,3 @@
+timestamp;sensorValue
+1623871499055;1.0
+1623871503078;10
diff --git a/ui/cypress/fixtures/pipelineElement/filters-siddhi/increase2/description.json b/ui/cypress/fixtures/pipelineElement/filters-siddhi/increase2/description.json
new file mode 100644
index 0000000..6635a5f
--- /dev/null
+++ b/ui/cypress/fixtures/pipelineElement/filters-siddhi/increase2/description.json
@@ -0,0 +1,35 @@
+{
+  "name": "trend",
+  "config": [
+    {
+      "type": "drop-down",
+      "selector": "mapping",
+      "value": "sensorValue"
+    },
+    {
+      "type": "radio",
+      "selector": "operation",
+      "value": "Increase"
+    },
+    {
+      "type": "input",
+      "selector": "increase",
+      "value": "100"
+    },
+    {
+      "type": "input",
+      "selector": "duration",
+      "value": "10"
+    },
+    {
+      "type": "checkbox",
+      "selector": "timestamp",
+      "value": "check"
+    },
+    {
+      "type": "checkbox",
+      "selector": "sensorValue",
+      "value": "check"
+    }
+  ]
+}
diff --git a/ui/cypress/fixtures/pipelineElement/filters-siddhi/increase2/expected.csv b/ui/cypress/fixtures/pipelineElement/filters-siddhi/increase2/expected.csv
new file mode 100644
index 0000000..e69de29
diff --git a/ui/cypress/fixtures/pipelineElement/filters-siddhi/increase2/input.csv b/ui/cypress/fixtures/pipelineElement/filters-siddhi/increase2/input.csv
new file mode 100644
index 0000000..7ffe39e
--- /dev/null
+++ b/ui/cypress/fixtures/pipelineElement/filters-siddhi/increase2/input.csv
@@ -0,0 +1,3 @@
+timestamp;sensorValue
+1623871499055;1.0
+1623871503078;1.5
diff --git a/ui/cypress/fixtures/pipelineElement/filters-siddhi/increase3/description.json b/ui/cypress/fixtures/pipelineElement/filters-siddhi/increase3/description.json
new file mode 100644
index 0000000..6635a5f
--- /dev/null
+++ b/ui/cypress/fixtures/pipelineElement/filters-siddhi/increase3/description.json
@@ -0,0 +1,35 @@
+{
+  "name": "trend",
+  "config": [
+    {
+      "type": "drop-down",
+      "selector": "mapping",
+      "value": "sensorValue"
+    },
+    {
+      "type": "radio",
+      "selector": "operation",
+      "value": "Increase"
+    },
+    {
+      "type": "input",
+      "selector": "increase",
+      "value": "100"
+    },
+    {
+      "type": "input",
+      "selector": "duration",
+      "value": "10"
+    },
+    {
+      "type": "checkbox",
+      "selector": "timestamp",
+      "value": "check"
+    },
+    {
+      "type": "checkbox",
+      "selector": "sensorValue",
+      "value": "check"
+    }
+  ]
+}
diff --git a/ui/cypress/fixtures/pipelineElement/filters-siddhi/increase3/expected.csv b/ui/cypress/fixtures/pipelineElement/filters-siddhi/increase3/expected.csv
new file mode 100644
index 0000000..b35c308
--- /dev/null
+++ b/ui/cypress/fixtures/pipelineElement/filters-siddhi/increase3/expected.csv
@@ -0,0 +1,2 @@
+time;sensorvalue
+1623871503078;10.0
diff --git a/ui/cypress/fixtures/pipelineElement/filters-siddhi/increase3/input.csv b/ui/cypress/fixtures/pipelineElement/filters-siddhi/increase3/input.csv
new file mode 100644
index 0000000..73ccb34
--- /dev/null
+++ b/ui/cypress/fixtures/pipelineElement/filters-siddhi/increase3/input.csv
@@ -0,0 +1,4 @@
+timestamp;sensorValue
+1623871499055;1.0
+1623871503078;10
+1623871503085;11
diff --git a/ui/cypress/tests/pipelineElement/SinglePipelineElement.ts b/ui/cypress/tests/pipelineElement/SinglePipelineElement.ts
index 31463d8..b04f234 100644
--- a/ui/cypress/tests/pipelineElement/SinglePipelineElement.ts
+++ b/ui/cypress/tests/pipelineElement/SinglePipelineElement.ts
@@ -22,7 +22,7 @@ import { ProcessorTest } from '../../support/model/ProcessorTest';
 const allTests = Cypress.env('processingElements');
 
 allTests.forEach(test => {
-  const testNames = ['jsEvaluator1'];
+  const testNames = ['increase3'];
 
   const processorTest = test as ProcessorTest;