• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

zincware / ZnSocket / 20421496155
72%

Build:
DEFAULT BRANCH: main
Ran 22 Dec 2025 04:21AM UTC
Jobs 4
Files 14
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

12 Dec 2025 06:36AM UTC coverage: 71.788% (+6.8%) from 64.954%
20421496155

push

github

web-flow
Feature/improve-memory-storage (#116)

* introduce memory storage

* rename storage class

* Add Redis-compatible sorted sets, expiry, and scan to MemoryStorage

Implements missing Redis operations needed for zndraw application:

- Sorted set operations: zadd, zcard, zrange, zrangebyscore,
  zrevrangebyscore, zrem, zcount with O(log n) performance using
  sortedcontainers.SortedList
- Expiry/TTL support: setex, expire with lazy cleanup on access
- Key scanning: scan_iter with glob pattern matching
- Enhanced thread safety with expiry checks on all read operations
- Pipeline support matching redis-py behavior

All 80 tests pass against both MemoryStorage and Redis to ensure
exact API compatibility. MemoryStorage now serves as a drop-in
replacement for Redis in single-process scenarios.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* Enhance MemoryStorage with full Redis-py API compatibility

Add comprehensive Redis-compatible features to MemoryStorage to ensure
exact API parity with redis-py for improved testing and development.

Key enhancements:
- Add nx, xx, ex parameters to set() method for conditional sets and expiration
- Implement incr() and decr() methods for atomic counter operations
- Add count parameter to scan_iter() for result limiting
- Fix hgetall() to return independent copies instead of internal references
- Add _encode_value() method with strict type validation matching Redis

Type validation now exactly matches Redis behavior:
- Accept: str, bytes, int, float (converting numbers to strings)
- Reject: bool, dict, list, and other types with DataError

Test coverage:
- 131 total tests (previously 88)
- All tests pass for both MemoryStorage and redisclient
- Added tests for JSON string handling, type validation, and edge cases
- Verified exact behavioral compatibility with Redis

This ensures MemoryStorage can be used as a drop-in replacement for
Redis during testing with... (continued)

470 of 604 new or added lines in 4 files covered. (77.81%)

1397 of 1946 relevant lines covered (71.79%)

2.86 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
1
32.6
-1.52% znsocket/server.py
133
77.76
znsocket/storages/memory.py
Jobs
ID Job ID Ran Files Coverage
1 20421496155.1 22 Dec 2025 04:21AM UTC 14
71.43
GitHub Action Run
2 20421496155.2 22 Dec 2025 04:21AM UTC 14
71.79
GitHub Action Run
3 20421496155.3 22 Dec 2025 04:22AM UTC 14
71.63
GitHub Action Run
4 20421496155.4 22 Dec 2025 04:22AM UTC 14
71.63
GitHub Action Run
Source Files on build 20421496155
  • Tree
  • List 14
  • Changed 2
  • Source Changed 0
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 69003823 on github
  • Prev Build on main (#16408338322)
  • Next Build on main (#20564703585)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc