The tests for the 2.x-branch are currently broken.

Let's try to fix these, so that automated testing can be (re-)enabled.

Comments

Stevel created an issue. See original summary.

Stevel’s picture

StatusFileSize
new4.31 KB

First attempt to fix some of the bugs.

Tests failing without patch:
Update translations using cron: 58 passes, 2 fails, 0 exceptions, and 24 debug messages
Update translations: 168 passes, 12 fails, 1 exception, and 52 debug messages (test aborted due to exception)

Tests still failing with patch:
Update translations: 616 passes, 14 fails, 0 exceptions, and 246 debug messages

Stevel’s picture

Assigned: Stevel » Unassigned
Status: Active » Needs work

Unassignign myself for now

sutharsan’s picture

Super that you are working on this!

Stevel’s picture

Assigned: Unassigned » Stevel

Some strings that are used in the test are imported from l.d.o when the 'de' language is enabled, overwriting the non-customized strings.

Proposed solution: switch to using strings that are not used in modules enabled for the test or in drupal core

Stevel’s picture

StatusFileSize
new13.36 KB

Some more progress. This patch adds a context 'l10n_update test' to all strings used for the test, so they don't interfere with existing strings.

Status with new patch:
Update translations: 624 passes, 2 fails, 0 exceptions, and 244 debug messages

The remaining fails are caused by a non-matching line One translation file imported. %number translations were added, %update translations were updated and %delete translations were removed., I think because the translations from Drupal core are also downloaded.

A possible solution would perhaps be to switch to using a language not present on l.d.o instead of german for the tests.

Stevel’s picture

Status: Needs work » Needs review
StatusFileSize
new28.82 KB

Switching the test languages to custom languages makes the One translation file imported. %number translations were added, %update translations were updated and %delete translations were removed. line return 0 translations for both add, update and remove. I commented out these tests adding an @TODO.

The languages used are prefixed with 'x-' (private use language codes according to RFC4646). The filenames of the po files have been changed accordingly. This removes the need of context for the test strings, since they are not translated in drupal.org

This patch should make the tests go green!

Stevel’s picture

StatusFileSize
new34.7 KB

Hmm, apparently I forgot to run the other tests with the last patch, still causing some errors. Here's a new one.

sutharsan’s picture

+    // We use a private language code here as test language, so there are no
+    // translations downloaded from the drupal server for this test. This

I understand the rational behind using 'x-de', but the test should not go out at all. That makes the testbot dependent on external environment. I remember did something to prevent this in a more general way, but can't remember how. I expect this to be present in the D8 core test for Local module.

Stevel’s picture

StatusFileSize
new5.55 KB

That makes sense, indeed. I added drupal to the list of disabled projects, which should prevent checking on ftp.drupal.org.

This removes the need to use a non-existing language, making the patch significantly smaller. Still, I didn't really work out the counts of the added/updated/removed translations.

Stevel’s picture

StatusFileSize
new6.31 KB

This should also fix some issues when running tests with a git-based release.

sutharsan’s picture

Assigned: Stevel » Unassigned
Status: Needs review » Fixed

Great work!
All test pass locally. At last, let's make this module test-covered.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.