Sysop: | Amessyroom |
---|---|
Location: | Fayetteville, NC |
Users: | 30 |
Nodes: | 6 (1 / 5) |
Uptime: | 62:15:44 |
Calls: | 413 |
Files: | 1,015 |
Messages: | 94,004 |
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 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.