Page MenuHomePhabricator

Thanks QUnit tests are broken in Special:JavaScriptTest
Closed, ResolvedPublic

Description

Steps to reproduce:

  • set up MediaWiki via Vagrant, with the echo role
  • visit Special:JavaScriptTest in Chrome (at the time of writing this, Special:JavaScriptTest?testId=508e3524 is the direct link)
gets cookie with two values
Expected: 	
[
  "17",
  "11"
]
Result: 	
[
  "9",
  "9",
  "9",
// lots more
]

Source: 	
    at Object.<anonymous> (http://dev.wiki.local.wmftest.net:22100/w/extensions/Thanks/tests/qunit/test_ext.thanks.thank.js?b20c8:13:9)
    at runTest (http://dev.wiki.local.wmftest.net:22100/w/resources/lib/qunitjs/qunit.js:3048:30)
    at Test.run (http://dev.wiki.local.wmftest.net:22100/w/resources/lib/qunitjs/qunit.js:3034:6)
    at http://dev.wiki.local.wmftest.net:22100/w/resources/lib/qunitjs/qunit.js:3265:12
    at processTaskQueue (http://dev.wiki.local.wmftest.net:22100/w/resources/lib/qunitjs/qunit.js:2621:24)
    at http://dev.wiki.local.wmftest.net:22100/w/resources/lib/qunitjs/qunit.js:2625:8
loads 100 ids from a cookie
Expected: 	"0"
Result: 	"8"
Source: 	
    at Object.<anonymous> (http://dev.wiki.local.wmftest.net:22100/w/extensions/Thanks/tests/qunit/test_ext.thanks.thank.js?b20c8:19:9)
    at runTest (http://dev.wiki.local.wmftest.net:22100/w/resources/lib/qunitjs/qunit.js:3048:30)
    at Test.run (http://dev.wiki.local.wmftest.net:22100/w/resources/lib/qunitjs/qunit.js:3034:6)
    at http://dev.wiki.local.wmftest.net:22100/w/resources/lib/qunitjs/qunit.js:3265:12
    at processTaskQueue (http://dev.wiki.local.wmftest.net:22100/w/resources/lib/qunitjs/qunit.js:2621:24)
    at http://dev.wiki.local.wmftest.net:22100/w/resources/lib/qunitjs/qunit.js:2625:8
`

Event Timeline

Tgr created this task.May 29 2020, 4:36 PM
Restricted Application added a project: Growth-Team. · View Herald TranscriptMay 29 2020, 4:36 PM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Tgr added a comment.May 29 2020, 5:10 PM

The test has a command $.cookie( mw.thanks.thanked.cookieName, escape( '17,11' ) ) which should set up a fixture for the cookie, but it doesn't. Seems to be some kind of cookie path mess, I have three otherwise identical cookies with the paths /w, /wiki and /wiki/JavaScriptTest, with only the middle one having the correct value.

Tgr added a comment.May 29 2020, 7:39 PM

I guess the question is, why is Thanks using $.cookie instead of mw.cookie?

Change 599974 had a related patch set uploaded (by Gergő Tisza; owner: Gergő Tisza):
[mediawiki/extensions/Thanks@master] Use mw.cookie instead of $.cookie

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

Change 599974 merged by jenkins-bot:
[mediawiki/extensions/Thanks@master] Use mw.cookie instead of $.cookie

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

Tgr closed this task as Resolved.Jun 3 2020, 11:30 AM
Tgr claimed this task.