Page MenuHomePhabricator

Use qqx as content language for PHPUnit tests
Open, Needs TriagePublic

Assigned To
None
Authored By
Daimona
Mar 15 2021, 11:46 AM
Referenced Files
None
Tokens
"Like" token, awarded by Dreamy_Jazz."Orange Medal" token, awarded by Krinkle."Like" token, awarded by DannyS712."Like" token, awarded by kostajh."Love" token, awarded by Mainframe98.

Description

Several core tests assume that the wiki is in English, and make assertions about certain messages resolving to some hardcoded English strings. These tests will fail horribly if your wiki is not using English as content language (this is the case for me in my local environment).

I believe we should encourage developers to write tests that are not dependent on the language. A nice solution (IMHO) would be to set the content language to qqx somewhere in our PHPUnit wrapper / test runner, which would ensure consistent output.

Event Timeline

Change 672401 had a related patch set uploaded (by Daimona Eaytoy; owner: Daimona Eaytoy):
[mediawiki/core@master] Set the content language to qqx in PHPUnit tests

https://gerrit.wikimedia.org/r/672401

Change 672444 had a related patch set uploaded (by Daimona Eaytoy; owner: Daimona Eaytoy):
[mediawiki/core@master] Make a few tests not depend on English as content language

https://gerrit.wikimedia.org/r/672444

Based on the attempts above, it seems like we might find unexpected problems. The root cause for this is, I believe, the vast usage of globals in our tests. I think a first step might be setting the language to 'en'. This should be a noop for CI and should help with T277470. And then migrate to qqx for more consistent output.

Change 672444 abandoned by Daimona Eaytoy:

[mediawiki/core@master] Make a few tests not depend on English as content language

Reason:

Too old

https://gerrit.wikimedia.org/r/672444