Repository navigation
test(cli): make snapshot tests robust against live Wikipedia churn - #589
Merged
Merged
Conversation
Two changes to tests/cli/test_cli.sh: 1. Expand NONDETERMINISTIC_TESTS — backlinks, categories, links, langlinks, images (non-JSON variants), geosearch_max_dim, and search_en_json were treated as strict exact-match fixtures but their content changes between consecutive API calls. They now use the weak check (non-empty / valid JSON / line count within ±50 %). 2. Small mismatches no longer exit 1 — a <5 % word-count difference already printed a yellow SMALL MISMATCH warning; now it is truly a warning only, so a single added sentence in a large article does not fail CI. Also update the fixtures recorded by the most recent run of make run-test-cli-record and fix the section_en test to use the 'Crust' section (Etymology was removed from the Earth article). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #589 +/- ##
=======================================
Coverage 94.04% 94.04%
=======================================
Files 76 76
Lines 3373 3373
=======================================
Hits 3172 3172
Misses 201 201 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Summary
NONDETERMINISTIC_TESTS:backlinks_en/json,categories_en/json,links_en/json,langlinks_fr,images_en,images_en_imageinfo,images_en_limit,geosearch_max_dim, andsearch_en_jsonwere treated as strict exact-match fixtures but their content changes between consecutive Wikipedia API calls. They now use the weak check (non-empty / valid JSON / line count within ±50%).SMALL MISMATCHwarning; it is now truly a warning-only so a single added sentence in a large article does not fail CI.section_entest: Updated from'Etymology'to'Crust'(the Etymology section was removed from the Earth article).Problem
make run-test-cli-recordfollowed immediately bymake run-test-cli-verifywould still fail becauseverifyre-calls the live Wikipedia API and gets slightly different data — Wikipedia content (backlinks, category membership, image lists, search result metadata) changes continuously.Test plan
make run-tests-cli-unit— 64 tests passmake run-test-cli-record && make run-test-cli-verify— should now pass (or show only yellow warnings, noexit 1)🤖 Generated with Claude Code