Page MenuHomePhabricator

Add support to run selser tests with custom edits on original wikitext
Closed, ResolvedPublic

Description

parserTests.js currently supports "changes" on the DOM generated by parsing input wikitext. That "changes" support should also include a "remove" option to delete a DOM element. In addition, we should be able to now serialize the edited DOM via selser. Given that "selser" is currently a mode that generates automated edits, we probaly need a "manual_selser" (or some such named mode) to apply selser on an edited DOM.

This would be helpful to force explicit testing of selser behavior that would be useful for patches like https://gerrit.wikimedia.org/r/#/c/157038/ with examples as in https://gist.githubusercontent.com/subbuss/5f0872ce4c20bed622bc/raw/d4720f260f4a3131e3963f012ec289eaf37a202c/gistfile1.txt (and others).


Version: unspecified
Severity: normal

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 3:53 AM
bzimport added a project: Parsoid-Tests.
bzimport set Reference to bz70722.

Till this support is in place, I cannot add tests for fixes in https://gerrit.wikimedia.org/r/#/c/177761/

So, before resolving this task, tests should be added for the patches listed in this task.

Change 179481 had a related patch set uploaded (by Cscott):
Add $().remove and $().empty methods to parser test manual changes.

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

Patch-For-Review

The above patch fixes the "changes" support in parser tests, but it doesn't address the "manual_selser" part of the task.

Change 179481 merged by jenkins-bot:
Add $().remove and $().empty methods to parser test manual changes.

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

Once this is fixed, we should revisit the test "References: 9." to create some manual changes and ensure that new <references /> are not created for changes unrelated to orphan <ref>s. See T88660.

ssastry raised the priority of this task from Medium to High.Feb 13 2015, 11:36 PM

https://gerrit.wikimedia.org/r/#/c/190595/ is another patch that benefits from this support.

There are 3 more recent patches of mine that would benefit from this support. So, I moved it to the VE Q3 board.

Change 194912 had a related patch set uploaded (by Marcoil):
[parserTests] T72722: Support manual changes in selser tests

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

Change 194912 merged by jenkins-bot:
[parserTests] T72722: Support manual changes in selser tests

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

With https://gerrit.wikimedia.org/r/#/c/197422/ in place, this task is considered done. Now to go add some deterministic selser tests for things we want to guarantee testing always ...