Page MenuHomePhabricator

Reduce test-suite runtime and separate offline, recorded, and live tests in pywikibot
Open, Needs TriagePublic

Description

Background
The Pywikibot test suite currently takes several minutes to complete in some environments. Its runtime includes live wiki requests, authenticated tests, subprocess-based script checks, deliberately exhaustive tests, and ordinary offline unit tests.
There are some opportunities to shorten the feedback loop while preserving meaningful coverage:

  • Run independent offline tests in parallel.
  • Remove unnecessary wall-clock sleeps.
  • Separate offline, recorded, live, login, and write tests more clearly.
  • Make cached API tests deterministic and strictly offline.
  • Reduce repeated subprocess startup and excessive live API requests.
  • Avoid running coverage and the complete live suite across every CI configuration.

Objective
Improve the performance, determinism, and organization of the test suite without reducing meaningful test coverage or increasing load on public services.

Event Timeline

Change #1325962 had a related patch set uploaded (by Mahveotm; author: Mahveotm):

[pywikibot/core@master] tests: Replace deterministic sleeps with synchronization

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

Change #1326009 had a related patch set uploaded (by Mahveotm; author: Mahveotm):

[pywikibot/core@master] tests: Test pwb alternate selection directly

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

Change #1326010 had a related patch set uploaded (by Mahveotm; author: Mahveotm):

[pywikibot/core@master] tests: Synchronize page locking test

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

Change #1326009 merged by Xqt:

[pywikibot/core@master] tests: Test pwb alternate selection directly

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

Change #1325962 merged by jenkins-bot:

[pywikibot/core@master] tests: Synchronize bounded executor test

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

Change #1326010 merged by jenkins-bot:

[pywikibot/core@master] tests: Synchronize page locking test

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

Change #1326340 had a related patch set uploaded (by Mahveotm; author: Mahveotm):

[pywikibot/core@master] tests: Avoid login requests in cache test

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

Change #1335043 had a related patch set uploaded (by Mahveotm; author: Mahveotm):

[pywikibot/core@master] tests: Reuse purge result in page test

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

Change #1335072 had a related patch set uploaded (by Mahveotm; author: Mahveotm):

[pywikibot/core@master] tests: Reuse links in preload tests

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

Change #1335072 merged by jenkins-bot:

[pywikibot/core@master] tests: Reuse links in preload tests

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

Change #1335043 merged by jenkins-bot:

[pywikibot/core@master] tests: Reuse purge result in page test

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

Change #1326340 merged by jenkins-bot:

[pywikibot/core@master] tests: Avoid login requests in cache test

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

Change #1345337 had a related patch set uploaded (by Aruotes; author: Aruotes):

[pywikibot/core@master] tests: Optimize test suite runtime and environment separation

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

Change #1345337 had a related patch set uploaded (by Xqt; author: Aruotes):

[pywikibot/core@master] tests: Optimize test suite runtime and environment separation

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

Change #1345337 abandoned by Xqt:

[pywikibot/core@master] tests: Optimize test suite runtime and environment separation

Reason:

No content

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

Change #1354099 had a related patch set uploaded (by Thiagollipe; author: Thiagollipe):

[pywikibot/core@master] tests: Mark page watch test as a write test

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