From 9db59774b74ce53fcace3d5a154bd4e0f84cea76 Mon Sep 17 00:00:00 2001 From: Allon Moritz Date: Tue, 11 Feb 2025 09:15:58 +0100 Subject: [PATCH 01/28] Test on ssl --- cypress.config.dist.mjs | 14 +++++++++++++- tests/System/drone-system-run.sh | 2 +- .../System/integration/install/Installation.cy.js | 1 + 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/cypress.config.dist.mjs b/cypress.config.dist.mjs index 6082c0921a332..35f222b8ad6e2 100644 --- a/cypress.config.dist.mjs +++ b/cypress.config.dist.mjs @@ -11,7 +11,7 @@ export default defineConfig({ setupNodeEvents(on, config) { setupPlugins(on, config); }, - baseUrl: 'http://localhost/', + baseUrl: 'https://localhost/', specPattern: [ 'tests/System/integration/install/**/*.cy.{js,jsx,ts,tsx}', 'tests/System/integration/administrator/**/*.cy.{js,jsx,ts,tsx}', @@ -43,4 +43,16 @@ export default defineConfig({ smtp_port: '1025', cmsPath: '.', }, + clientCertificates: [ + { + url: 'https://localhost', + ca: ['certs/ca.pem'], + certs: [ + { + cert: '/tests/keys/server.crt', + key: '/tests/keys/server.key', + }, + ], + }, + ] }); diff --git a/tests/System/drone-system-run.sh b/tests/System/drone-system-run.sh index 823b8f08c598e..6fdfd7f771c5d 100644 --- a/tests/System/drone-system-run.sh +++ b/tests/System/drone-system-run.sh @@ -24,4 +24,4 @@ apache2ctl -D FOREGROUND & echo "[RUNNER] Run cypress tests" chmod +rwx /root -npx cypress run --browser=firefox --e2e --env cmsPath=/tests/www/$TEST_GROUP,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/System/output/screenshots +npx cypress run --browser=firefox --e2e --env cmsPath=/tests/www/$TEST_GROUP,db_type=$DB_ENGINE,db_host=$DB_HOST,db_password=joomla_ut,db_prefix="${TEST_GROUP}_" --config baseUrl=https://localhost/$TEST_GROUP,screenshotsFolder=$JOOMLA_BASE/tests/System/output/screenshots diff --git a/tests/System/integration/install/Installation.cy.js b/tests/System/integration/install/Installation.cy.js index 2a5909f7c0c8a..e2e04997da1c8 100644 --- a/tests/System/integration/install/Installation.cy.js +++ b/tests/System/integration/install/Installation.cy.js @@ -33,5 +33,6 @@ describe('Install Joomla', () => { cy.config_setParameter('mailer', 'smtp'); cy.config_setParameter('smtphost', Cypress.env('smtp_host')); cy.config_setParameter('smtpport', Cypress.env('smtp_port')); + cy.config_setParameter('force_ssl', '2'); }); }); From 9a1945ed467778f512fd2a7417e050a7da6a0a86 Mon Sep 17 00:00:00 2001 From: Allon Moritz Date: Tue, 11 Feb 2025 09:22:48 +0100 Subject: [PATCH 02/28] cs --- cypress.config.dist.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cypress.config.dist.mjs b/cypress.config.dist.mjs index 35f222b8ad6e2..f62c2ef782a87 100644 --- a/cypress.config.dist.mjs +++ b/cypress.config.dist.mjs @@ -54,5 +54,5 @@ export default defineConfig({ }, ], }, - ] + ], }); From ab4c16f6387c918966b788437476aad1cb41fbbd Mon Sep 17 00:00:00 2001 From: Allon Moritz Date: Tue, 11 Feb 2025 09:47:58 +0100 Subject: [PATCH 03/28] relative --- cypress.config.dist.mjs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cypress.config.dist.mjs b/cypress.config.dist.mjs index f62c2ef782a87..d0a3fb3c3def2 100644 --- a/cypress.config.dist.mjs +++ b/cypress.config.dist.mjs @@ -49,8 +49,8 @@ export default defineConfig({ ca: ['certs/ca.pem'], certs: [ { - cert: '/tests/keys/server.crt', - key: '/tests/keys/server.key', + cert: '../keys/server.crt', + key: '../keys/server.key', }, ], }, From fbebaecb5d2d15dcd72120cb8df674b0103d84aa Mon Sep 17 00:00:00 2001 From: Allon Moritz Date: Tue, 11 Feb 2025 13:52:51 +0100 Subject: [PATCH 04/28] no ca --- cypress.config.dist.mjs | 1 - 1 file changed, 1 deletion(-) diff --git a/cypress.config.dist.mjs b/cypress.config.dist.mjs index d0a3fb3c3def2..7a3058eef0645 100644 --- a/cypress.config.dist.mjs +++ b/cypress.config.dist.mjs @@ -46,7 +46,6 @@ export default defineConfig({ clientCertificates: [ { url: 'https://localhost', - ca: ['certs/ca.pem'], certs: [ { cert: '../keys/server.crt', From d0e3c172d401ec0610faf8a6674b4ba1d0f9cb41 Mon Sep 17 00:00:00 2001 From: Allon Moritz Date: Tue, 11 Feb 2025 14:01:51 +0100 Subject: [PATCH 05/28] up --- cypress.config.dist.mjs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cypress.config.dist.mjs b/cypress.config.dist.mjs index 7a3058eef0645..4df00c5a7a7ff 100644 --- a/cypress.config.dist.mjs +++ b/cypress.config.dist.mjs @@ -48,8 +48,8 @@ export default defineConfig({ url: 'https://localhost', certs: [ { - cert: '../keys/server.crt', - key: '../keys/server.key', + cert: '../../keys/server.crt', + key: '../../keys/server.key', }, ], }, From 39f74505c7fb437b03f10eb13567cd96ff6169af Mon Sep 17 00:00:00 2001 From: Allon Moritz Date: Tue, 11 Feb 2025 14:28:33 +0100 Subject: [PATCH 06/28] debug --- tests/System/drone-system-run.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/System/drone-system-run.sh b/tests/System/drone-system-run.sh index 6fdfd7f771c5d..468040ee0fccf 100644 --- a/tests/System/drone-system-run.sh +++ b/tests/System/drone-system-run.sh @@ -24,4 +24,7 @@ apache2ctl -D FOREGROUND & echo "[RUNNER] Run cypress tests" chmod +rwx /root +pwd +ls -la + npx cypress run --browser=firefox --e2e --env cmsPath=/tests/www/$TEST_GROUP,db_type=$DB_ENGINE,db_host=$DB_HOST,db_password=joomla_ut,db_prefix="${TEST_GROUP}_" --config baseUrl=https://localhost/$TEST_GROUP,screenshotsFolder=$JOOMLA_BASE/tests/System/output/screenshots From 44bda357d12fb474be6a6b584b5e72e5691e2a5d Mon Sep 17 00:00:00 2001 From: Allon Moritz Date: Tue, 11 Feb 2025 14:55:31 +0100 Subject: [PATCH 07/28] path --- cypress.config.dist.mjs | 4 ++-- tests/System/drone-system-run.sh | 3 --- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/cypress.config.dist.mjs b/cypress.config.dist.mjs index 4df00c5a7a7ff..ef9dab7200280 100644 --- a/cypress.config.dist.mjs +++ b/cypress.config.dist.mjs @@ -48,8 +48,8 @@ export default defineConfig({ url: 'https://localhost', certs: [ { - cert: '../../keys/server.crt', - key: '../../keys/server.key', + cert: '../../tests/keys/server.crt', + key: '../../tests/keys/server.key', }, ], }, diff --git a/tests/System/drone-system-run.sh b/tests/System/drone-system-run.sh index 468040ee0fccf..6fdfd7f771c5d 100644 --- a/tests/System/drone-system-run.sh +++ b/tests/System/drone-system-run.sh @@ -24,7 +24,4 @@ apache2ctl -D FOREGROUND & echo "[RUNNER] Run cypress tests" chmod +rwx /root -pwd -ls -la - npx cypress run --browser=firefox --e2e --env cmsPath=/tests/www/$TEST_GROUP,db_type=$DB_ENGINE,db_host=$DB_HOST,db_password=joomla_ut,db_prefix="${TEST_GROUP}_" --config baseUrl=https://localhost/$TEST_GROUP,screenshotsFolder=$JOOMLA_BASE/tests/System/output/screenshots From dd6b4fd1c6d78cecf127e6ef56706e5f5718ecc6 Mon Sep 17 00:00:00 2001 From: Allon Moritz Date: Wed, 12 Feb 2025 11:53:40 +0100 Subject: [PATCH 08/28] add docker compose file to run the drone environment locally --- tests/System/docker-compose.yml | 38 ++++++++++++++++++++++++++++++++ tests/System/drone-system-run.sh | 11 +++++++++ 2 files changed, 49 insertions(+) create mode 100644 tests/System/docker-compose.yml diff --git a/tests/System/docker-compose.yml b/tests/System/docker-compose.yml new file mode 100644 index 0000000000000..5990dc4791f5f --- /dev/null +++ b/tests/System/docker-compose.yml @@ -0,0 +1,38 @@ +services: + system-tests: + image: joomlaprojects/docker-images:cypress8.4 + environment: + CYPRESS_VERIFY_TIMEOUT: 100000 + JOOMLA_INSTALLATION_DISABLE_LOCALHOST_CHECK: 1 + entrypoint: bash /app/tests/System/drone-system-run.sh /app j mysqli mysql + depends_on: + - phpmyadmin + ports: + - 8080:80 + - 8443:443 + volumes: + - ../..:/app + - /tmp/cypress-cache:/root/.cache/Cypress + working_dir: /app + + mysql: + image: mysql:8.3 + environment: + MYSQL_USER: joomla_ut + MYSQL_PASSWORD: joomla_ut + MYSQL_ROOT_PASSWORD: joomla_ut + MYSQL_DATABASE: test_joomla + command: --default-authentication-plugin=mysql_native_password + tmpfs: + - /var/lib/mysql + + phpmyadmin: + image: phpmyadmin/phpmyadmin + environment: + PMA_HOST: mysql + PMA_USER: joomla_ut + PMA_PASSWORD: joomla_ut + depends_on: + - mysql + ports: + - 8081:80 diff --git a/tests/System/drone-system-run.sh b/tests/System/drone-system-run.sh index 6fdfd7f771c5d..58ec12daff0dd 100644 --- a/tests/System/drone-system-run.sh +++ b/tests/System/drone-system-run.sh @@ -24,4 +24,15 @@ apache2ctl -D FOREGROUND & echo "[RUNNER] Run cypress tests" chmod +rwx /root +# Copy the cypress config if it doesn't exist +if [ ! -f cypress.config.mjs ]; then + cp cypress.config.dist.mjs cypress.config.mjs +fi + +# Do an install if the cache folder is empty +if [ -z "$( ls -A '/root/.cache/Cypress' )" ]; then + npx cypress install + npx cypress verify +fi + npx cypress run --browser=firefox --e2e --env cmsPath=/tests/www/$TEST_GROUP,db_type=$DB_ENGINE,db_host=$DB_HOST,db_password=joomla_ut,db_prefix="${TEST_GROUP}_" --config baseUrl=https://localhost/$TEST_GROUP,screenshotsFolder=$JOOMLA_BASE/tests/System/output/screenshots From d3a3364dbda9f78505f9293bab7d312b95f7aa85 Mon Sep 17 00:00:00 2001 From: Allon Moritz Date: Wed, 12 Feb 2025 12:02:59 +0100 Subject: [PATCH 09/28] Enable PHP 8.4 in system tests --- .drone.yml | 46 ++++------------------------------------------ 1 file changed, 4 insertions(+), 42 deletions(-) diff --git a/.drone.yml b/.drone.yml index 9195a9e446e00..dadd31de2e634 100644 --- a/.drone.yml +++ b/.drone.yml @@ -128,7 +128,7 @@ steps: - name: prepare_system_tests depends_on: - npm - image: joomlaprojects/docker-images:cypress8.1 + image: joomlaprojects/docker-images:cypress8.4 volumes: - name: cypress-cache path: /root/.cache/Cypress @@ -154,7 +154,7 @@ steps: - name: phpmax-system-mysql depends_on: - phpmin-system-mysql - image: joomlaprojects/docker-images:cypress8.2 + image: joomlaprojects/docker-images:cypress8.4 volumes: - name: cypress-cache path: /root/.cache/Cypress @@ -167,25 +167,6 @@ steps: exclude: - pull_request - - name: phpnext-system-mysql - depends_on: - - phpmax-system-mysql - image: joomlaprojects/docker-images:cypress8.3 - volumes: - - name: cypress-cache - path: /root/.cache/Cypress - environment: - JOOMLA_INSTALLATION_DISABLE_LOCALHOST_CHECK: 1 - failure: ignore - commands: - - echo "This test is disabled because php next is not stable yet" - - exit 1 - - bash tests/System/drone-system-run.sh "$(pwd)" cmysqlnext mysqli mysql - when: - event: - exclude: - - pull_request - - name: phpmin-system-postgres depends_on: - prepare_system_tests @@ -205,7 +186,7 @@ steps: - name: phpmax-system-postgres depends_on: - phpmin-system-postgres - image: joomlaprojects/docker-images:cypress8.2 + image: joomlaprojects/docker-images:cypress8.4 volumes: - name: cypress-cache path: /root/.cache/Cypress @@ -214,25 +195,6 @@ steps: commands: - bash tests/System/drone-system-run.sh "$(pwd)" cpostgresmax pgsql postgres - - name: phpnext-system-postgres - depends_on: - - phpmax-system-postgres - image: joomlaprojects/docker-images:cypress8.3 - volumes: - - name: cypress-cache - path: /root/.cache/Cypress - environment: - JOOMLA_INSTALLATION_DISABLE_LOCALHOST_CHECK: 1 - failure: ignore - commands: - - echo "This test is disabled because php next is not stable yet" - - exit 1 - - bash tests/System/drone-system-run.sh "$(pwd)" cpostgresnext pgsql postgres - when: - event: - exclude: - - pull_request - - name: artifacts-system-tests image: joomlaprojects/docker-images:packager depends_on: @@ -433,6 +395,6 @@ trigger: --- kind: signature -hmac: 1d94d558654c2898eea3360184eede03be6b48154c110579fe0254ea0780d91a +hmac: 36e458096836b92a4c222b88d4fa694ae72551a160a5af411eff171dfefe5229 ... From d3a90c28e943f3b7865efea94dc53f7d913476d8 Mon Sep 17 00:00:00 2001 From: Allon Moritz Date: Wed, 12 Feb 2025 12:05:03 +0100 Subject: [PATCH 10/28] Remove references --- .drone.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.drone.yml b/.drone.yml index dadd31de2e634..b30e47223aeda 100644 --- a/.drone.yml +++ b/.drone.yml @@ -198,8 +198,6 @@ steps: - name: artifacts-system-tests image: joomlaprojects/docker-images:packager depends_on: - - phpnext-system-mysql - - phpnext-system-postgres - phpmax-system-mysql - phpmax-system-postgres - phpmin-system-mysql @@ -395,6 +393,6 @@ trigger: --- kind: signature -hmac: 36e458096836b92a4c222b88d4fa694ae72551a160a5af411eff171dfefe5229 +hmac: 0af8b9f980fc2e220f8fdb4a0824f8e4e3adfdc44706d9930f8a588cbedb58df ... From c3e1496998b999a44e70e55aaee41828ab8ad027 Mon Sep 17 00:00:00 2001 From: Allon Moritz Date: Wed, 12 Feb 2025 12:12:56 +0100 Subject: [PATCH 11/28] test without certs in config --- cypress.config.dist.mjs | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/cypress.config.dist.mjs b/cypress.config.dist.mjs index ef9dab7200280..e69abca8a4e9c 100644 --- a/cypress.config.dist.mjs +++ b/cypress.config.dist.mjs @@ -43,15 +43,4 @@ export default defineConfig({ smtp_port: '1025', cmsPath: '.', }, - clientCertificates: [ - { - url: 'https://localhost', - certs: [ - { - cert: '../../tests/keys/server.crt', - key: '../../tests/keys/server.key', - }, - ], - }, - ], }); From 56a67ec707c00cefaff9a1e48ff0146eea56c404 Mon Sep 17 00:00:00 2001 From: Allon Moritz Date: Wed, 12 Feb 2025 12:19:11 +0100 Subject: [PATCH 12/28] restore --- .drone.yml | 42 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index b30e47223aeda..1992c578fc2ff 100644 --- a/.drone.yml +++ b/.drone.yml @@ -167,6 +167,25 @@ steps: exclude: - pull_request + - name: phpnext-system-mysql + depends_on: + - phpmax-system-mysql + image: joomlaprojects/docker-images:cypress8.4 + volumes: + - name: cypress-cache + path: /root/.cache/Cypress + environment: + JOOMLA_INSTALLATION_DISABLE_LOCALHOST_CHECK: 1 + failure: ignore + commands: + - echo "This test is disabled because php next is not stable yet" + - exit 1 + - bash tests/System/drone-system-run.sh "$(pwd)" cmysqlnext mysqli mysql + when: + event: + exclude: + - pull_request + - name: phpmin-system-postgres depends_on: - prepare_system_tests @@ -195,9 +214,30 @@ steps: commands: - bash tests/System/drone-system-run.sh "$(pwd)" cpostgresmax pgsql postgres + - name: phpnext-system-postgres + depends_on: + - phpmax-system-postgres + image: joomlaprojects/docker-images:cypress8.4 + volumes: + - name: cypress-cache + path: /root/.cache/Cypress + environment: + JOOMLA_INSTALLATION_DISABLE_LOCALHOST_CHECK: 1 + failure: ignore + commands: + - echo "This test is disabled because php next is not stable yet" + - exit 1 + - bash tests/System/drone-system-run.sh "$(pwd)" cpostgresnext pgsql postgres + when: + event: + exclude: + - pull_request + - name: artifacts-system-tests image: joomlaprojects/docker-images:packager depends_on: + - phpnext-system-mysql + - phpnext-system-postgres - phpmax-system-mysql - phpmax-system-postgres - phpmin-system-mysql @@ -393,6 +433,6 @@ trigger: --- kind: signature -hmac: 0af8b9f980fc2e220f8fdb4a0824f8e4e3adfdc44706d9930f8a588cbedb58df +hmac: f4ed6f30d2a49d0c76ddfe207c0b7352bc4228eaeb5514c635dd9f42dcb07c8a ... From 71c6fe75297e03d2d8b818176762292d46c625dc Mon Sep 17 00:00:00 2001 From: Allon Moritz Date: Wed, 12 Feb 2025 12:20:21 +0100 Subject: [PATCH 13/28] sign --- .drone.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index 1992c578fc2ff..87cc6b3b0ba63 100644 --- a/.drone.yml +++ b/.drone.yml @@ -433,6 +433,6 @@ trigger: --- kind: signature -hmac: f4ed6f30d2a49d0c76ddfe207c0b7352bc4228eaeb5514c635dd9f42dcb07c8a +hmac: efb4bb61f745e54bcc9aed7155b1eea9447814ff31ce389a3c2cd6b006e8cfbc ... From 74d3b14589381c34268a3c895742df80007e4be1 Mon Sep 17 00:00:00 2001 From: Allon Moritz Date: Wed, 12 Feb 2025 13:13:55 +0100 Subject: [PATCH 14/28] docs --- tests/System/README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/System/README.md b/tests/System/README.md index 75695357395d7..6a9d0ef561c2b 100644 --- a/tests/System/README.md +++ b/tests/System/README.md @@ -326,3 +326,10 @@ If you encounter the following error while running the System Tests on slow mach ... } ``` + +## Docker +The system tests can also be executed in headless mode with dpcker compose. The following command starts the system tests from the current docker-compose.yml file: + +`docker compose up system-tests` + +The database is used with a temporary filesystem, so the data gets always deleted when the tests are started, therefor the installation test must be performed as first step. The webserver is acceeeible on the host from http://localhost:8080 or https://localhost:8443 and PHPMyAdmin on http://localhost:8081. From 361b3a8651a37ab1859be5253a8de23f64ff83da Mon Sep 17 00:00:00 2001 From: Allon Moritz Date: Wed, 12 Feb 2025 13:14:14 +0100 Subject: [PATCH 15/28] Revert to 8.3 --- .drone.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.drone.yml b/.drone.yml index 87cc6b3b0ba63..fc8502942e26c 100644 --- a/.drone.yml +++ b/.drone.yml @@ -154,7 +154,7 @@ steps: - name: phpmax-system-mysql depends_on: - phpmin-system-mysql - image: joomlaprojects/docker-images:cypress8.4 + image: joomlaprojects/docker-images:cypress8.3 volumes: - name: cypress-cache path: /root/.cache/Cypress @@ -205,7 +205,7 @@ steps: - name: phpmax-system-postgres depends_on: - phpmin-system-postgres - image: joomlaprojects/docker-images:cypress8.4 + image: joomlaprojects/docker-images:cypress8.3 volumes: - name: cypress-cache path: /root/.cache/Cypress @@ -433,6 +433,6 @@ trigger: --- kind: signature -hmac: efb4bb61f745e54bcc9aed7155b1eea9447814ff31ce389a3c2cd6b006e8cfbc +hmac: 17370f0df698bc5065b9fba5afcab4e0646af1678bfb210047e18eceeaf16e8f ... From 465ad51ee48030406511b906ac65d05223b426e1 Mon Sep 17 00:00:00 2001 From: Allon Moritz Date: Wed, 12 Feb 2025 13:15:43 +0100 Subject: [PATCH 16/28] docs --- tests/System/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/System/README.md b/tests/System/README.md index 6a9d0ef561c2b..b0d78483420be 100644 --- a/tests/System/README.md +++ b/tests/System/README.md @@ -328,8 +328,8 @@ If you encounter the following error while running the System Tests on slow mach ``` ## Docker -The system tests can also be executed in headless mode with dpcker compose. The following command starts the system tests from the current docker-compose.yml file: +The system tests can also be executed in headless mode with docker compose. The following command starts the system tests from the current docker-compose.yml file: `docker compose up system-tests` -The database is used with a temporary filesystem, so the data gets always deleted when the tests are started, therefor the installation test must be performed as first step. The webserver is acceeeible on the host from http://localhost:8080 or https://localhost:8443 and PHPMyAdmin on http://localhost:8081. +The database is used with a temporary filesystem, so the data gets always deleted when the tests are started, therefor the installation test must be performed as first step. The webserver is accessible on the host from http://localhost:8080 or https://localhost:8443 and PHPMyAdmin on http://localhost:8081. From 0d621a5dd79d1fb384c0bcf9fc5d0b260bed6f88 Mon Sep 17 00:00:00 2001 From: Allon Moritz Date: Wed, 12 Feb 2025 14:39:51 +0100 Subject: [PATCH 17/28] certs --- cypress.config.dist.mjs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/cypress.config.dist.mjs b/cypress.config.dist.mjs index e69abca8a4e9c..ef9dab7200280 100644 --- a/cypress.config.dist.mjs +++ b/cypress.config.dist.mjs @@ -43,4 +43,15 @@ export default defineConfig({ smtp_port: '1025', cmsPath: '.', }, + clientCertificates: [ + { + url: 'https://localhost', + certs: [ + { + cert: '../../tests/keys/server.crt', + key: '../../tests/keys/server.key', + }, + ], + }, + ], }); From 18541dfe9ca84cb459a1bc28fb703b1bb5ea08b7 Mon Sep 17 00:00:00 2001 From: Allon Moritz Date: Wed, 12 Feb 2025 15:27:54 +0100 Subject: [PATCH 18/28] Temp fix with conf file --- tests/System/000-default.conf | 32 ++++++++++++++++++++++++++++++++ tests/System/docker-compose.yml | 2 +- tests/System/drone-system-run.sh | 1 + 3 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 tests/System/000-default.conf diff --git a/tests/System/000-default.conf b/tests/System/000-default.conf new file mode 100644 index 0000000000000..c05a9e92a702a --- /dev/null +++ b/tests/System/000-default.conf @@ -0,0 +1,32 @@ +# VHost file for our dev environment + + # The ServerName directive sets the request scheme, hostname and port that + + DocumentRoot /tests/www + + # Available loglevels: trace8, ..., trace1, debug, info, notice, warn, + # error, crit, alert, emerg. + # It is also possible to configure the loglevel for particular + # modules, e.g. + #LogLevel info ssl:warn + + ErrorLog ${APACHE_LOG_DIR}/error.log + CustomLog ${APACHE_LOG_DIR}/access.log combined + + + + SSLEngine On + SSLCertificateFile /tests/keys/server.crt + SSLCertificateKeyFile /tests/keys/server.key + + DocumentRoot /tests/www + + ErrorLog ${APACHE_LOG_DIR}/error.log + CustomLog ${APACHE_LOG_DIR}/access.log combined + + + + Options Indexes FollowSymLinks + AllowOverride All + Require all granted + diff --git a/tests/System/docker-compose.yml b/tests/System/docker-compose.yml index 5990dc4791f5f..eabd929b23198 100644 --- a/tests/System/docker-compose.yml +++ b/tests/System/docker-compose.yml @@ -1,6 +1,6 @@ services: system-tests: - image: joomlaprojects/docker-images:cypress8.4 + image: joomlaprojects/docker-images:cypress8.1 environment: CYPRESS_VERIFY_TIMEOUT: 100000 JOOMLA_INSTALLATION_DISABLE_LOCALHOST_CHECK: 1 diff --git a/tests/System/drone-system-run.sh b/tests/System/drone-system-run.sh index 58ec12daff0dd..0b1000cda7854 100644 --- a/tests/System/drone-system-run.sh +++ b/tests/System/drone-system-run.sh @@ -18,6 +18,7 @@ chown -R www-data /tests/www/$TEST_GROUP/ chmod -R 777 /tests/www/$TEST_GROUP/images echo "[RUNNER] Start Apache" +cp -f tests/System/000-default.conf /etc/apache2/sites-available/000-default.conf a2enmod rewrite apache2ctl -D FOREGROUND & From 30579c729de091c590b7b34f9bac13ac3ddd2481 Mon Sep 17 00:00:00 2001 From: Allon Moritz Date: Wed, 12 Feb 2025 15:44:16 +0100 Subject: [PATCH 19/28] no certs --- cypress.config.dist.mjs | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/cypress.config.dist.mjs b/cypress.config.dist.mjs index ef9dab7200280..e69abca8a4e9c 100644 --- a/cypress.config.dist.mjs +++ b/cypress.config.dist.mjs @@ -43,15 +43,4 @@ export default defineConfig({ smtp_port: '1025', cmsPath: '.', }, - clientCertificates: [ - { - url: 'https://localhost', - certs: [ - { - cert: '../../tests/keys/server.crt', - key: '../../tests/keys/server.key', - }, - ], - }, - ], }); From b2ed91942eece42e5deccfffc6c7fe55fc36c526 Mon Sep 17 00:00:00 2001 From: Allon Moritz Date: Wed, 12 Feb 2025 15:44:38 +0100 Subject: [PATCH 20/28] use from image --- tests/System/drone-system-run.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/System/drone-system-run.sh b/tests/System/drone-system-run.sh index 0b1000cda7854..122bfc4f84954 100644 --- a/tests/System/drone-system-run.sh +++ b/tests/System/drone-system-run.sh @@ -18,7 +18,7 @@ chown -R www-data /tests/www/$TEST_GROUP/ chmod -R 777 /tests/www/$TEST_GROUP/images echo "[RUNNER] Start Apache" -cp -f tests/System/000-default.conf /etc/apache2/sites-available/000-default.conf +#cp -f tests/System/000-default.conf /etc/apache2/sites-available/000-default.conf a2enmod rewrite apache2ctl -D FOREGROUND & From c2836f24affc7d3857192eba44051a0ea01b9aa4 Mon Sep 17 00:00:00 2001 From: Allon Moritz Date: Wed, 12 Feb 2025 15:48:19 +0100 Subject: [PATCH 21/28] readd --- tests/System/drone-system-run.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/System/drone-system-run.sh b/tests/System/drone-system-run.sh index 122bfc4f84954..0b1000cda7854 100644 --- a/tests/System/drone-system-run.sh +++ b/tests/System/drone-system-run.sh @@ -18,7 +18,7 @@ chown -R www-data /tests/www/$TEST_GROUP/ chmod -R 777 /tests/www/$TEST_GROUP/images echo "[RUNNER] Start Apache" -#cp -f tests/System/000-default.conf /etc/apache2/sites-available/000-default.conf +cp -f tests/System/000-default.conf /etc/apache2/sites-available/000-default.conf a2enmod rewrite apache2ctl -D FOREGROUND & From ec6d81e664d6de5f817068587b25b934519768b8 Mon Sep 17 00:00:00 2001 From: Allon Moritz Date: Wed, 12 Feb 2025 15:55:55 +0100 Subject: [PATCH 22/28] Fetch newsfeeds on http because of self signed certificates --- .../integration/site/components/com_newsfeed/NewsFeed.cy.js | 4 ++-- tests/System/integration/site/modules/mod_feed/Default.cy.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/System/integration/site/components/com_newsfeed/NewsFeed.cy.js b/tests/System/integration/site/components/com_newsfeed/NewsFeed.cy.js index c633bbc9cc29c..90218f7743415 100644 --- a/tests/System/integration/site/components/com_newsfeed/NewsFeed.cy.js +++ b/tests/System/integration/site/components/com_newsfeed/NewsFeed.cy.js @@ -1,7 +1,7 @@ describe('Test in frontend that the newsfeeds details view', () => { ['joomla.org'].forEach((file) => { it(`can display a feed in a menu item from ${file}`, () => { - cy.db_createNewsFeed({ name: 'automated test feed 1', link: `${Cypress.config('baseUrl')}/tests/System/data/com_newsfeeds/${file}.xml` }) + cy.db_createNewsFeed({ name: 'automated test feed 1', link: `${Cypress.config('baseUrl').replace('https://', 'http://')}/tests/System/data/com_newsfeeds/${file}.xml` }) .then((feed) => cy.db_createMenuItem({ title: 'automated test feeds', link: `index.php?option=com_newsfeeds&view=newsfeed&id=${feed.id}` })) .then(() => { cy.visit('/'); @@ -14,7 +14,7 @@ describe('Test in frontend that the newsfeeds details view', () => { }); it(`can display a feed without a menu item from ${file}`, () => { - cy.db_createNewsFeed({ name: 'automated test feed 1', link: `${Cypress.config('baseUrl')}/tests/System/data/com_newsfeeds/${file}.xml` }) + cy.db_createNewsFeed({ name: 'automated test feed 1', link: `${Cypress.config('baseUrl').replace('https://', 'http://')}/tests/System/data/com_newsfeeds/${file}.xml` }) .then((feed) => { cy.visit(`/index.php?option=com_newsfeeds&view=newsfeed&id=${feed.id}`); diff --git a/tests/System/integration/site/modules/mod_feed/Default.cy.js b/tests/System/integration/site/modules/mod_feed/Default.cy.js index 53e1ee4a703d8..67110ae92af44 100644 --- a/tests/System/integration/site/modules/mod_feed/Default.cy.js +++ b/tests/System/integration/site/modules/mod_feed/Default.cy.js @@ -4,7 +4,7 @@ describe('Test in frontend that the feed module', () => { cy.db_createModule({ title: 'automated test feed', module: 'mod_feed', - params: `{"rssurl": "${Cypress.config('baseUrl')}/tests/System/data/com_newsfeeds/${file}.xml" }`, + params: `{"rssurl": "${Cypress.config('baseUrl').replace('https://', 'http://')}/tests/System/data/com_newsfeeds/${file}.xml" }`, }) .then(() => { cy.visit('/'); From 2554da594d5a91fa1db63be61b45b8d2579414f2 Mon Sep 17 00:00:00 2001 From: Allon Moritz Date: Wed, 12 Feb 2025 16:30:43 +0100 Subject: [PATCH 23/28] more doc --- tests/System/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/System/README.md b/tests/System/README.md index b0d78483420be..8b0220cc8b1fe 100644 --- a/tests/System/README.md +++ b/tests/System/README.md @@ -328,8 +328,8 @@ If you encounter the following error while running the System Tests on slow mach ``` ## Docker -The system tests can also be executed in headless mode with docker compose. The following command starts the system tests from the current docker-compose.yml file: +The system tests can also be executed in headless mode with docker compose. The following command does a cleanup and then starts the system tests from the current docker-compose.yml file: -`docker compose up system-tests` +`docker compose down && docker compose up system-tests` The database is used with a temporary filesystem, so the data gets always deleted when the tests are started, therefor the installation test must be performed as first step. The webserver is accessible on the host from http://localhost:8080 or https://localhost:8443 and PHPMyAdmin on http://localhost:8081. From 81aff7b437d9ceef16f8185703503006dc76a0ed Mon Sep 17 00:00:00 2001 From: Allon Moritz Date: Wed, 12 Feb 2025 16:43:12 +0100 Subject: [PATCH 24/28] Rename to entrypoint --- .drone.yml | 14 +++++++------- tests/System/cypress-system-run.sh | 17 ----------------- tests/System/docker-compose.yml | 4 ++-- .../{drone-system-run.sh => entrypoint.sh} | 4 ++++ 4 files changed, 13 insertions(+), 26 deletions(-) delete mode 100644 tests/System/cypress-system-run.sh rename tests/System/{drone-system-run.sh => entrypoint.sh} (83%) diff --git a/.drone.yml b/.drone.yml index fc8502942e26c..083bf37645f1f 100644 --- a/.drone.yml +++ b/.drone.yml @@ -149,7 +149,7 @@ steps: environment: JOOMLA_INSTALLATION_DISABLE_LOCALHOST_CHECK: 1 commands: - - bash tests/System/drone-system-run.sh "$(pwd)" cmysql mysqli mysql + - bash tests/System/entrypoint.sh "$(pwd)" cmysql mysqli mysql - name: phpmax-system-mysql depends_on: @@ -161,7 +161,7 @@ steps: environment: JOOMLA_INSTALLATION_DISABLE_LOCALHOST_CHECK: 1 commands: - - bash tests/System/drone-system-run.sh "$(pwd)" cmysqlmax mysqli mysql + - bash tests/System/entrypoint.sh "$(pwd)" cmysqlmax mysqli mysql when: event: exclude: @@ -180,7 +180,7 @@ steps: commands: - echo "This test is disabled because php next is not stable yet" - exit 1 - - bash tests/System/drone-system-run.sh "$(pwd)" cmysqlnext mysqli mysql + - bash tests/System/entrypoint.sh "$(pwd)" cmysqlnext mysqli mysql when: event: exclude: @@ -196,7 +196,7 @@ steps: environment: JOOMLA_INSTALLATION_DISABLE_LOCALHOST_CHECK: 1 commands: - - bash tests/System/drone-system-run.sh "$(pwd)" cpostgres pgsql postgres + - bash tests/System/entrypoint.sh "$(pwd)" cpostgres pgsql postgres when: event: exclude: @@ -212,7 +212,7 @@ steps: environment: JOOMLA_INSTALLATION_DISABLE_LOCALHOST_CHECK: 1 commands: - - bash tests/System/drone-system-run.sh "$(pwd)" cpostgresmax pgsql postgres + - bash tests/System/entrypoint.sh "$(pwd)" cpostgresmax pgsql postgres - name: phpnext-system-postgres depends_on: @@ -227,7 +227,7 @@ steps: commands: - echo "This test is disabled because php next is not stable yet" - exit 1 - - bash tests/System/drone-system-run.sh "$(pwd)" cpostgresnext pgsql postgres + - bash tests/System/entrypoint.sh "$(pwd)" cpostgresnext pgsql postgres when: event: exclude: @@ -433,6 +433,6 @@ trigger: --- kind: signature -hmac: 17370f0df698bc5065b9fba5afcab4e0646af1678bfb210047e18eceeaf16e8f +hmac: caca91b7aa40832a891260e03c42f8b7fc31b6971d201bf69291a87b158d5ce7 ... diff --git a/tests/System/cypress-system-run.sh b/tests/System/cypress-system-run.sh deleted file mode 100644 index 4ab87e0970ec0..0000000000000 --- a/tests/System/cypress-system-run.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -e -JOOMLA_BASE=$1 -TYPE=$2 - -echo "[RUNNER] Prepare test environment" - -# Switch to Joomla base directory -cd $JOOMLA_BASE - -echo "[RUNNER] Copy files to test installation" -rsync -a $JOOMLA_BASE/ /tests/www/$TYPE/ -chown -R www-data /tests/www/$TYPE/ - -echo "[RUNNER] cypress" -cd /tests/www/$TYPE -npm run cyress:run diff --git a/tests/System/docker-compose.yml b/tests/System/docker-compose.yml index eabd929b23198..413439f607af1 100644 --- a/tests/System/docker-compose.yml +++ b/tests/System/docker-compose.yml @@ -1,10 +1,10 @@ services: system-tests: - image: joomlaprojects/docker-images:cypress8.1 + image: joomlaprojects/docker-images:cypress8.4 environment: CYPRESS_VERIFY_TIMEOUT: 100000 JOOMLA_INSTALLATION_DISABLE_LOCALHOST_CHECK: 1 - entrypoint: bash /app/tests/System/drone-system-run.sh /app j mysqli mysql + entrypoint: bash /app/tests/System/entrypoint.sh /app j mysqli mysql depends_on: - phpmyadmin ports: diff --git a/tests/System/drone-system-run.sh b/tests/System/entrypoint.sh similarity index 83% rename from tests/System/drone-system-run.sh rename to tests/System/entrypoint.sh index 0b1000cda7854..99199158371ac 100644 --- a/tests/System/drone-system-run.sh +++ b/tests/System/entrypoint.sh @@ -1,4 +1,8 @@ #!/usr/bin/env bash + +# This script is intended to be used as a docker entrypoint file within a joomlaprojects/docker-images:cypressX image +# Check out the docker-compose.yml file how to prepare docker to run it or execute `docker compose up system-tests`. + set -e JOOMLA_BASE=$1 TEST_GROUP=$2 From bb071321b7d6129ca7f22724ebb7103b6ccda62e Mon Sep 17 00:00:00 2001 From: Allon Moritz Date: Wed, 12 Feb 2025 16:47:16 +0100 Subject: [PATCH 25/28] more docs --- tests/System/README.md | 2 +- tests/System/entrypoint.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/System/README.md b/tests/System/README.md index 8b0220cc8b1fe..fd0fb5f9e7ab7 100644 --- a/tests/System/README.md +++ b/tests/System/README.md @@ -330,6 +330,6 @@ If you encounter the following error while running the System Tests on slow mach ## Docker The system tests can also be executed in headless mode with docker compose. The following command does a cleanup and then starts the system tests from the current docker-compose.yml file: -`docker compose down && docker compose up system-tests` +`docker compose run --rm system-tests` The database is used with a temporary filesystem, so the data gets always deleted when the tests are started, therefor the installation test must be performed as first step. The webserver is accessible on the host from http://localhost:8080 or https://localhost:8443 and PHPMyAdmin on http://localhost:8081. diff --git a/tests/System/entrypoint.sh b/tests/System/entrypoint.sh index 99199158371ac..54dac3b008714 100644 --- a/tests/System/entrypoint.sh +++ b/tests/System/entrypoint.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash # This script is intended to be used as a docker entrypoint file within a joomlaprojects/docker-images:cypressX image -# Check out the docker-compose.yml file how to prepare docker to run it or execute `docker compose up system-tests`. +# Check out the docker-compose.yml file how to prepare docker to run it or execute `docker compose run --rm system-tests`. set -e JOOMLA_BASE=$1 From 9f514e4c3e66fa9a1b8d68687ffd0ecb7321e36e Mon Sep 17 00:00:00 2001 From: Allon Moritz Date: Wed, 12 Feb 2025 17:16:06 +0100 Subject: [PATCH 26/28] Revert "more docs" This reverts commit bb071321b7d6129ca7f22724ebb7103b6ccda62e. --- tests/System/README.md | 2 +- tests/System/entrypoint.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/System/README.md b/tests/System/README.md index fd0fb5f9e7ab7..8b0220cc8b1fe 100644 --- a/tests/System/README.md +++ b/tests/System/README.md @@ -330,6 +330,6 @@ If you encounter the following error while running the System Tests on slow mach ## Docker The system tests can also be executed in headless mode with docker compose. The following command does a cleanup and then starts the system tests from the current docker-compose.yml file: -`docker compose run --rm system-tests` +`docker compose down && docker compose up system-tests` The database is used with a temporary filesystem, so the data gets always deleted when the tests are started, therefor the installation test must be performed as first step. The webserver is accessible on the host from http://localhost:8080 or https://localhost:8443 and PHPMyAdmin on http://localhost:8081. diff --git a/tests/System/entrypoint.sh b/tests/System/entrypoint.sh index 54dac3b008714..99199158371ac 100644 --- a/tests/System/entrypoint.sh +++ b/tests/System/entrypoint.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash # This script is intended to be used as a docker entrypoint file within a joomlaprojects/docker-images:cypressX image -# Check out the docker-compose.yml file how to prepare docker to run it or execute `docker compose run --rm system-tests`. +# Check out the docker-compose.yml file how to prepare docker to run it or execute `docker compose up system-tests`. set -e JOOMLA_BASE=$1 From 586b491516d25d1538f002b30269d87e7d9649da Mon Sep 17 00:00:00 2001 From: Allon Moritz Date: Wed, 12 Feb 2025 19:43:21 +0100 Subject: [PATCH 27/28] revert as images are now up to date --- tests/System/000-default.conf | 32 -------------------------------- tests/System/entrypoint.sh | 1 - 2 files changed, 33 deletions(-) delete mode 100644 tests/System/000-default.conf diff --git a/tests/System/000-default.conf b/tests/System/000-default.conf deleted file mode 100644 index c05a9e92a702a..0000000000000 --- a/tests/System/000-default.conf +++ /dev/null @@ -1,32 +0,0 @@ -# VHost file for our dev environment - - # The ServerName directive sets the request scheme, hostname and port that - - DocumentRoot /tests/www - - # Available loglevels: trace8, ..., trace1, debug, info, notice, warn, - # error, crit, alert, emerg. - # It is also possible to configure the loglevel for particular - # modules, e.g. - #LogLevel info ssl:warn - - ErrorLog ${APACHE_LOG_DIR}/error.log - CustomLog ${APACHE_LOG_DIR}/access.log combined - - - - SSLEngine On - SSLCertificateFile /tests/keys/server.crt - SSLCertificateKeyFile /tests/keys/server.key - - DocumentRoot /tests/www - - ErrorLog ${APACHE_LOG_DIR}/error.log - CustomLog ${APACHE_LOG_DIR}/access.log combined - - - - Options Indexes FollowSymLinks - AllowOverride All - Require all granted - diff --git a/tests/System/entrypoint.sh b/tests/System/entrypoint.sh index 99199158371ac..40c5f5efd02ac 100644 --- a/tests/System/entrypoint.sh +++ b/tests/System/entrypoint.sh @@ -22,7 +22,6 @@ chown -R www-data /tests/www/$TEST_GROUP/ chmod -R 777 /tests/www/$TEST_GROUP/images echo "[RUNNER] Start Apache" -cp -f tests/System/000-default.conf /etc/apache2/sites-available/000-default.conf a2enmod rewrite apache2ctl -D FOREGROUND & From e776728449a5402d7355d66761c08bd2c535cfd9 Mon Sep 17 00:00:00 2001 From: Allon Moritz Date: Wed, 12 Feb 2025 20:29:46 +0100 Subject: [PATCH 28/28] Update tests/System/README.md Co-authored-by: Brian Teeman --- tests/System/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/System/README.md b/tests/System/README.md index 8b0220cc8b1fe..d9f5e1050bdbf 100644 --- a/tests/System/README.md +++ b/tests/System/README.md @@ -332,4 +332,4 @@ The system tests can also be executed in headless mode with docker compose. The `docker compose down && docker compose up system-tests` -The database is used with a temporary filesystem, so the data gets always deleted when the tests are started, therefor the installation test must be performed as first step. The webserver is accessible on the host from http://localhost:8080 or https://localhost:8443 and PHPMyAdmin on http://localhost:8081. +The database is used with a temporary filesystem, so the data always gets deleted when the tests are started, therefor the installation test must be performed as the first step. The webserver is accessible on the host from http://localhost:8080 or https://localhost:8443 and PHPMyAdmin on http://localhost:8081.