Skip to content

Commit

Permalink
Optimizing cypress/drone setup (#39019)
Browse files Browse the repository at this point in the history
* Optimizing cypress/drone setup

* Fix

* More fix

* Updating joomla-cypress to 0.0.16

* Updating cypress to 10.10.0

* Cleaning up drone

* Fixing drone.yml

* Cypress: Catch uncaught exceptions
  • Loading branch information
Hackwar committed Oct 22, 2022
1 parent 1968dc3 commit 6f6d110
Show file tree
Hide file tree
Showing 5 changed files with 73 additions and 96 deletions.
131 changes: 51 additions & 80 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -202,176 +202,144 @@ steps:
commands:
- npm run lint:js

- name: prepare_codeception_tests
- name: prepare_system_tests
depends_on:
- npm
image: joomlaprojects/docker-images:systemtests
volumes:
- name: cypress-cache
path: /root/.cache/Cypress
commands:
- sed -i 's/tests\\/Codeception\\/_output/\\/drone\\/src\\/tests\\/Codeception\\/_output/' codeception.yml
- sed -i 's/tests\\/Codeception\\/_output/\\/drone\\/src\\/tests\\/cypress\\/output/' codeception.yml
- php libraries/vendor/bin/codecept build
- npx cypress install
- npx cypress verify

- name: phpmin-api-mysql
depends_on:
- prepare_codeception_tests
- prepare_system_tests
image: joomlaprojects/docker-images:systemtests
environment:
JOOMLA_INSTALLATION_DISABLE_LOCALHOST_CHECK: 1
commands:
- bash tests/Codeception/drone-api-run.sh "$(pwd)" mysql mysqli mysql jos_

- name: phpmax-api-mysql
- name: phpmin-api-postgres
depends_on:
- prepare_codeception_tests
image: joomlaprojects/docker-images:systemtests8.1
- prepare_system_tests
image: joomlaprojects/docker-images:systemtests
environment:
JOOMLA_INSTALLATION_DISABLE_LOCALHOST_CHECK: 1
commands:
- bash tests/Codeception/drone-api-run.sh "$(pwd)" mysqlphpmax mysqli mysql phpmax_

# - name: phpnext-api-mysql
# depends_on:
# - phpmax-api-mysql
# image: joomlaprojects/docker-images:systemtests8.2
# failure: ignore
# environment:
# JOOMLA_INSTALLATION_DISABLE_LOCALHOST_CHECK: 1
# commands:
# - bash tests/Codeception/drone-api-run.sh "$(pwd)" mysqlphpnext mysqli mysql8 phpmax_
- bash tests/Codeception/drone-api-run.sh "$(pwd)" postgres pgsql postgres jos_

- name: phpmin-api-postgres
- name: phpmax-api-mysql
depends_on:
- phpmin-api-mysql
- phpmax-api-mysql
image: joomlaprojects/docker-images:systemtests
- phpmin-api-postgres
image: joomlaprojects/docker-images:systemtests8.1
environment:
JOOMLA_INSTALLATION_DISABLE_LOCALHOST_CHECK: 1
commands:
- bash tests/Codeception/drone-api-run.sh "$(pwd)" postgres pgsql postgres jos_
- bash tests/Codeception/drone-api-run.sh "$(pwd)" mysqlphpmax mysqli mysql phpmax_

- name: phpmax-api-postgres
depends_on:
- phpmin-api-mysql
- phpmax-api-mysql
- phpmin-api-postgres
image: joomlaprojects/docker-images:systemtests8.1
environment:
JOOMLA_INSTALLATION_DISABLE_LOCALHOST_CHECK: 1
commands:
- bash tests/Codeception/drone-api-run.sh "$(pwd)" postgresphpmax pgsql postgres phpmax_

# - name: phpnext-api-postgres
# depends_on:
# - phpmin-api-postgres
# image: joomlaprojects/docker-images:systemtests8.2
# failure: ignore
# environment:
# JOOMLA_INSTALLATION_DISABLE_LOCALHOST_CHECK: 1
# commands:
# - bash tests/Codeception/drone-api-run.sh "$(pwd)" postgresphpnext pgsql postgres

- name: phpmin-system-mysql
depends_on:
- phpmin-api-postgres
- phpmax-api-mysql
- phpmax-api-postgres
image: joomlaprojects/docker-images:cypress
volumes:
- name: cypress-cache
path: /root/.cache/Cypress
environment:
JOOMLA_INSTALLATION_DISABLE_LOCALHOST_CHECK: 1
commands:
- bash tests/cypress/drone-system-run.sh "$(pwd)" cmysql mysqli mysql

- name: phpmax-system-mysql
- name: phpmin-system-postgres
depends_on:
- phpmin-api-postgres
- phpmax-api-mysql
- phpmax-api-postgres
image: joomlaprojects/docker-images:cypress8.1
image: joomlaprojects/docker-images:cypress
volumes:
- name: cypress-cache
path: /root/.cache/Cypress
environment:
JOOMLA_INSTALLATION_DISABLE_LOCALHOST_CHECK: 1
commands:
- bash tests/cypress/drone-system-run.sh "$(pwd)" cmysqlmax mysqli mysql

# - name: phpnext-system-mysql
# depends_on:
# - phpmax-system-mysql
# image: joomlaprojects/docker-images:systemtests8.2
# failure: ignore
# environment:
# JOOMLA_INSTALLATION_DISABLE_LOCALHOST_CHECK: 1
# commands:
# - bash tests/Codeception/drone-system-run.sh "$(pwd)" mysqlphpnext
- bash tests/cypress/drone-system-run.sh "$(pwd)" cpostgres pgsql postgres

- name: phpmin-system-postgres
- name: phpmax-system-mysql
depends_on:
- phpmin-system-mysql
- phpmax-system-mysql
image: joomlaprojects/docker-images:cypress
- phpmin-system-postgres
image: joomlaprojects/docker-images:cypress8.1
volumes:
- name: cypress-cache
path: /root/.cache/Cypress
environment:
JOOMLA_INSTALLATION_DISABLE_LOCALHOST_CHECK: 1
commands:
- bash tests/cypress/drone-system-run.sh "$(pwd)" cpostgres pgsql postgres
- bash tests/cypress/drone-system-run.sh "$(pwd)" cmysqlmax mysqli mysql

- name: phpmax-system-postgres
depends_on:
- phpmin-system-mysql
- phpmax-system-mysql
- phpmin-system-postgres
image: joomlaprojects/docker-images:cypress8.1
volumes:
- name: cypress-cache
path: /root/.cache/Cypress
environment:
JOOMLA_INSTALLATION_DISABLE_LOCALHOST_CHECK: 1
commands:
- bash tests/cypress/drone-system-run.sh "$(pwd)" cpostgresmax pgsql postgres

# - name: phpnext-system-postgres
# depends_on:
# - phpmax-system-postgres
# image: joomlaprojects/docker-images:systemtests8.2
# failure: ignore
# environment:
# JOOMLA_INSTALLATION_DISABLE_LOCALHOST_CHECK: 1
# commands:
# - bash tests/Codeception/drone-system-run.sh "$(pwd)" postgresphpnext

- name: phpmin-system-mysql8
depends_on:
- phpmin-system-postgres
- phpmax-system-mysql
- phpmax-system-postgres
image: joomlaprojects/docker-images:cypress
volumes:
- name: cypress-cache
path: /root/.cache/Cypress
environment:
JOOMLA_INSTALLATION_DISABLE_LOCALHOST_CHECK: 1
commands:
- bash tests/cypress/drone-system-run.sh "$(pwd)" cmysql8 mysqli mysql8

- name: phpmax-system-mysql8
depends_on:
- phpmin-system-postgres
- phpmax-system-mysql
- phpmax-system-postgres
image: joomlaprojects/docker-images:cypress8.1
volumes:
- name: cypress-cache
path: /root/.cache/Cypress
environment:
JOOMLA_INSTALLATION_DISABLE_LOCALHOST_CHECK: 1
commands:
- bash tests/cypress/drone-system-run.sh "$(pwd)" cmysql8max mysqli mysql8

# - name: phpnext-system-mysql8
# depends_on:
# - phpmax-system-mysql8
# image: joomlaprojects/docker-images:systemtests8.2
# failure: ignore
# environment:
# JOOMLA_INSTALLATION_DISABLE_LOCALHOST_CHECK: 1
# commands:
# - bash tests/Codeception/drone-system-run.sh "$(pwd)" mysql8phpnext

- name: artifacts-system-tests
image: cschlosser/drone-ftps
depends_on:
# - phpnext-system-mysql
# - phpnext-system-mysql8
# - phpnext-system-postgres
- phpmax-system-mysql
- phpmax-system-mysql8
- phpmax-system-postgres
- phpmin-system-mysql
- phpmin-system-mysql8
- phpmin-system-postgres
# - phpnext-api-mysql
# - phpnext-api-postgres
- phpmax-api-mysql
- phpmax-api-postgres
- phpmin-api-mysql
Expand All @@ -398,6 +366,9 @@ volumes:
- name: composer-cache
host:
path: /tmp/composer-cache
- name: cypress-cache
host:
path: /tmp/cypress-cache
- name: npm-cache
host:
path: /tmp/npm-cache
Expand Down Expand Up @@ -526,6 +497,6 @@ trigger:

---
kind: signature
hmac: 359a89523ab3cad86567d31853fbc42a127154d0a5a902a91891bbd39d4cb7c5
hmac: a7eafe0d90f40df73bfee7243ef5e4d2e0953bee739864b7d16d0dc19e06dd2d

...
26 changes: 13 additions & 13 deletions 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 package.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
"fs-extra": "^10.0.0",
"ini": "^2.0.0",
"jasmine-core": "^3.10.1",
"joomla-cypress": "^0.0.15",
"joomla-cypress": "^0.0.16",
"karma": "^6.3.14",
"karma-coverage": "^2.1.0",
"karma-firefox-launcher": "^2.1.2",
Expand Down
4 changes: 2 additions & 2 deletions tests/cypress/drone-system-run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ chmod +rwx /root

#export CYPRESS_CACHE_FOLDER=/tests/www/$DB_ENGINE/.cache

npx cypress install
npx cypress verify
#npx cypress install
#npx cypress verify
npx cypress run --browser=firefox --e2e --env db_type=$DB_ENGINE,db_host=$DB_HOST,db_password=joomla_ut,db_prefix="${TEST_GROUP}_" --config baseUrl=http://localhost/$TEST_GROUP,screenshotsFolder=$JOOMLA_BASE/tests/cypress/output/screenshots

6 changes: 6 additions & 0 deletions tests/cypress/support/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,10 @@ before(function() {
const {registerCommands} = require('../../../node_modules/joomla-cypress/src/index.js')

registerCommands()

Cypress.on('uncaught:exception', (err, runnable) => {
console.log("err :" + err)
console.log("runnable :" + runnable)
return false
})
})

0 comments on commit 6f6d110

Please sign in to comment.