Jump to content

Talk:Continuous integration/Entry points

Add topic
From mediawiki.org
[edit]

At section 1.2 JavaScript documentation, Use npm run doc as the entry point. The convention is to use Template:JSDuck the Template:JSDuck is undefined, can someone correct please. Thanks -- Christian 🇫🇷 FR (talk) 09:58, 16 January 2024 (UTC)Reply

I don't know who thought it'd be a template. I've fixed it to just reference the real page for JSDoc, and dropped the old JSDuck references entirely. Jdforrester (WMF) (talk) 14:29, 16 January 2024 (UTC)Reply

php-parallel-lint

[edit]

The entry points table says that php-parallel-lint is used as a PHP linter. However I can't remember ever having seen this in Wikimedia production, Jenkins CI logs, as a config file in a repo, etc. Is this tool still around, or has it been replaced by PHP CodeSniffer? Thanks. –Novem Linguae (talk) 11:08, 14 May 2024 (UTC)Reply

composer lint is an entrypoint configured in the mediawiki/core.git composer.json. -- BDavis (WMF) (talk) 14:56, 14 May 2024 (UTC)Reply
@Novem Linguae: I've reverted your re-labelling edit, as the lint stage tools generally do full linting, not just syntax checking. HTH! Jdforrester (WMF) (talk) 13:28, 15 May 2024 (UTC)Reply
No worries. I wonder if the word linting overlaps too much with the code style column, but I see your point. –Novem Linguae (talk) 16:50, 15 May 2024 (UTC)Reply

Where to put test scripts in package.json

[edit]

For MediaWiki extensions and skins, the npm test script should not run project tests, only linters.

What's a good spot in package.json's scripts section for project tests like QUnit and Jest? –Novem Linguae (talk) 15:08, 30 May 2024 (UTC)Reply

Do you mean the kinds of tests run via the command line, rather than in regular ("quibble") CI? If so maybe test:qunit or test:jest or similar? In practice quite a few extensions hack into npm test for code to lint as well as run tests that aren't MW-specific, though there's not really much settled protocol on this, and so this advice might not be good. Jdforrester (WMF) (talk) 18:26, 30 May 2024 (UTC)Reply
Thanks, the test:qunit and test:jest suggestion is good. In the long run, I wonder if npm run lint might be a better spot for linter tests. Probably too much trouble to change it though :( –Novem Linguae (talk) 13:19, 31 May 2024 (UTC)Reply
Anything other than linters (e.g. unit/integration tests) are run through the normal MediaWiki channels
What are the normal MediaWiki channels? If a repo has QUnit or Jest tests, are they automatically run by Quibble somehow even if they aren't in the scripts section of the package.json file? –Novem Linguae (talk) 13:22, 31 May 2024 (UTC)Reply
No. Quibble does a lot of different things, but in this regard, it runs npm cit and then the Special:JavaScriptTest page, and that's it, so your code tests have to be in one of those locations. Jdforrester (WMF) (talk) 14:05, 31 May 2024 (UTC)Reply
Special:JavaScriptTest runs QUnit tests right? If a repo has Jest tests, and we want them to run in CI, they have to go in npm test right? If so, maybe we should change the npm test script should not run project tests, only linters to reflect this. –Novem Linguae (talk) 14:21, 31 May 2024 (UTC)Reply
Maybe. This isn't really the venue to make that decision; I'd suggest starting an RfC, but that process is dead. :-( Jdforrester (WMF) (talk) 17:29, 31 May 2024 (UTC)Reply