Skip to content

Commit

Permalink
Debug cypress travis issue (SAP#1097)
Browse files Browse the repository at this point in the history
  • Loading branch information
maxmarkus authored Feb 12, 2020
1 parent daffd09 commit 559fcaa
Show file tree
Hide file tree
Showing 8 changed files with 92 additions and 37 deletions.
23 changes: 9 additions & 14 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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'
Expand Down
37 changes: 34 additions & 3 deletions core/examples/luigi-sample-angular/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion core/examples/luigi-sample-angular/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 3 additions & 1 deletion core/src/App.html
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down
21 changes: 15 additions & 6 deletions core/src/navigation/services/navigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down
27 changes: 24 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 0 additions & 3 deletions test/e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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=$!
Expand Down

0 comments on commit 559fcaa

Please sign in to comment.