From 559fcaab21dd8106eb44adebdc7fe510e17bb927 Mon Sep 17 00:00:00 2001 From: Markus <1720843+maxmarkus@users.noreply.github.com> Date: Wed, 12 Feb 2020 10:30:08 +0100 Subject: [PATCH] Debug cypress travis issue (#1097) --- .travis.yml | 23 +++++------- .../luigi-sample-angular/package-lock.json | 37 +++++++++++++++++-- .../luigi-sample-angular/package.json | 2 +- core/src/App.html | 4 +- core/src/navigation/services/navigation.js | 21 ++++++++--- package-lock.json | 27 ++++++++++++-- package.json | 12 +++--- test/e2e.sh | 3 -- 8 files changed, 92 insertions(+), 37 deletions(-) diff --git a/.travis.yml b/.travis.yml index 3ca77d1b3a..7a4792396c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,7 @@ language: node_js node_js: - '11.14' #TODO: change it to 'node' once Travis supports the newest version -dist: trusty +dist: xenial cache: directories: - $TRAVIS_BUILD_DIR/client/public @@ -57,33 +57,28 @@ jobs: - rm -rf ~/.npm/_logs - rm -rf ~/.npm/_cacache - #----- UNIT ----- - # - name: 'Unit Tests' - # script: - # - echo 'core' && ls core/node_modules | wc -l && echo 'client' && ls client/node_modules | wc -l - # - npm test --prefix core - # before_cache: - # - rm -rf ~/.npm/_logs - # - rm -rf ~/.npm/_cacache - # ----- INTEGRATION ----- - &integration-testing name: 'Integration Testing' script: - export CYPRESS_CACHE_FOLDER=$TRAVIS_BUILD_DIR/cypress-binary-cache - # - npm i -g cypress cypress-plugin-retries sirv-cli + - ls $CYPRESS_CACHE_FOLDER - bash ./test/e2e.sh addons: - chrome: stable + apt: + packages: + # Ubuntu 16+ does not install this dependency by default, so we need to install it ourselves + - libgconf-2-4 + - chromium-browser=79.0.3945.130-0ubuntu0.16.04.1 # update also if you upgrade from Xenial + # chrome: stable before_install: - - google-chrome-stable --headless --disable-gpu --remote-debugging-port=9222 http://localhost & + - chromium-browser --headless --disable-gpu --remote-debugging-port=9222 http://localhost & before_cache: - rm -rf ~/.npm/_logs - rm -rf ~/.npm/_cacache - rm -rf ~/.cache/Cypress/cy/production/browsers #it is individual for each run anyway so caching it slows down the job - <<: *integration-testing - <<: *integration-testing - # - <<: *integration-testing # ----- NPM PUBLISH ----- - stage: 'Publish' diff --git a/core/examples/luigi-sample-angular/package-lock.json b/core/examples/luigi-sample-angular/package-lock.json index fd00da3def..24e5a42d22 100644 --- a/core/examples/luigi-sample-angular/package-lock.json +++ b/core/examples/luigi-sample-angular/package-lock.json @@ -2387,6 +2387,16 @@ } } }, + "@kyma-project/luigi-client": { + "version": "0.7.4", + "resolved": "https://registry.npmjs.org/@kyma-project/luigi-client/-/luigi-client-0.7.4.tgz", + "integrity": "sha512-K4BWQiyn4P/bOjPuK/L1Kdc+c0uvKQQsh8Yrrt6XfTo3bI30MYrkyz0Nu+IEZbEvKNZ3/paeZfLSZL7eqSLChQ==" + }, + "@kyma-project/luigi-core": { + "version": "0.7.4", + "resolved": "https://registry.npmjs.org/@kyma-project/luigi-core/-/luigi-core-0.7.4.tgz", + "integrity": "sha512-oBREp++OjFL4RQDhgdevmR7+1O3ll3JJ7Q3A6T5ulsluUImT06CsQXqKAXIZuwXPPVMGyC5zvr2LSy7YlsKf6Q==" + }, "@ngtools/webpack": { "version": "7.3.9", "resolved": "https://registry.npmjs.org/@ngtools/webpack/-/webpack-7.3.9.tgz", @@ -2655,6 +2665,12 @@ "integrity": "sha512-YbPXbaynBTe0pVExPhL76TsWnxSPeFAvImIsmylpBWn/yfw+lHy+Q68aawvZHsgskT44ZAoeE67GM5f+Brekew==", "dev": true }, + "@types/sizzle": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/@types/sizzle/-/sizzle-2.3.2.tgz", + "integrity": "sha512-7EJYyKTL7tFR8+gDbB6Wwz/arpGa0Mywk1TJbNzKzHtzbwVmY4HR9WqS5VV7dsBUKQmPNr192jHr/VpBluj/hg==", + "dev": true + }, "@types/source-list-map": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/@types/source-list-map/-/source-list-map-0.1.2.tgz", @@ -5047,13 +5063,14 @@ "dev": true }, "cypress": { - "version": "3.4.1", - "resolved": "https://registry.npmjs.org/cypress/-/cypress-3.4.1.tgz", - "integrity": "sha512-1HBS7t9XXzkt6QHbwfirWYty8vzxNMawGj1yI+Fu6C3/VZJ8UtUngMW6layqwYZzLTZV8tiDpdCNBypn78V4Dg==", + "version": "3.8.3", + "resolved": "https://registry.npmjs.org/cypress/-/cypress-3.8.3.tgz", + "integrity": "sha512-I9L/d+ilTPPA4vq3NC1OPKmw7jJIpMKNdyfR8t1EXYzYCjyqbc59migOm1YSse/VRbISLJ+QGb5k4Y3bz2lkYw==", "dev": true, "requires": { "@cypress/listr-verbose-renderer": "0.4.1", "@cypress/xvfb": "1.2.4", + "@types/sizzle": "2.3.2", "arch": "2.1.1", "bluebird": "3.5.0", "cachedir": "1.3.0", @@ -5062,6 +5079,7 @@ "commander": "2.15.1", "common-tags": "1.8.0", "debug": "3.2.6", + "eventemitter2": "4.1.2", "execa": "0.10.0", "executable": "4.1.1", "extract-zip": "1.6.7", @@ -5080,6 +5098,7 @@ "request-progress": "3.0.0", "supports-color": "5.5.0", "tmp": "0.1.0", + "untildify": "3.0.3", "url": "0.11.0", "yauzl": "2.10.0" }, @@ -5596,6 +5615,12 @@ "integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=", "dev": true }, + "eventemitter2": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/eventemitter2/-/eventemitter2-4.1.2.tgz", + "integrity": "sha1-DhqEd6+CGm7zmVsxG/dMI6UkfxU=", + "dev": true + }, "eventemitter3": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-3.1.2.tgz", @@ -12182,6 +12207,12 @@ } } }, + "untildify": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/untildify/-/untildify-3.0.3.tgz", + "integrity": "sha512-iSk/J8efr8uPT/Z4eSUywnqyrQU7DSdMfdqK4iWEaUVVmcP5JcnpRqmVMwcwcnmI1ATFNgC5V90u09tBynNFKA==", + "dev": true + }, "upath": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/upath/-/upath-1.1.2.tgz", diff --git a/core/examples/luigi-sample-angular/package.json b/core/examples/luigi-sample-angular/package.json index ec49064058..80e30f6a27 100644 --- a/core/examples/luigi-sample-angular/package.json +++ b/core/examples/luigi-sample-angular/package.json @@ -53,7 +53,7 @@ "babel-preset-minify": "^0.5.0", "codelyzer": "^4.4.1", "concurrently": "^4.1.0", - "cypress": "^3.4.1", + "cypress": "^3.8.2", "cypress-plugin-retries": "^1.2.0", "tar": ">=4.4.2", "ts-node": "~3.2.0", diff --git a/core/src/App.html b/core/src/App.html index e8903eb586..e5cb173f62 100644 --- a/core/src/App.html +++ b/core/src/App.html @@ -508,7 +508,9 @@ getAlertWithId(currentAlerts, settings.id) ) { console.error( - `The alert with id '${settings.id}' already exists in a queue, therefore it won't be displayed ` + `The alert with id '${ + settings.id + }' already exists in a queue, therefore it won't be displayed ` ); return Promise.reject(); } diff --git a/core/src/navigation/services/navigation.js b/core/src/navigation/services/navigation.js index 07211c09c8..c8669e6a08 100644 --- a/core/src/navigation/services/navigation.js +++ b/core/src/navigation/services/navigation.js @@ -11,20 +11,26 @@ import { LuigiConfig } from '../../core-api'; class NavigationClass { childrenProviderRequiresEvaluation(node) { - const result = node && node._childrenProvider && + const result = + node && + node._childrenProvider && (!node._childrenProviderUsed || !LuigiConfig._configModificationTimestamp || node._childrenProviderUsed < - new Date(LuigiConfig._configModificationTimestamp.getTime())) + new Date(LuigiConfig._configModificationTimestamp.getTime())); - if(result) { + if (result) { node._childrenProviderUsed = new Date(); } return result; } rootNodeRequiresEvaluation() { - const result = !this.rootNode || !this._rootNodeProviderUsed || this._rootNodeProviderUsed < new Date(LuigiConfig._configModificationTimestamp.getTime()); - if(result) { + const result = + !this.rootNode || + !this._rootNodeProviderUsed || + this._rootNodeProviderUsed < + new Date(LuigiConfig._configModificationTimestamp.getTime()); + if (result) { this._rootNodeProviderUsed = new Date(); } return result; @@ -38,7 +44,10 @@ class NavigationClass { return [{}]; } - if (this.rootNodeRequiresEvaluation() || this.childrenProviderRequiresEvaluation(this.rootNode)) { + if ( + this.rootNodeRequiresEvaluation() || + this.childrenProviderRequiresEvaluation(this.rootNode) + ) { const topNavNodes = await rootNavProviderPromise; if (GenericHelpers.isObject(topNavNodes)) { this.rootNode = topNavNodes; diff --git a/package-lock.json b/package-lock.json index 6721dca75b..5f5bff73f5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1783,6 +1783,12 @@ "integrity": "sha512-KPYGmfD0/b1eXurQ59fXD1GBzhSQfz6/lKBxkaHX9dKTzjXbK68Zt7yGUxUsCS1jeTy/8aL+d9JEr+S54mpkWQ==", "dev": true }, + "@types/sizzle": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/@types/sizzle/-/sizzle-2.3.2.tgz", + "integrity": "sha512-7EJYyKTL7tFR8+gDbB6Wwz/arpGa0Mywk1TJbNzKzHtzbwVmY4HR9WqS5VV7dsBUKQmPNr192jHr/VpBluj/hg==", + "dev": true + }, "@types/unist": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.3.tgz", @@ -3147,13 +3153,14 @@ "dev": true }, "cypress": { - "version": "3.4.1", - "resolved": "https://registry.npmjs.org/cypress/-/cypress-3.4.1.tgz", - "integrity": "sha512-1HBS7t9XXzkt6QHbwfirWYty8vzxNMawGj1yI+Fu6C3/VZJ8UtUngMW6layqwYZzLTZV8tiDpdCNBypn78V4Dg==", + "version": "3.8.3", + "resolved": "https://registry.npmjs.org/cypress/-/cypress-3.8.3.tgz", + "integrity": "sha512-I9L/d+ilTPPA4vq3NC1OPKmw7jJIpMKNdyfR8t1EXYzYCjyqbc59migOm1YSse/VRbISLJ+QGb5k4Y3bz2lkYw==", "dev": true, "requires": { "@cypress/listr-verbose-renderer": "0.4.1", "@cypress/xvfb": "1.2.4", + "@types/sizzle": "2.3.2", "arch": "2.1.1", "bluebird": "3.5.0", "cachedir": "1.3.0", @@ -3162,6 +3169,7 @@ "commander": "2.15.1", "common-tags": "1.8.0", "debug": "3.2.6", + "eventemitter2": "4.1.2", "execa": "0.10.0", "executable": "4.1.1", "extract-zip": "1.6.7", @@ -3180,6 +3188,7 @@ "request-progress": "3.0.0", "supports-color": "5.5.0", "tmp": "0.1.0", + "untildify": "3.0.3", "url": "0.11.0", "yauzl": "2.10.0" }, @@ -3211,6 +3220,12 @@ "signal-exit": "^3.0.0", "strip-eof": "^1.0.0" } + }, + "untildify": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/untildify/-/untildify-3.0.3.tgz", + "integrity": "sha512-iSk/J8efr8uPT/Z4eSUywnqyrQU7DSdMfdqK4iWEaUVVmcP5JcnpRqmVMwcwcnmI1ATFNgC5V90u09tBynNFKA==", + "dev": true } } }, @@ -3559,6 +3574,12 @@ "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", "dev": true }, + "eventemitter2": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/eventemitter2/-/eventemitter2-4.1.2.tgz", + "integrity": "sha1-DhqEd6+CGm7zmVsxG/dMI6UkfxU=", + "dev": true + }, "eventemitter3": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-3.1.2.tgz", diff --git a/package.json b/package.json index b194e78004..2c0298f1ca 100644 --- a/package.json +++ b/package.json @@ -4,18 +4,18 @@ }, "devDependencies": { "@starptech/prettyhtml": "^0.8.16", - "cypress": "^3.4.1", - "cypress-plugin-retries": "^1.2.2", + "cypress": "^3.8.3", + "cypress-plugin-retries": "^1.3.0", + "diff": ">=3.5.0", "husky": "^1.3.1", "lerna": "^3.9.0", "lerna-changelog": "^0.8.0", "lodash": ">=4.17.13", "lodash.template": ">=4.5.0", - "prettier": "^1.15.3", - "sirv-cli": "^0.4.4", - "diff": ">=3.5.0", "mixin-deep": ">=1.3.2", - "set-value": ">=2.0.1" + "prettier": "^1.15.3", + "set-value": ">=2.0.1", + "sirv-cli": "^0.4.4" }, "prettier": { "singleQuote": true diff --git a/test/e2e.sh b/test/e2e.sh index f459e200af..8009a8b2f3 100755 --- a/test/e2e.sh +++ b/test/e2e.sh @@ -4,7 +4,6 @@ BASE_DIR="$( cd "$(dirname "$0")" ; pwd -P )" # We assume, Angular example is ran with `npm run build` # and root dependencies are installed -# npm i -g cypress@^3.4.1 cypress-plugin-retries sirv-cli NG_EXAMPLE="$BASE_DIR/../core/examples/luigi-sample-angular" NG_MODULES="$NG_EXAMPLE/node_modules" if [[ ! -L $NG_MODULES ]] && [[ ! -d $NG_MODULES ]]; then @@ -14,8 +13,6 @@ fi cd $NG_EXAMPLE -# ./node_modules/cypress/bin/cypress install - echo "Starting webserver" sirv start dist --single --cors --port 4200 & WS_PID=$!