Page MenuHomePhabricator

[NSFileRepo] QUnit test "mediawiki.Title fails
Closed, ResolvedPublic

Description

With NSFileRepo and Lockdown extensions installed, a QUnit test is failling:

SUMMARY:
✔ 418 tests completed
✖ 1 test failed

FAILED TESTS:
  mediawiki.Title
    ✖ newFromFileName
      HeadlessChrome 0.0.0 (Linux 0.0.0)
    [Carrying namespace] Filename matches original
    Expected: "File-Sample"
    Actual: "Sample"
        at Object.<anonymous>
        at runTest (node_modules/qunit/qunit/qunit.js:1530:30)
        at Test.run (node_modules/qunit/qunit/qunit.js:1516:6)
        at node_modules/qunit/qunit/qunit.js:1728:12
        at advanceTaskQueue (node_modules/qunit/qunit/qunit.js:1129:6)
        at advance (node_modules/qunit/qunit/qunit.js:1110:4)

Event Timeline

Vvjjkkii renamed this task from [NSFileRepo] QUnit test "mediawiki.Title fails to jlbaaaaaaa.Jul 1 2018, 1:06 AM
Vvjjkkii triaged this task as High priority.
Vvjjkkii updated the task description. (Show Details)
Vvjjkkii removed a subscriber: Aklapper.
CommunityTechBot renamed this task from jlbaaaaaaa to [NSFileRepo] QUnit test "mediawiki.Title fails.Jul 1 2018, 8:43 PM
CommunityTechBot raised the priority of this task from High to Needs Triage.
CommunityTechBot updated the task description. (Show Details)
CommunityTechBot added a subscriber: Aklapper.

Change 455175 had a related patch set uploaded (by Hashar; owner: Hashar):
[integration/config@master] Mark NSFileRepo as broken

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

Change 455175 merged by jenkins-bot:
[integration/config@master] Mark NSFileRepo as broken

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

The test fails because NSFileRepo overrides wgIllegalFileChars to remove the : character from it.

Possibly the test should be skipped or something when that config option is overridden.

ah, thank you, i could not identify the actual issue yet.
However when i type the following into the console:

mw.Title.newFromFileName( 'File:File-Sample.png' ).getNameText()

The result is:

"File-Sample"

But the current expected value in the qunit test is:

"File:Sample.png"

oh, the ":" gets replaced with a "-" by default. I did not guess that. Ill abandon the change, thanks

Change 552806 had a related patch set uploaded (by Pwirth; owner: Pwirth):
[mediawiki/core@master] mediawiki.Title.newFromFileName: Fix expected fileName in qunit

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

Change 552806 abandoned by Pwirth:
mediawiki.Title.newFromFileName: Fix expected fileName in qunit

Reason:
Test is correct. Illegal char ":" is replaced with "-" by default

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

Change 552806 restored by Pwirth:
mediawiki.Title.newFromFileName: Fix expected fileName in qunit

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

Change 552806 merged by jenkins-bot:
[mediawiki/core@master] tests: mediawiki.Title.newFromFileName: exception for ':' replacement

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

Change 567724 had a related patch set uploaded (by Bartosz Dziewoński; owner: Pwirth):
[mediawiki/core@master] tests: qunit newFromFileName respect config for ':' replacement

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

Change 567724 merged by jenkins-bot:
[mediawiki/core@master] tests: qunit newFromFileName respect config for ':' replacement

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

Change 568031 had a related patch set uploaded (by Bartosz Dziewoński; owner: Bartosz Dziewoński):
[integration/config@master] Revert "Mark NSFileRepo as broken"

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

Change 568031 merged by jenkins-bot:
[integration/config@master] layout: [mediawiki/extension/NSFileRepo] Restore tests now they're fixed

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

Mentioned in SAL (#wikimedia-releng) [2020-01-29T00:05:18Z] <James_F> layout: [mediawiki/extension/NSFileRepo] Restore tests now they're fixed T196480

Jdforrester-WMF assigned this task to Pwirth.
Jdforrester-WMF subscribed.

Repo now passes. Congratulations.

Thanks for fixing up the patch @Jdforrester-WMF, I really have no idea what I'm doing when it comes to the continuous integration repos.