Upgrade MediaWiki core to QUnit 2
Closed, ResolvedPublic

Description

Currently at 1.23.1

The 1.x releases up until this point have already provided the 2.0 API (initially as a front for the old code and gradually refactored to be "real").

Removed globals

NOTE: See https://qunitjs.com/upgrade-guide-2.x/ for a detailed migration guide for code still using the deprecated pre-1.14 interfaces.

The following functionality that was deprecated in QUnit 1.x have been removed in QUnit 2.0:

  • Global assert methods – Use assert.equal on the contextual assert object (parameter to QUnit.test callback), not global function equal().
  • Global test suite method – Use QUnit.test and QUnit.module, not global functions module() or test().
  • Static control flow methods – Use assert.async() or return a promise from QUnit.test, don't use static QUnit.stop(), QUnit.asyncTest(), or QUnit.start().
  • Static push method - Use this.pushResult inside an assertion method, not QUnit.push.
  • Test assertion counts - Remove the assertCount parameter from any QUnit.test() call. If needed, use assert.expect() instead.
  • Event listener – Use QUnit.someEventName( handler ) instead of assigning a function directly, like QUnit.someEventName = handler.

The deprecated features in the above list have been removed in the 2.0 release. They will have to be migrated before the upgrade.

New features

Here's an (incomplete) list of some interesting new features available since QUnit 2.0:

  • Core: Improved async handling.
  • Core: Improved performance of built-in assertion methods.
  • Core: Support for nested modules (sub-module grouping), per-test and per-module hooks (before/beforeEach).
  • Assert: Add assert.verifySteps.
  • Assert: Add assert.step.
  • Assert: Add assert.timeout for setting per-test timeout durations.
  • CLI: Introduce a new QUnit CLI
  • .. more at https://github.com/qunitjs/qunit/blob/2.4.0/History.md

See also:

There are a very large number of changes, so older changes are hidden. Show Older Changes
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJul 13 2017, 5:51 AM
Krinkle updated the task description. (Show Details)Jul 13 2017, 5:52 AM

Change 364938 had a related patch set uploaded (by Krinkle; owner: Krinkle):
[VisualEditor/VisualEditor@master] Avoid deprecated QUnit.asyncTest() in ve.init.sa.Platform.test

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

Krinkle moved this task from Inbox to QUnit on the MediaWiki-Core-Tests board.Jul 13 2017, 5:55 AM
Krinkle added a subscriber: Jdforrester-WMF.

Change 365688 had a related patch set uploaded (by Krinkle; owner: Krinkle):
[mediawiki/core@master] qunit: Prepare testrunner for QUnit 2

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

Krinkle triaged this task as Normal priority.Jul 17 2017, 8:24 PM

Change 365706 had a related patch set uploaded (by Krinkle; owner: Krinkle):
[mediawiki/extensions/EventLogging@master] qunit: Avoid deprecated QUnit.asyncTest()

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

Krinkle updated the task description. (Show Details)Jul 17 2017, 8:44 PM

Change 365757 had a related patch set uploaded (by Krinkle; owner: Krinkle):
[mediawiki/core@master] Upgrade QUnit from v1.23.1 to v2.4.0

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

Change 365706 merged by jenkins-bot:
[mediawiki/extensions/EventLogging@master] qunit: Avoid deprecated QUnit.asyncTest()

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

Change 365863 had a related patch set uploaded (by Krinkle; owner: Krinkle):
[mediawiki/extensions/Wikibase@master] qunit: Update testrunner against changes in MediaWiki core

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

Change 365864 had a related patch set uploaded (by Krinkle; owner: Krinkle):
[mediawiki/extensions/Wikidata@master] Backport 'qunit: Update testrunner' from Wikibase to Wikidata

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

Change 365863 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] qunit: Update testrunner against changes in MediaWiki core

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

Change 365864 abandoned by Jforrester:
Backport 'qunit: Update testrunner' from Wikibase to Wikidata

Reason:
Now in master via I97ed4057d512.

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

Change 365688 merged by jenkins-bot:
[mediawiki/core@master] qunit: Prepare testrunner for QUnit 2

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

Krinkle updated the task description. (Show Details)Jul 25 2017, 10:27 PM

Change 365757 merged by jenkins-bot:
[mediawiki/core@master] Upgrade QUnit from v1.23.1 to v2.4.0

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

Krinkle updated the task description. (Show Details)Jul 25 2017, 11:06 PM
Krinkle closed this task as Resolved.
Krinkle claimed this task.

Change 367838 had a related patch set uploaded (by Krinkle; owner: Jforrester):
[mediawiki/core@master] Follow-up 2454f51b274: Upgrade qunit from 1.x to 2.x too

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

