Instead of maintaining a separate setup, it should use the MediaWiki qunit runner
https://www.mediawiki.org/wiki/Manual:JavaScript_unit_testing
Same as T180172: DataTypes should use MediaWiki qunit runner
Instead of maintaining a separate setup, it should use the MediaWiki qunit runner
https://www.mediawiki.org/wiki/Manual:JavaScript_unit_testing
Same as T180172: DataTypes should use MediaWiki qunit runner
Status | Subtype | Assigned | Task | ||
---|---|---|---|---|---|
Resolved | hashar | T190097 Migrate all CI jobs from Nodepool, deprecate its use | |||
Resolved | hashar | T183512 [EPIC] Migrate Mediawiki jobs from Nodepool to Docker | |||
Resolved | hashar | T180171 ArticlePlaceholder should use MediaWiki qunit runner |
Change 393233 had a related patch set uploaded (by Hashar; owner: Hashar):
[integration/config@master] Switch ArticlePlaceholder to npm-browser-test
Change 393233 merged by jenkins-bot:
[integration/config@master] Switch ArticlePlaceholder to npm-browser-test
I have encountered the issue today. The extension relies on grunt-contrib-qunit which depends on phantomjs-prebuild and run qunit tests with PhantomJS. The tests are under tests/qunit:
tests/qunit/ ├── index.html └── modules/ └── ext.articleplaceholder.createArticle/ ├── ext.articleplaceholder.createArticle.test.js └── ext.articleplaceholder.createArticleTranslation.test.js 2 directories, 3 files
We should be able to migrate them to use Special:JavascriptTest.
Change 444936 had a related patch set uploaded (by Hashar; owner: Hashar):
[mediawiki/extensions/ArticlePlaceholder@master] Port QUnit test to MediaWiki runner
I have poked wikitech-l and got feedback from @Aleksey_WMDE For reference the thread is:
The last post is pointing at node Blog Post: Fast and isolated JS unit tests, or how to run QUnit tests with NodeJS. Which is definitely developer friendly and probably faster but has its own drawbacks (using stubs since mediawiki JS not being available).
I have migrated the CI of almost all extensions to use Quibble and ArticlePlaceholder is one of the last left to migrate. It currently fails on CI due to grunt-contrib-qunit depending on phantomjs which can't be installed due to lack of bzip2. That itself could be fixed, then that repository is the sole using that mechanism and should be normalized to use the MediaWiki karma runner. There are a few reasons for that:
I have proposed change 44936 which does the integration, but the tests fail. As I understand it there is an helper method (createAndShowDialog)to open an OOUi dialog, but by the time the assertion is run, the dialog is not opened yet.
The createAndShowDialog creates the dialog then ask OOUi window manager to open a window with it. But that is done asynchronously and the assertion runs first. That thus fails to find the ui element.
I have tried to make createAndShowDialog to return the opened promise and then write the test in it, but it still fails. My knowledge of Javascript, OOUi or Promises is rather limited and I can't find a way to fix it up :-/
Once fixed, ArticlePlaceholder will be aligned with all other extensions and I will be able to migrate it to the new CI jobs based on Quibble :]
@hashar So the reason why https://gerrit.wikimedia.org/r/#/c/mediawiki/extensions/ArticlePlaceholder/+/458467/ fails is also this one? Thanks!
Change 462897 had a related patch set uploaded (by Hashar; owner: Hashar):
[mediawiki/extensions/ArticlePlaceholder@master] Remove grunt-contrib-qunit test runner
Change 462898 had a related patch set uploaded (by Hashar; owner: Hashar):
[integration/config@master] Migrate ArticlePlaceholder to Quibble
Change 462898 merged by jenkins-bot:
[integration/config@master] Migrate ArticlePlaceholder to Quibble
Change 462897 merged by jenkins-bot:
[mediawiki/extensions/ArticlePlaceholder@master] Remove grunt-contrib-qunit test runner
The reason I tackled this task was to migrate ArticlePlaceholder to Docker/Quibble. I have dropped grunt-contrib-qunit and migrated the repository.
There is a patch pending to migrate to Special:JavascriptTest but I cant complete it.
Change 444936 had a related patch set uploaded (by Addshore; owner: Hashar):
[mediawiki/extensions/ArticlePlaceholder@master] tests: Port QUnit suite to MediaWiki runner
Change 444936 merged by jenkins-bot:
[mediawiki/extensions/ArticlePlaceholder@master] tests: Port QUnit suite to MediaWiki runner
Resolved https://gerrit.wikimedia.org/r/#/c/mediawiki/extensions/ArticlePlaceholder/+/444936/ with dramatic help from @Krinkle to finish the change!