- Name of project: Extension:WikiUnit (working title, may change)
- Project home page: none yet
- Name of team which owns the project: none yet
- Primary contact for the project: @Evad37
- Target date for deployment: none yet
- Link to code repository: none yet (I want to check if the concept is workable, or how it could be made workable, before starting anything)
- Is this a brand-new project: yes
- Has this project ever been reviewed before: (Phab tasks, etc.) no
- Has any risk assessment (STRIDE, etc.) been performed: no
- Is there an existing RFC or has this been presented to the community: enwiki discussion, T240647, T39230 (more generally, not for this specific concept: T234661)
- Is this project tied to a team quarterly goal: no
Description of the project and how it will be used
Per T240647 (more details there):
An extension that provides unit testing capability for gadgets/scripts, using QUnit. Unit tests are defined on a script's /testcases.js subpage.
Tests are run when editing, after previewing or showing changes (action=submit) -- or perhaps a new button "Run unit tests".
There may need to restrictions on where this can operate for security:
- MediaWiki namespace should be okay - editing is restricted to interface admins
- Elsewhere could be problematic. The safest way would be to just not operate on these pages... but perhaps just having a confirmation box with a "scary" message (similar to enwiki's MediaWiki:Jswarning) would be good enough, given that it's not really any worse than using importScript on your common.js
- Perhaps there should also be a note or warning that code entered into the textbox will be executed to run unit tests
Additionally, per T39230, there should be a Special page to run tests for the current saved version of a script (without needing to edit it).
Description of any sensitive data to be collected or exposed
Dependencies and vendor code
QUnit, and probably mediawiki.api, mediawiki.util, and oojs