Change 367844 had a related patch set uploaded (by Krinkle; owner: Krinkle):
[mediawiki/extensions/UploadWizard@master] Make tests QUnit 2 compatible

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

Change 367844 merged by jenkins-bot:
[mediawiki/extensions/UploadWizard@master] Make tests QUnit 2 compatible

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

Jdforrester-WMF reopened this task as Open.Jul 26 2017, 3:01 AM

Change 368121 had a related patch set uploaded (by Krinkle; owner: Krinkle):
[data-values/value-view@master] Make tests compatible with QUnit 2

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

Change 368121 merged by jenkins-bot:
[data-values/value-view@master] Make tests compatible with QUnit 2

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

Krinkle added subscribers: Jonas, Ladsgroup.EditedJul 29 2017, 1:22 AM

Change 368121 merged by jenkins-bot:
[data-values/value-view@master] Make tests compatible with QUnit 2

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

@Jonas @Ladsgroup If I understand correctly, data-values/value-view (ValueView extension) ends up in the Wikidata extension indirectly, via the Wikibase extension. Assuming so, we need the following:

  • Tag a data-values/value-view release in Git.
  • Bump usage in Wikibase. (maybe redundant, given ^0.19.2 should auto-expand)
  • Wait for Wikidata build.

On a related note, I'm curious why the Wikidata extension is (indirectly) registering the tests of the ValueView extension. Given these are unit tests for a standalone library, I'd assume that the next level downstream (Wikibase) does not need to re-run these tests. Of course, Wikibase could have its own higher-level integration tests, but that's not the case here (and either way, those would be maintained in the Wikibase extension). This is logically similar to how we don't run other upstream/third-party unit tests, given they have already been released.

Yes, we need a value-view release for your changes to become active.
TBH, I am not sure why tests are not running independent. I was not involved in that decision.

Change 369878 had a related patch set uploaded (by Thiemo Mättig (WMDE); owner: Thiemo Mättig (WMDE)):
[data-values/value-view@master] Fix broken tests and release 0.20.1

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

Change 369878 merged by jenkins-bot:
[data-values/value-view@master] Fix broken tests and release 0.20.1

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

Change 370300 had a related patch set uploaded (by Krinkle; owner: Krinkle):
[mediawiki/extensions/Wikibase@master] Make tests QUnit 2 compatible

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

Change 370324 had a related patch set uploaded (by Thiemo Mättig (WMDE); owner: Thiemo Mättig (WMDE)):
[mediawiki/extensions/Wikibase@master] Update QUnit tests to use assert.expect() instead

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

Change 370300 abandoned by Krinkle:
Make tests QUnit 2 compatible

Reason:
Superseded by Ie59c73f2c3e6687803f86. Thanks :)

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

Change 370324 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] Update QUnit tests to use assert.expect() instead

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

Change 370300 restored by Thiemo Mättig (WMDE):
Make tests QUnit 2 compatible

Reason:
Ie59c73f was meant as a baseline, and this was meant to be rebased.

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

Change 370323 had a related patch set uploaded (by Krinkle; owner: Thiemo Mättig (WMDE)):
[mediawiki/extensions/WikidataPageBanner@master] Make QUnit test more compatible by using expect()

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

Change 370323 merged by jenkins-bot:
[mediawiki/extensions/WikidataPageBanner@master] Make QUnit test more compatible by using expect()

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

Change 370836 had a related patch set uploaded (by Thiemo Mättig (WMDE); owner: Thiemo Mättig (WMDE)):
[data-values/value-view@master] Remove forgotten QUnit assertion count

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

Change 370836 merged by jenkins-bot:
[data-values/value-view@master] Remove forgotten QUnit assertion count

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

Change 383117 had a related patch set uploaded (by Thiemo Mättig (WMDE); owner: Thiemo Mättig (WMDE)):
[data-values/value-view@master] Simplify QUnit assertions a little

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

Change 370300 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] Make tests QUnit 2 compatible

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

Change 386061 had a related patch set uploaded (by Krinkle; owner: Jforrester):
[mediawiki/extensions/EventLogging@master] tests: Make compatible with QUnit 2

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

Change 386061 merged by jenkins-bot:
[mediawiki/extensions/EventLogging@master] tests: Make compatible with QUnit 2

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

Change 367838 merged by jenkins-bot:
[mediawiki/core@master] Follow-up 2454f51b274: Upgrade qunit from 1.x to 2.x too

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

Jdforrester-WMF closed this task as Resolved.Oct 24 2017, 6:34 PM

Change 386367 had a related patch set uploaded (by WMDE-Fisch; owner: WMDE-Fisch):
[mediawiki/extensions/WikiEditor@master] Fix Qunit tests to work with 2.x

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

Change 386367 merged by jenkins-bot:
[mediawiki/extensions/WikiEditor@master] Fix Qunit tests to work with 2.x

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