On 2025-04-11, at 09:56:28 +0800, Bo YU wrote:
On Fri, Apr 11, 2025 at 7:52 AM Soren Stoutner wrote:
The Redmine package includes a test run at build time that checks for
a list of particular response values. The problem is that these
values are translated. Running the build in a different language
causes the test to fail.
Failure: ProjectAdminQueryTest#test_project_statuses_values_should_return_all_statuses
[test/unit/project_admin_query_test.rb:99]:
--- expected
+++ actual
@@ -1 +1 @@
-[["active", "1"], ["closed", "5"], ["archived", "9"], ["scheduled for deletion", "10"]]
+[["actif", "1"], ["fermé", "5"], ["archivé", "9"], ["planifié pour suppression", “10”]]
https://tests.reproducible-builds.org/debian/rb-pkg/trixie/arm64/redmine.html
Setting "export LANG=C.UTF-8” does not prevent this test from running
in a foreign language.
https://salsa.debian.org/ruby-team/redmine/-/jobs/7360518#L3871
I remember there was a fix[0] for this problem. In other words, this
variable needs to be passed when calling test. Hope this helps.
[0]: https://salsa.debian.org/debian-mate-team/onboard/-/blob/master/debian/rules?ref_type=heads#L45
I've did something similar for magit:
https://salsa.debian.org/emacsen-team/magit/-/commit/2371b4f9cd51742c196400d14b95aebc75859791
However, I don't _think_ the solution here is to set "LANG" (or
"LC_ALL"). I would expect exporting "LANG=C.UTF-8" to work, if it were.
I just tried to reproduce the test failure by explicitly setting "LC_ALL=it_IT.UTF-8" and was unable to do so.
I am not familiar with Ruby and how it does i18n, but based on a quick
bit of research, I _suspect_ that there may be a concurrency bug in the test-suite. The tests are run in a non-deterministic order and some of
them change the locale. Therefore, I think what is happening is that a
test runs before the failing one which changes the locale (to "pt" or
"fr", for example) causing the test to fail. The failing test is:
def test_project_statuses_values_should_return_all_statuses
q = ProjectAdminQuery.new
assert_equal [
["active", "1"],
["closed", "5"],
["archived", "9"],
["scheduled for deletion", "10"]
], q.project_statuses_values
end
Compare this to a similar test in the same file:
def test_project_statuses_filter_should_return_project_statuses
set_language_if_valid 'en'
query = ProjectAdminQuery.new(:name => '_')
query.filters = {'status' => {:operator => '=', :values => []}}
values = query.available_filters['status'][:values]
assert_equal ['active', 'closed', 'archived', 'scheduled for deletion'], values.map(&:first)
assert_equal ['1', '5', '9', '10'], values.map(&:second)
end
In the latter test, the locale is explicitly set to "en". I think this
should be done in the former test too.
J.
-----BEGIN PGP SIGNATURE-----
wsG7BAABCgBvBYJn+V30CRAphqwKvfEEDUcUAAAAAAAeACBzYWx0QG5vdGF0aW9u cy5zZXF1b2lhLXBncC5vcmcXkV1Zg/artFbVvWs24qW3NwkHXb3S4T0j0oaYE0yv sRYhBGwdtFNj70A3vVbVFymGrAq98QQNAACVmw/+NKZpO9Ay2v7Jq8xqVUzxGOf1 bZ5zwIgbY+sP7AY6AiC1CnSKmSR2txjY1Upn23kAWrLafhgCrBxRmpMp87++HKJb MdJoD9wO97uV06YDZ1U4qlr4EV16tCS+Fn9Uq0ZbHvtTSXDQtfDHU6xW4cOLuUwY 1hAFHcSjMFUX8uTtYAIvYZLYdG6KPZdXTV49TtfjxAjwzfV9mnkQeZQviQ3WJfj2 tqdrE2Do9ISBjrWj1fIum0WKWoCR902a+1yW+QVDPZH0QxLydxDNU/3jJT1JkvDb qS4m//C+Gzf8riZWMXUdGd1LiE7H74AQbGxmr3ZsUqW4Z9Wd1b7kWnz89VIp9cDZ nmo/52dMq78mbuj3m0xGutpIVo2gR9e5Xd2hlkU6M4/mVBTKqt6MFchI/5oIDP5T zHARi4EAoOw7BnDKup789oJkDN/X8Ng/Qbm/pScaN5kTgwm//oZ5cLLUXoCjAE3C HN5u+cgYGzp0yCiQPfN0y49WG6lPqaRDJAmTMG+jNmDzFyZBJp1ZzEeCsCSYTc+U cNKFix9c+H4X1owm2b/fsu8YnzByZv1xVLWP56st5Ah3axrKrc5ZWP9XlSOeJu+j /B3vHpA4Klw8jATsGREqBmLZCIIYIHxvCJoDqvZCT1+1Jzt7QCFXpy8wnYl5lAWn S9Q7fwdEphPdYdXHo8w=
=INee
-----END PGP SIGNATURE-----
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)