You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@streampipes.apache.org by ze...@apache.org on 2023/01/05 17:08:43 UTC

[streampipes] 01/01: [hotfix] Fix flaky adapter e2e tests

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

zehnder pushed a commit to branch hotfix-flaky-e2e-tests
in repository https://gitbox.apache.org/repos/asf/streampipes.git

commit 1eedd353980c40d99ead6d0970ce14b1fed47e60
Author: Philipp Zehnder <te...@users.noreply.github.com>
AuthorDate: Thu Jan 5 18:07:54 2023 +0100

     [hotfix] Fix flaky adapter e2e tests
---
 ui/.eslintignore                                   |  5 +++-
 ui/.prettierignore                                 |  5 +++-
 .../fixtures/connect/valueRules/expected.csv       |  2 +-
 ui/cypress/fixtures/connect/valueRules/input.csv   |  2 +-
 .../support/utils/ConnectEventSchemaUtils.ts       | 14 ++++++++++
 .../adapter/{ => rules}/schemaRules.smoke.spec.ts  | 30 +++++++++++-----------
 .../{streamRules.ts => rules/streamRules.spec.ts}  | 30 +++++++++++-----------
 ui/cypress/tests/adapter/{ => rules}/valueRules.ts | 30 +++++++++++-----------
 8 files changed, 69 insertions(+), 49 deletions(-)

diff --git a/ui/.eslintignore b/ui/.eslintignore
index 7327111bc..38280c105 100644
--- a/ui/.eslintignore
+++ b/ui/.eslintignore
@@ -18,6 +18,9 @@ dist
 
 # Remove these in the future to lint additional modules
 # Please also see .prettierignore
+
+# Ignore csv files required for e2e tests
+cypress/fixtures/**/*.csv
 src/app/configuration
 src/app/connect
 src/app/core
@@ -37,4 +40,4 @@ src/app/pipeline-details
 src/app/pipelines
 src/app/profile
 src/app/services
-src/scss
\ No newline at end of file
+src/scss
diff --git a/ui/.prettierignore b/ui/.prettierignore
index d8259d4e9..29dec3bfe 100644
--- a/ui/.prettierignore
+++ b/ui/.prettierignore
@@ -18,6 +18,9 @@ dist
 
 # Remove these in the future to format additional modules
 # Please also see .eslintignore
+
+# Ignore csv files required for e2e tests
+cypress/fixtures/**/*.csv
 src/app/configuration
 src/app/connect
 src/app/core
@@ -37,4 +40,4 @@ src/app/pipeline-details
 src/app/pipelines
 src/app/profile
 src/app/services
-src/scss
\ No newline at end of file
+src/scss
diff --git a/ui/cypress/fixtures/connect/valueRules/expected.csv b/ui/cypress/fixtures/connect/valueRules/expected.csv
index ea21f50ce..3ddfebcdc 100644
--- a/ui/cypress/fixtures/connect/valueRules/expected.csv
+++ b/ui/cypress/fixtures/connect/valueRules/expected.csv
@@ -1,2 +1,2 @@
 timestamp;temperature;value
-1640350512123;50.003334045410156;100.0
+1640346912123;50.003334045410156;100.0
diff --git a/ui/cypress/fixtures/connect/valueRules/input.csv b/ui/cypress/fixtures/connect/valueRules/input.csv
index 072815a5c..8f58cc7e8 100644
--- a/ui/cypress/fixtures/connect/valueRules/input.csv
+++ b/ui/cypress/fixtures/connect/valueRules/input.csv
@@ -1,2 +1,2 @@
 timestamp;value;temperature
-2021-12-24T12:55:12.123Z;10.0;10.0
+2021-12-24T12:55:12.123Z+0100;10.0;10.0
diff --git a/ui/cypress/support/utils/ConnectEventSchemaUtils.ts b/ui/cypress/support/utils/ConnectEventSchemaUtils.ts
index 6ce964ee6..2cbc2d060 100644
--- a/ui/cypress/support/utils/ConnectEventSchemaUtils.ts
+++ b/ui/cypress/support/utils/ConnectEventSchemaUtils.ts
@@ -71,6 +71,10 @@ export class ConnectEventSchemaUtils {
             'have.value',
             timestampRegex,
         );
+        cy.dataCy('sp-save-edit-property', { timeout: 10000 }).should(
+            'have.length',
+            1,
+        );
         cy.dataCy('sp-save-edit-property').click();
     }
 
@@ -92,6 +96,10 @@ export class ConnectEventSchemaUtils {
             'have.value',
             value,
         );
