Page MenuHomePhabricator

Improve test coverage of SpecialMWOAuthConsumerRegistration
Closed, ResolvedPublic

Assigned To
Authored By
DAlangi_WMF
Feb 4 2026, 3:00 PM
Referenced Files
F77568576: image.png
Apr 23 2026, 9:46 PM
F77568533: image.png
Apr 23 2026, 9:46 PM
F77568524: image.png
Apr 23 2026, 9:46 PM
F77514166: image.png
Apr 23 2026, 4:24 PM
F77514133: image.png
Apr 23 2026, 4:24 PM
F77514099: image.png
Apr 23 2026, 4:24 PM
F72153376: Screenshot 2026-02-17 at 3.00.24 PM.png
Feb 17 2026, 2:03 PM
F72153374: Screenshot 2026-02-17 at 3.01.48 PM.png
Feb 17 2026, 2:03 PM

Description

SpecialMWOAuthConsumerRegistration is the flow for registering and updating OAuth 1 and OAuth 2 consumers. It would most likely involve writing unit and integration tests to cover the functionality.

We'll likely write integration tests to cover functionality related to the Special page UI, the /propose and /update features, and their interactions with the action API and the DB (e.g., SubmitControl for the aforementioned endpoints). It's probably possible to use SpecialPageTestBase, since this will involve testing a special page and ApiTestCase for action API-related functionality.

Impact

Event Timeline

Adding QS-Test-Automation to keep aware of this, this is a great effort. Where's test coverage going to be documented? Will it flow to https://doc.wikimedia.org/cover-extensions/ or somewhere else?

Adding QS-Test-Automation to keep aware of this, this is a great effort. Where's test coverage going to be documented? Will it flow to https://doc.wikimedia.org/cover-extensions/ or somewhere else?

Ack! It'll flow to the site you linked above. Specifically: https://doc.wikimedia.org/cover-extensions/OAuth/src/index.html

For /propose:

  • owner-only / non-owner-only workflow is very different
  • OAuth 1 and 2 are quite different
  • should test consumers using RSA keys vs. a secret
  • need separate tests for auto-approved ($wgOAuthAutoApprove) and non-auto-approved consumers
  • there are a bunch of error conditions that should have tests, like using http: for OAuth 2 (although maybe better handled in ConsumerSubmitControl unit tests)

For /update, I think the only meaningful difference is RSA keys vs. secrets (and even that only when the reset option is used).

DAlangi_WMF changed the task status from Open to In Progress.Feb 9 2026, 8:41 AM
DAlangi_WMF claimed this task.

Change #1238314 had a related patch set uploaded (by D3r1ck01; author: Derick Alangi):

[mediawiki/extensions/OAuth@master] tests: Add integration tests for Special:MWOAuthConsumerRegistration

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

(17/02/2026): A measure of code coverage report generated locally for this class:

Screenshot 2026-02-17 at 3.01.48 PM.png (3,438×1,088 px, 458 KB)
Screenshot 2026-02-17 at 3.00.24 PM.png (1,917×644 px, 169 KB)

Change #1244642 had a related patch set uploaded (by D3r1ck01; author: Derick Alangi):

[mediawiki/extensions/OAuth@master] tests: Follow-up on Ied5d04ece0ececa14dfb5

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

Change #1238314 merged by jenkins-bot:

[mediawiki/extensions/OAuth@master] tests: Add integration tests for Special:MWOAuthConsumerRegistration

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

Change #1244642 merged by jenkins-bot:

[mediawiki/extensions/OAuth@master] tests: Follow-up on Ied5d04ece0ececa14dfb5

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

Change #1276759 had a related patch set uploaded (by Bartosz Dziewoński; author: Bartosz Dziewoński):

[mediawiki/extensions/OAuth@master] tests: Fix SpecialMWOAuthConsumerRegistrationTest failure

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

Change #1276787 had a related patch set uploaded (by Bartosz Dziewoński; author: Bartosz Dziewoński):

[mediawiki/extensions/OAuth@master] tests: Allow SpecialMWOAuthConsumerRegistrationTest to cover ConsumerSubmitControl, SubmitControl

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

Change #1276759 merged by jenkins-bot:

[mediawiki/extensions/OAuth@master] tests: Fix SpecialMWOAuthConsumerRegistrationTest failure

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

Change #1276787 merged by jenkins-bot:

[mediawiki/extensions/OAuth@master] tests: Allow SpecialMWOAuthConsumerRegistrationTest to cover ConsumerSubmitControl, SubmitControl

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

@matmarex, yes, I think this one has been significantly covered. Maybe @JTweed-WMF could look at this and conclude, but my opinion would be closing it.