User tests: Successful: Unsuccessful:
Last Edited: 24 September 2024: Finished Testing
Replace postgres
with pg
NPM module for Cypress System Tests:
postgres
NPM module.fd00::6
[fd00::6]
, getting error "getaddrinfo ENOTFOUND [fd00"postgres
module uses nodepg
is the official PostgreSQL client for Node.js, which is used ten times more frequently.👉 This change does not fix the rarely occurring PostgreSQL duplicated keys
error as well. While this issue has been reduced by joomla-cms#43924, it still happens occasionally with using postgres
, as well as with pg
module.
A side-effect of adding the new module is that the version is updated to 4.4.9 in the package-lock.json
file.
And pg
has more dependencies.
One option for testing is using JBT >= 1.0.24 (which includes currently open joomla-projects/joomla-cypress#33, joomla-projects/joomla-cypress#36 and #43968):
scripts/create 44 IPv6 pgsql
scripts/patchtester 44
scripts/test 44 system
> duplicate key value violates unique constraint "jos44_users_pkey"
docker exec jbt_44 ping jbt_pg
branch_44/cypress.config.mjs
db_host: 'fd00::5'
scripts/test 44 system novnc install/Installation.cy.js
scripts/test 44 system novnc
pg
and IPv6 address
docker exec jbt_44 npm ci
scripts/test 44 system
pg
and hostname
scripts/create 44 recreate pgsql
scripts/test 44 system
> Postgres query failed: duplicate key value violates unique constraint "jos44_users_pkey"
pg
, IPv6 address and non-default port number
npm install
scripts/create 44 IPv6 pgsql https://github.com/muhme/joomla-cms:44-pg-for-postgres
socat
in Cypress container:
docker exec jbt_cypress bash -c 'apt-get update && apt-get upgrade -y && apt-get install socat -y'
docker exec jbt_44 ping jbt_cypress
-> in my case fd00::8docker exec jbt_44 ping jbt_pg
-> in my case fd00::6branch_44/cypress.config.mjs
fd00::8
and port 4711
separate and in Joomla backend configuration.php we are using combined [fd00::8]:4711
docker exec jbt_cypress socat 'TCP6-LISTEN:4711,fork,reuseaddr' 'TCP6:[fd00::6]:5432'
docker exec -it jbt_pg bash -c "PGPASSWORD=root psql -h fd00::8 -p 4711 -U root -d postgres"
scripts/test 44 system
pg
in Cypress System Tests, Joomla PHP is still using database host jbt_pg
with default port number (it would need joomla-framework/database#310 - but as it is not focus with this PR, it is ignored)pg
, IPv6 hostname and non-default port number
scripts/test 44 system
pg
in Cypress System Tests. Joomla Web Installer is at this moment (September 2024) not able to set non-default port number for PostgreSQL (it needs joomla-framework/database#310 - but as it is not focus with this PR, it is ignored). During System Tests Joomla PHP is still using database host jbt_pg
with default port number.
pg
, IPv4 and using a hostname and default port number (the default case)
scripts/create 44 pgsql https://github.com/muhme/joomla-cms:44-pg-for-postgres
jbt_pg
and db_port
is emptyscripts/create
)
scripts/test 44 system
pg
, using a IPv4 address and non-standard port number
docker exec jbt_cypress ping host.docker.internal
-> 192.168.65.254 in my casecypress.config.mjs
file:
db_host: '192.168.65.254'
db_port: '7003'
scripts/test 44 system install/Installation.cy.js novnc
scripts/test 44 system
pg
, using a IPv4 address and standard port number
docker exec jbt_cypress ping jbt_pg
-> 192.168.150.4 in my casecypress.config.mjs
file:
db_host: '192.168.65.4'
db_port: ''
scripts/test 44 system install/Installation.cy.js novnc
scripts/test 44 system
pg
and using Unix socket
pg
module in this PR. Therefore, the changes from 44092 must be applied manually. You can use the atteched file db.mjs.txt to do this.scripts/create 44 pgsql socket https://github.com/muhme/joomla-cms:44-pg-for-postgres
unix:/jbt/run/postgresql-socket
cp db.mjs.txt branch_44/tests/System/plugins/db.mjs
scripts/test 44 system
Please select:
Documentation link for docs.joomla.org:
No documentation changes for docs.joomla.org needed
Pull Request link for manual.joomla.org:
No documentation changes for manual.joomla.org needed
Status | New | ⇒ | Pending |
Category | ⇒ | NPM Change JavaScript Unit Tests |
At the time I implemented Postgres into the system tests, there was a reason why I didn't use pg, but can't remember anymore.
The dependencies? Or the MIT license?
For functionality I will test - beside IPv6 - number of sessions, run time, Unix sockets ...
It was something with the code.
Drone reports JavaScript code style issues: https://ci.joomla.org/joomla/joomla-cms/78949/1/33
Labels |
Added:
Unit/System Tests
NPM Resource Changed
PR-4.4-dev
|
Title |
|
I have tested this item ✅ successfully on 7befd05
Can you rebase this one to 5.2?
Category | NPM Change JavaScript Unit Tests | ⇒ | Unit Tests Repository Administration com_admin SQL |
Labels |
Removed:
NPM Resource Changed
|
Category | Unit Tests Repository Administration com_admin SQL | ⇒ | NPM Change JavaScript Unit Tests |
After rebase on 5.2-dev plus update to current pg
version 8.13.0 tested with JBT in creating instance from PR and running System Tests:
scripts/create 52 IPv6 pgsql https://github.com/muhme/joomla-cms:44-pg-for-postgres
scripts/test 52 system
All tests are passed ✅
Labels |
Added:
NPM Resource Changed
PR-5.2-dev
Removed: PR-4.4-dev |
Status | Pending | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2024-10-23 11:22:26 |
Closed_By | ⇒ | Hackwar |
Thanks for this fix.
At the time I implemented Postgres into the system tests, there was a reason why I didn't use pg, but can't remember anymore.