Repository navigation
Test: address scopes, /services and /processes limits, package cache - #14
Merged
Merged
Conversation
…es, and package cache - Test address scope mapping (_safe_addr) for loopback, tailscale, private-lan, public-or-host - Test wildcard address scope depends on container detection - Test empty address handling (no IP or port) - Test services endpoint grouping, deduplication, sorting, and limit clamping - Test services endpoint gracefully handles AccessDenied errors - Test processes endpoint sorting by CPU/memory, skipping AccessDenied, and limit clamping - Test packages endpoint caching behavior with proper expiration timing All tests use mocking to avoid dependencies on real system state and cover edge cases that were not previously tested by the existing test suite.
… format Listener lists were compared as sets although the order is part of the behaviour; the limit cases only counted rows; the docker patch could recurse into itself; the denied-process stand-in was convoluted; the file was not ruff-formatted. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Adds
tests/test_inventory_limits.py(23 tests), pinning logic insystemgate/main.pythat CI did not cover:_safe_addrscope words (loopback, tailscale, private-lan incl. the 172.16-31 edges, public-or-host, wildcard inside/outside a container, empty address),/servicesgrouping, de-duplication, sort order, ids, limit clamp 1..200 (default 80) and a denied connection listing,/processessort by CPU then memory, AccessDenied skipping and limit clamp to 100, and the one-hour/packagescache (cached at 3599 s, recomputed at 3600 s). Everything is patched: no network, no real psutil listing, no subprocess.Full suite: 71 passed, 8 skipped. ruff and file sizes pass.
Mutations tried in
systemgate/main.py(each restored):startswith("100.")to"101."fails the tailscale scope case;min(limit, 200)to300fails the clamp test;PACKAGE_CACHE_SECONDS3600 to 3601 fails the cache test.Reviewer fixes to the GLM draft: listeners were compared as sets instead of ordered lists, process limit cases checked counts only (now pid order), the docker patch could recurse, ruff format.
Written by GLM (worker w20-mvy9fw14), reviewed by Claude.
🤖 Generated with Claude Code