Skip to content

Commit 0a29104

Browse files
committed
Fixing cypress system tests
1 parent 6d34a9f commit 0a29104

File tree

2 files changed

+30
-25
lines changed

2 files changed

+30
-25
lines changed

.drone.yml

Lines changed: 28 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ steps:
2121
- echo $(date)
2222

2323
- name: npm
24-
image: node:16-bullseye-slim
24+
image: node:20-bullseye-slim
2525
depends_on: [ phpcs ]
2626
volumes:
2727
- name: npm-cache
@@ -33,7 +33,7 @@ steps:
3333

3434
- name: prepare_system_tests
3535
depends_on: [ npm ]
36-
image: joomlaprojects/docker-images:systemtests
36+
image: joomlaprojects/docker-images:cypress8.2
3737
volumes:
3838
- name: cypress-cache
3939
path: /root/.cache/Cypress
@@ -57,7 +57,7 @@ steps:
5757

5858
- name: phpmin-system-mysql
5959
depends_on: [ prepare_system_tests ]
60-
image: joomlaprojects/docker-images:cypress
60+
image: joomlaprojects/docker-images:cypress8.2
6161
volumes:
6262
- name: cypress-cache
6363
path: /root/.cache/Cypress
@@ -69,7 +69,7 @@ steps:
6969
- unzip joomla.zip
7070
- apache2ctl -D FOREGROUND &
7171
- chmod +rwx /root
72-
- php installation/joomla.php install --verbose --site-name="Joomla CMS test" [email protected] --admin-username=ci-admin --admin-user="jane doe" --admin-password=joomla-17082005 --db-type=mysqli --db-host=mysql --db-name=test_joomla --db-pass=joomla_ut --db-user=root --db-encryption=0 --db-prefix=mysql_
72+
- php installation/joomla.php install --verbose --site-name="Joomla CMS test" [email protected] --admin-username=ci-admin --admin-user="jane doe" --admin-password=joomla-17082005 --db-type=mysqli --db-host=mysql --db-name=test_joomla --db-pass=joomla_ut --db-user=joomla_ut --db-encryption=0 --db-prefix=mysql_
7373
- php cli/joomla.php config:set debug=true error_reporting=maximum
7474
- php cli/joomla.php extension:install --path=/tests/www/mysql/pkg-weblinks-current.zip
7575
- chmod -R 777 /tests/www/mysql/
@@ -82,19 +82,31 @@ steps:
8282
depends_on:
8383
- phpmin-system-mysql
8484
environment:
85-
FTP_USERNAME:
86-
from_secret: ftpusername
87-
FTP_PASSWORD:
88-
from_secret: ftppassword
85+
WEB_SERVER:
86+
from_secret: webserver
87+
FTP_KEY:
88+
from_secret: ftp_key
89+
FTP_USER:
90+
from_secret: ftp_user
91+
FTP_HOST:
92+
from_secret: ftp_host
93+
ARTIFACTS_ROOT:
94+
from_secret: artifacts_root
8995
GITHUB_TOKEN:
9096
from_secret: github_token
9197
commands:
92-
- export PLUGIN_DEST_DIR=/artifacts/$DRONE_REPO/$DRONE_BRANCH/$DRONE_PULL_REQUEST/system-tests/$DRONE_BUILD_NUMBER
93-
- echo https://ci.joomla.org$PLUGIN_DEST_DIR
94-
- rclone config create artifacts ftp host ci.joomla.org user $FTP_USERNAME port 21 pass $FTP_PASSWORD
95-
- rclone mkdir artifacts:$PLUGIN_DEST_DIR
96-
- rclone copy tests/cypress/output/ artifacts:$PLUGIN_DEST_DIR
97-
- 'curl -X POST "https://api.github.com/repos/$DRONE_REPO/statuses/$DRONE_COMMIT" -H "Content-Type: application/json" -H "Authorization: token $GITHUB_TOKEN" -d "{\"state\":\"failure\", \"context\": \"Artifacts from Failure\", \"description\": \"You can find artifacts from the failure of the build here:\", \"target_url\": \"https://ci.joomla.org$PLUGIN_DEST_DIR\"}" > /dev/null'
98+
- export PLUGIN_DEST_DIR=$DRONE_REPO/$DRONE_BRANCH/$DRONE_PULL_REQUEST/system-tests/$DRONE_BUILD_NUMBER
99+
- echo https://$WEB_SERVER/drone/$PLUGIN_DEST_DIR
100+
- mkdir -p ~/.ssh
101+
- eval $(ssh-agent -s)
102+
- echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config
103+
- echo "$FTP_KEY" > ~/.ssh/id_rsa
104+
- chmod 600 ~/.ssh/id_rsa
105+
- ssh-add
106+
- rclone config create artifacts sftp host $FTP_HOST user $FTP_USER port 22
107+
- rclone mkdir artifacts:$ARTIFACTS_ROOT/$DRONE_REPO/$DRONE_BRANCH/$DRONE_PULL_REQUEST/system-tests/$DRONE_BUILD_NUMBER
108+
- rclone copy tests/cypress/output/ artifacts:$ARTIFACTS_ROOT/$DRONE_REPO/$DRONE_BRANCH/$DRONE_PULL_REQUEST/system-tests/$DRONE_BUILD_NUMBER
109+
- 'curl -X POST "https://api.github.com/repos/$DRONE_REPO/statuses/$DRONE_COMMIT" -H "Content-Type: application/json" -H "Authorization: token $GITHUB_TOKEN" -d "{\"state\":\"failure\", \"context\": \"Artifacts from Failure\", \"description\": \"You can find artifacts from the failure of the build here:\", \"target_url\": \"https://$WEB_SERVER/drone/$PLUGIN_DEST_DIR\"}" > /dev/null'
98110
when:
99111
status:
100112
- failure
@@ -115,15 +127,7 @@ volumes:
115127

116128
services:
117129
- name: mysql
118-
image: mysql:5.7
119-
environment:
120-
MYSQL_USER: joomla_ut
121-
MYSQL_PASSWORD: joomla_ut
122-
MYSQL_ROOT_PASSWORD: joomla_ut
123-
MYSQL_DATABASE: test_joomla
124-
125-
- name: mysql8
126-
image: mysql:8
130+
image: mysql:8.0
127131
command: ["--default-authentication-plugin=mysql_native_password"]
128132
environment:
129133
MYSQL_USER: joomla_ut
@@ -142,6 +146,6 @@ services:
142146

143147
---
144148
kind: signature
145-
hmac: 1a3e42b169ad2df6a065972457beea9ecbae1dbf0f9a94cb21c27fa416f773ed
149+
hmac: 1190d2e4eaeb72929792b0cf79a9f08f534ddd34b0febf4244c82b51197e5e69
146150

147151
...

tests/cypress/integration/install/install.cy.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33

44
describe('Install Joomla and Weblinks package', () => {
55
it('Install Joomla and Weblinks package', function () {
6-
cy.doAdministratorLogin(Cypress.env('username'), Cypress.env('password'))
6+
cy.doAdministratorLogin(Cypress.env('username'), Cypress.env('password'), false)
7+
cy.cancelTour();
78
cy.disableStatistics()
89
cy.setErrorReportingToDevelopment()
910
cy.doAdministratorLogout()

0 commit comments

Comments
 (0)