Page MenuHomePhabricator

Disambiguator parser tests broken due to parser tests using dummy parser
Closed, ResolvedPublic

Description

Disambiguator/tests/parserTests.php
!! article
Disambig
!! text
This is a disambig page.
__DISAMBIG__
!! endarticle

!! article
Normal
!! text
This is a normal page.
!! endarticle

!! test
Link to disambig and non-disambig page
!! input
I am linking to [[Disambig]] and [[Normal]].
!! result
<p>I am linking to <a href="/wiki/Disambig" class="mw-disambig" title="Disambig">Disambig</a> and <a href="/wiki/Normal" title="Normal">Normal</a>.
</p>
!! end

After rMW65b732f29568: parserTests: Use a mock parser during article insertion though, the __DISAMBIG__ is no longer parsed and inserted into the page_props table, so the parser test fails.

Details

Related Gerrit Patches:
mediawiki/extensions/PhpTagsWiki : masterRevert "Disable parser tests for categories count"
mediawiki/extensions/Disambiguator : masterRevert "Disable parser tests due to T159014"
mediawiki/core : masterparserTests: re-enable save parse and fix MCR errors

Event Timeline

Legoktm created this task.Feb 25 2017, 12:05 AM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptFeb 25 2017, 12:05 AM
hashar added a subscriber: hashar.

T163733 is related: categorylinks is not updated when an`!!article` section has a [[Category:foo]].

Change 353548 had a related patch set uploaded (by Umherirrender; owner: Umherirrender):
[mediawiki/extensions/Disambiguator@master] Disable parser tests due to T159014

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

Change 353548 merged by jenkins-bot:
[mediawiki/extensions/Disambiguator@master] Disable parser tests due to T159014

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

@CCicalese_WMF ran into this today in testing a different extension. I think we should revert @tstarling's commit that switched the tests to use a dummy parser.

Thanks, @Legoktm. I was trying to add parser tests for the DisplayTitle extension, which also relies on changes to the page_props table.

cscott added a subscriber: cscott.Jul 20 2018, 12:05 AM

I remember when Tim wrote that patch (https://gerrit.wikimedia.org/r/314490). My vague memory is that it was motivated by the difficulty trying to use a parser test to debug the parser. You couldn't set breakpoints or emit sensible logging because every !! article added triggered the parser (to parse the completely-automatically-generated-and-meaningless revision comment), so you'd have to dig through a couple hundred parser invocations before you got to the place where the actual parser test you were interested in was being run.

I hadn't realized we were running the parser on the actual text of the !! article as well (not just the revision comment). I'm actually a bit surprised we're doing that.

Perhaps a compromise would be to "opt in" to parsing for those !! articles, something like:

!! article
Foo
!! options
parse-article
!! text
Foo
__DISAMBIG__
!! endarticle

or else something hacky that just did a regex search for __\w+__ and ran the parser for those.

Change 447013 had a related patch set uploaded (by Tim Starling; owner: Tim Starling):
[mediawiki/core@master] parserTests: re-enable save parse and fix MCR errors

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

Change 447013 merged by jenkins-bot:
[mediawiki/core@master] parserTests: re-enable save parse and fix MCR errors

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

Change 447752 had a related patch set uploaded (by Legoktm; owner: Legoktm):
[mediawiki/extensions/Disambiguator@master] Revert "Disable parser tests due to T159014"

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

Jdforrester-WMF closed this task as Resolved.Jul 25 2018, 3:36 PM
Jdforrester-WMF assigned this task to Legoktm.
Jdforrester-WMF removed a project: Patch-For-Review.

Yay.

Change 447752 merged by jenkins-bot:
[mediawiki/extensions/Disambiguator@master] Revert "Disable parser tests due to T159014"

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

Change 448408 had a related patch set uploaded (by Hashar; owner: Hashar):
[mediawiki/extensions/PhpTagsWiki@master] Revert "Disable parser tests for categories count"

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

Change 448408 merged by Hashar:
[mediawiki/extensions/PhpTagsWiki@master] Revert "Disable parser tests for categories count"

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