Page MenuHomePhabricator

Occasional Wikibase CI failures: Cannot read property 'set' of undefined (test: item old revisions do not have an edit link)
Closed, InvalidPublic

Description

Example change: https://gerrit.wikimedia.org/r/534397
Example logs: https://integration.wikimedia.org/ci/job/quibble-vendor-mysql-php72-docker/18459/console

16:08:14 ==================================================================
16:08:14 Number of specs: 9
16:08:14 
16:08:14 
16:08:14 40 passing (81.70s)
16:08:14 1 failing
16:08:14 
16:08:14 1) item old revisions do not have an edit link:
16:08:14 javascript error: Cannot read property 'set' of undefined
16:08:14 running chrome
16:08:14 Error: An error occurred while executing user supplied JavaScript.
16:08:14     at execute(<Function>) - index.js:312:3
16:08:14 
16:08:14 
16:08:14 npm ERR! code ELIFECYCLE
16:08:14 npm ERR! errno 1
16:08:14 npm ERR! @ selenium-test:repo: `wdio repo/tests/selenium/wdio.conf.js`
16:08:14 npm ERR! Exit status 1
16:08:14 npm ERR! 
16:08:14 npm ERR! Failed at the @ selenium-test:repo script.
16:08:14 npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
16:08:14 
16:08:14 npm ERR! A complete log of this run can be found in:
16:08:14 npm ERR!     /cache/npm/_logs/2019-09-09T16_08_14_820Z-debug.log

Details

Related Gerrit Patches:
mediawiki/extensions/Wikibase : masterSkip browser test checking edit links on old revisions

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptSep 9 2019, 4:35 PM
Lucas_Werkmeister_WMDE renamed this task from Occasional Wikibase CI failures: Cannot read property 'set' of undefined to Occasional Wikibase CI failures: Cannot read property 'set' of undefined (test: item old revisions do not have an edit link).Sep 11 2019, 3:32 PM

I assume this is caused by the ItemPage.goToPreviousRevision() function, which as far as I can tell is only used by this one test, and looks extremely fragile. Here’s what it does:

  • click on the recent changes link in the sidebar
  • click on the “history” link of the last change in the wiki
  • click on the date link of the change marked as “after” (this class is assigned based on the two diff selection radio buttons – initially, “before” is the current revision and “after” its parent)

I’m not sure what part of this breaks, but since we already know the item ID, at least the first two steps seem unnecessary to me, and for the last step it might also be better to make an API call to get the second-latest revision.

Change 535879 had a related patch set uploaded (by Jakob; owner: Jakob):
[mediawiki/extensions/Wikibase@master] Skip browser test checking edit links on old revisions

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

Jakob_WMDE closed this task as Invalid.Sep 11 2019, 3:57 PM

@Lucas_Werkmeister_WMDE yeah, let's close this one. I uploaded a patch to skip the test and I'll paste your comment over to the investigation task.

Pablo-WMDE added a subscriber: Pablo-WMDE.EditedSep 11 2019, 4:17 PM

Agree with @Lucas_Werkmeister_WMDE in that the test could needs some love.
The ItemPage.editItemDescription() is definitely still part of the arrange phase so it could be done via the API just as well (=> second API call, changing the label, creating a second revision), the revision id which is the result of the initial WikibaseApi.createItem() (=> make a sister method which does not reduce this to the itemId), is a what we actually want to know when doing ItemPage.goToPreviousRevision() - once we have them we could use it to open the item page with it (=> mend ItemPage.open()/EntityPage.open() to accept a revision parameter; requires mending Special:EntityPage to also pass on the revision parameter: T232629).
What this test tries is actually quite simple, it gets tricky because the existing methods (e.g. WikibaseApi.createItem()) are so helpful that they do away with key information (which arguably makes sense most of the time).

Change 535879 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] Skip browser test checking edit links on old revisions

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