Migrate to offline test suite with mocked Wikibase API#994
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Complete restructuring of the test infrastructure to run fully offline with requests-mock and MockWikibase emulation, eliminating network dependency and improving test reliability.
Benefits: Tests are now deterministic, fast (no network I/O), and repeatable. CI no longer depends on external services.