Skip to content

Migrate to offline test suite with mocked Wikibase API#994

Merged
LeMyst merged 1 commit into
masterfrom
rework-tests
Jul 3, 2026
Merged

Migrate to offline test suite with mocked Wikibase API#994
LeMyst merged 1 commit into
masterfrom
rework-tests

Conversation

@LeMyst

@LeMyst LeMyst commented Jul 3, 2026

Copy link
Copy Markdown
Owner

Complete restructuring of the test infrastructure to run fully offline with requests-mock and MockWikibase emulation, eliminating network dependency and improving test reliability.

  • Add MockWikibase: in-memory emulation of MediaWiki/Wikibase action API and SPARQL endpoint
  • Create test/fixtures/ with JSON snapshots of reference entities (Q582, P50, L5, M75908279)
  • Add scripts/update_test_fixtures.py: automated fixture refresh from live APIs
  • Consolidate and rewrite 78+ tests: migrate from network calls to offline mocked instance
  • Add integration tests in test/integration/ for real Wikibase instances (deselected by default)
  • Add docker-compose for local Wikibase testing
  • Remove httpbin dependency from CI workflows
  • Add monthly automated fixture update workflow with pull request creation
  • Add requests-mock as dev dependency and pytest configuration with markers
  • Create AGENTS.md: comprehensive developer guide for the project

Benefits: Tests are now deterministic, fast (no network I/O), and repeatable. CI no longer depends on external services.

Complete restructuring of the test infrastructure to run fully offline with requests-mock and MockWikibase emulation, eliminating network dependency and improving test reliability.

- Add MockWikibase: in-memory emulation of MediaWiki/Wikibase action API and SPARQL endpoint
- Create test/fixtures/ with JSON snapshots of reference entities (Q582, P50, L5, M75908279)
- Add scripts/update_test_fixtures.py: automated fixture refresh from live APIs
- Consolidate and rewrite 78+ tests: migrate from network calls to offline mocked instance
- Add integration tests in test/integration/ for real Wikibase instances (deselected by default)
- Add docker-compose for local Wikibase testing
- Remove httpbin dependency from CI workflows
- Add monthly automated fixture update workflow with pull request creation
- Add requests-mock as dev dependency and pytest configuration with markers
- Create AGENTS.md: comprehensive developer guide for the project

Benefits: Tests are now deterministic, fast (no network I/O), and repeatable. CI no longer depends on external services.
@LeMyst LeMyst merged commit aab721e into master Jul 3, 2026
15 checks passed
@LeMyst LeMyst deleted the rework-tests branch July 3, 2026 21:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant