Skip to content

Migrate Keeper tests to simple testing with improved coverage#3497

Merged
masih merged 3 commits into
mainfrom
masih/cap-cleanup
May 22, 2026
Merged

Migrate Keeper tests to simple testing with improved coverage#3497
masih merged 3 commits into
mainfrom
masih/cap-cleanup

Conversation

@masih

@masih masih commented May 22, 2026

Copy link
Copy Markdown
Collaborator

Refine Keeper and tests to cover gaps in testing, and remove superfluous use of testify suit. Nowhere else in the codebase this suit of tests are used.

Add extra tests to cover gaps in coverage and concurrency control.

Refine Keeper and tests to cover gaps in testing, and remove superfluous
use of testify suit. Nowhere else in the codebase this suit of tests
are used.

Add extra tests to cover gaps in coverage and concurrency control.
@github-actions

github-actions Bot commented May 22, 2026

Copy link
Copy Markdown

The latest Buf updates on your PR. Results from workflow Buf / buf (pull_request).

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedMay 22, 2026, 4:53 PM

@codecov

codecov Bot commented May 22, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 92.85714% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 59.11%. Comparing base (67f1c97) to head (d0efbc0).

Files with missing lines Patch % Lines
sei-cosmos/x/capability/keeper/keeper.go 92.85% 1 Missing and 2 partials ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3497      +/-   ##
==========================================
- Coverage   59.12%   59.11%   -0.01%     
==========================================
  Files        2187     2187              
  Lines      182240   182190      -50     
==========================================
- Hits       107747   107703      -44     
- Misses      64835    64840       +5     
+ Partials     9658     9647      -11     
Flag Coverage Δ
sei-chain-pr 93.58% <92.85%> (?)
sei-db 70.41% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
sei-cosmos/x/capability/keeper/keeper.go 93.58% <92.85%> (+7.19%) ⬆️

... and 25 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@masih masih requested review from arajasek and sei-will May 22, 2026 11:15
@masih masih marked this pull request as ready for review May 22, 2026 11:15
@cursor

cursor Bot commented May 22, 2026

Copy link
Copy Markdown

PR Summary

Medium Risk
Touches core capability pointer/lookup behavior by switching capMap to a sync.Map with canonical per-index interning, which could affect authentication/claim semantics if any edge case is missed. Large test refactor and added coverage reduce risk but the keeper logic change is runtime-critical.

Overview
Stabilizes in-memory capability identity and improves safety under caching/concurrency. The keeper now uses a sync.Map plus internCapability to ensure a single canonical *Capability per index is reused across NewCapability, GetCapability, ClaimCapability, and genesis initialization, avoiding stale/mismatched pointers and removing the need to delete entries on release.

Reworks and expands tests. Migrates keeper_test.go off testify/suite to plain testing + require, runs tests in parallel with per-test setup, and adds new cases covering seal/scoping panics, scope isolation, cached-store revert/branch behavior, InitializeIndex, InitMemStore idempotency, LookupModules error paths, and keeper-level GetOwners/SetOwners + final-release cleanup.

Reviewed by Cursor Bugbot for commit d0efbc0. Bugbot is set up for automated code reviews on this repo. Configure here.

@masih masih added this pull request to the merge queue May 22, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks May 22, 2026
@masih masih enabled auto-merge May 22, 2026 16:52
@masih masih added this pull request to the merge queue May 22, 2026
Merged via the queue into main with commit 7dbd3e5 May 22, 2026
49 checks passed
@masih masih deleted the masih/cap-cleanup branch May 22, 2026 17:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants