Closed matsduf closed 4 months ago
Well, on Debian 12 it seems to work.
There is another unrelated error from Travis:
$ if [[ "$TARGET" == "MySQL" ]]; then mysql -u root -e "CREATE USER 'travis_zm'@'localhost' IDENTIFIED BY '*****************';"; fi
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
Glad you found the root cause. Those pesky environment variables!
Unfortunetely, there is more to it.
Glad you found the root cause. Those pesky environment variables!
Unfortunetely, there is more to it.
Yes, for sure. For example on OSes where only one test fail, i.e a Backend specific message, where the locale is correctly set.
Regarding the MySQL problem I noticed this: https://app.travis-ci.com/github/zonemaster/zonemaster-backend/jobs/623371555#L1060
$ sudo systemctl start mysql
Failed to start mysql.service: Unit mysql.service not found.
MySQL did not start within 10 seconds
Regarding the MySQL problem I noticed this: https://app.travis-ci.com/github/zonemaster/zonemaster-backend/jobs/623371555#L1060
$ sudo systemctl start mysql Failed to start mysql.service: Unit mysql.service not found. MySQL did not start within 10 seconds
It should be fixed in a separate PR.
@marc-vanderwal and @mattias-p, please re-review. I have used the model proposed by @mattias-p on our meeting. Disregard the Mysql issue for this PR.
I've created matsduf/zonemaster-backend#7 to update this PR with a fix for the MySQL problem.
It seem Jammy can't handle MySQL and Focal can't handle PostgreSQL. But it's possible to specify dist per job like this: https://github.com/zonemaster/zonemaster-backend/pull/1174/commits/ab41ad3385c23189075ca58ec1700d3ff289aac9.
It seem Jammy can't handle MySQL and Focal can't handle PostgreSQL. But it's possible to specify dist per job like this: ab41ad3.
Already solved that in the same way, but with a different setting.
@tgreenx @mattias-p @marc-vanderwal @MichaelTimbert: Please review, and then verify that "your" OS works correctly. See "how to test".
Testing completed successfully on Rocky 9:
$ git log -1 --oneline
81d55a45 (HEAD -> fix-issue-translation.t, matsduf/fix-issue-translation.t) Keeps Jammy for Postgresql
$ printenv | grep -i utf
LANG=en_US.UTF-8
$ unset LANG
$ printenv | grep -i utf
$ prove t/translator.t
t/translator.t .. ok
All tests successful.
Files=1, Tests=9, 2 wallclock secs ( 0.02 usr 0.00 sys + 0.69 cusr 0.09 csys = 0.80 CPU)
Result: PASS
fix work on Ubuntu 20.04.
$ prove t/translator.t
t/translator.t .. ok
All tests successful.
Files=1, Tests=9, 1 wallclock secs ( 0.02 usr 0.00 sys + 0.72 cusr 0.05 csys = 0.79 CPU)
Result: PASS
fix work on Ubuntu 22.04.
$ prove t/translator.t
t/translator.t .. ok
All tests successful.
Files=1, Tests=9, 0 wallclock secs ( 0.01 usr 0.00 sys + 0.29 cusr 0.02 csys = 0.32 CPU)
Result: PASS
Purpose
Purpose 1
This PR makes locale being set so that translation works in
t/translator.t
in all OSs.Travis is an exception where it has not been possible to make it work for all subtests. To prevent it from failing the script ends before all subtests have been run.
Purpose 2
The MySQL service suddenly fails to start in Jammy, but it still works in Focal. For Postgresql Jammy must be kept.
Context
Fixes #1173 and fixes issue with failing Mysql in Travis
How to test this PR
Purpose 1
Travis must pass the first few subtests from
translator.t
.Every supported OSs must pass the tests when the calling environment is without locale with UTF-8 support.
printenv
to identify all set locale related keys (value beingC.UTF-8
,C
or some other value).translator.t
and all tests should pass.[x] Debian 12
[x] FreeBSD 14.1
[x] Rocky Linux 8.10
[x] Rocky Linux 9.4
[x] Ubuntu 20.04
[x] Ubuntu 22.04
[x] Ubuntu 24.04
Purpose 2
Travis should pass.