+        cy.dataCy('sp-save-edit-property', { timeout: 10000 }).should(
+            'have.length',
+            1,
+        );
         cy.dataCy('sp-save-edit-property').click();
     }
 
@@ -120,6 +128,11 @@ export class ConnectEventSchemaUtils {
         cy.dataCy('connect-schema-unit-to-dropdown', {
             timeout: 10000,
         }).contains(toUnit);
+
+        cy.dataCy('sp-save-edit-property', { timeout: 10000 }).should(
+            'have.length',
+            1,
+        );
         cy.dataCy('sp-save-edit-property').click();
     }
 
@@ -185,6 +198,7 @@ export class ConnectEventSchemaUtils {
         cy.wait(1000);
         cy.dataCy('sp-save-edit-property').click();
     }
+
     public static eventSchemaNextBtnDisabled() {
         cy.get('#event-schema-next-button').should('be.disabled');
     }
diff --git a/ui/cypress/tests/adapter/schemaRules.smoke.spec.ts b/ui/cypress/tests/adapter/rules/schemaRules.smoke.spec.ts
similarity index 50%
rename from ui/cypress/tests/adapter/schemaRules.smoke.spec.ts
rename to ui/cypress/tests/adapter/rules/schemaRules.smoke.spec.ts
index 6e8414394..3399ffd41 100644
--- a/ui/cypress/tests/adapter/schemaRules.smoke.spec.ts
+++ b/ui/cypress/tests/adapter/rules/schemaRules.smoke.spec.ts
@@ -1,24 +1,24 @@
 /*
- * 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
+ *  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
+ *     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.
+ *  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/connect/ConnectUtils';
-import { FileManagementUtils } from '../../support/utils/FileManagementUtils';
-import { ConnectEventSchemaUtils } from '../../support/utils/ConnectEventSchemaUtils';
+import { ConnectUtils } from '../../../support/utils/connect/ConnectUtils';
+import { FileManagementUtils } from '../../../support/utils/FileManagementUtils';
+import { ConnectEventSchemaUtils } from '../../../support/utils/ConnectEventSchemaUtils';
 
 describe('Connect schema rule transformations', () => {
     beforeEach('Setup Test', () => {
diff --git a/ui/cypress/tests/adapter/streamRules.ts b/ui/cypress/tests/adapter/rules/streamRules.spec.ts
similarity index 60%
rename from ui/cypress/tests/adapter/streamRules.ts
rename to ui/cypress/tests/adapter/rules/streamRules.spec.ts
index 7df109084..82ff3d94a 100644
--- a/ui/cypress/tests/adapter/streamRules.ts
+++ b/ui/cypress/tests/adapter/rules/streamRules.spec.ts
@@ -1,24 +1,24 @@
 /*
- * 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
+ *  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
+ *     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.
+ *  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/connect/ConnectUtils';
-import { FileManagementUtils } from '../../support/utils/FileManagementUtils';
-import { ConnectEventSchemaUtils } from '../../support/utils/ConnectEventSchemaUtils';
+import { ConnectUtils } from '../../../support/utils/connect/ConnectUtils';
+import { FileManagementUtils } from '../../../support/utils/FileManagementUtils';
+import { ConnectEventSchemaUtils } from '../../../support/utils/ConnectEventSchemaUtils';
 
 describe('Connect aggregation rule transformations', () => {
     beforeEach('Setup Test', () => {
diff --git a/ui/cypress/tests/adapter/valueRules.ts b/ui/cypress/tests/adapter/rules/valueRules.ts
similarity index 50%
rename from ui/cypress/tests/adapter/valueRules.ts
rename to ui/cypress/tests/adapter/rules/valueRules.ts
index c957469ad..4cf81843e 100644
--- a/ui/cypress/tests/adapter/valueRules.ts
+++ b/ui/cypress/tests/adapter/rules/valueRules.ts
@@ -1,24 +1,24 @@
 /*
- * 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
+ *  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
+ *     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.
+ *  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/connect/ConnectUtils';
-import { FileManagementUtils } from '../../support/utils/FileManagementUtils';
-import { ConnectEventSchemaUtils } from '../../support/utils/ConnectEventSchemaUtils';
+import { ConnectUtils } from '../../../support/utils/connect/ConnectUtils';
+import { FileManagementUtils } from '../../../support/utils/FileManagementUtils';
+import { ConnectEventSchemaUtils } from '../../../support/utils/ConnectEventSchemaUtils';
 
 describe('Connect value rule transformations', () => {
     beforeEach('Setup Test', () => {