Skip to content

test: add unit tests for Strawberry adapter extension#22

Merged
nogueira-raphael merged 1 commit intomainfrom
test/strawberry-extension-unit-tests
Feb 15, 2026
Merged

test: add unit tests for Strawberry adapter extension#22
nogueira-raphael merged 1 commit intomainfrom
test/strawberry-extension-unit-tests

Conversation

@nogueira-raphael
Copy link
Copy Markdown
Owner

Summary

  • Add 46 unit tests for CacheExtension factory and inner _CacheExtension class in the Strawberry adapter
  • Bring coverage from 13% to 100% for cacheql.adapters.strawberry
  • Cover all methods: _check_cache, _cache_response, on_operation, on_execute, _handle_mutation_invalidation, _extract_tags_from_response, get_results

Test plan

  • All 46 new unit tests pass (uv run pytest tests/unit/adapters/strawberry/ -v)
  • Full test suite passes (185 tests)
  • Coverage at 100% for cacheql.adapters.strawberry
  • Ruff lint passes

Add 46 unit tests covering all methods of the CacheExtension factory
and inner _CacheExtension class, bringing coverage from 13% to 100%.

Tests cover: cache check logic, mutation detection, should_cache
callback, on_execute/on_operation lifecycle, cache response storage,
mutation auto-invalidation, tag extraction, and get_results metadata.
@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 15, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.12%. Comparing base (3652910) to head (46b5f92).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #22      +/-   ##
==========================================
+ Coverage   71.41%   79.12%   +7.70%     
==========================================
  Files          34       34              
  Lines        1025     1025              
  Branches      162      162              
==========================================
+ Hits          732      811      +79     
+ Misses        254      175      -79     
  Partials       39       39              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@nogueira-raphael nogueira-raphael merged commit 94830c5 into main Feb 15, 2026
7 checks passed
@nogueira-raphael nogueira-raphael deleted the test/strawberry-extension-unit-tests branch February 15, 2026 11:46
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