Jeremy,
Thanks for taking the time to dig into this so deeply. I really
appreciate it.
On Friday, April 11, 2025 11:23:06 AM Mountain Standard Time Jeremy
Sowden wrote:
> 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.
I am also not that familiar with Ruby. I have just recently come to
maintaining the Redmine package, which will probably end up with me
learning a bit of Ruby, which I have no previous experience with.
> 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
Thanks for catching this. I had not noticed that other tests were
explicitly setting the language.
> In the latter test, the locale is explicitly set to "en". I think
> this should be done in the former test too.
https://salsa.debian.org/ruby-team/redmine/-/blob/master/debian/
patches/run-some-tests-in-English.patch?ref_type=heads
https://www.redmine.org/issues/42570
--
Soren Stoutner
soren@debian.orgAttachment:
signature.asc
Description: This is a digitally signed message part.