test: add unit tests for galaxy/core/events.py#327
Open
nuthalapativarun wants to merge 1 commit intomicrosoft:pre-releasefrom
Open
test: add unit tests for galaxy/core/events.py#327nuthalapativarun wants to merge 1 commit intomicrosoft:pre-releasefrom
nuthalapativarun wants to merge 1 commit intomicrosoft:pre-releasefrom
Conversation
Cover the core event system components that had no dedicated unit tests: - EventType enum (all members, unique values, string type) - Event / TaskEvent / ConstellationEvent / AgentEvent / DeviceEvent dataclasses - IEventObserver abstract interface (contract and instantiation guard) - IEventPublisher abstract interface (instantiation guard) - EventBus (subscribe, unsubscribe, publish, error isolation, singleton) Tests are structured using pytest classes and pytest-asyncio for the async publish_event paths. They follow the pattern used in the existing tests/unit/galaxy/ test suite.
Author
|
Hi team — gentle ping on this PR. Happy to rebase or address any feedback if needed. Let me know if there's anything blocking review! |
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
galaxy/core/events.pyhad no dedicated unit tests. The Galaxy framework's event system is foundational (used by constellation agents, device manager, and WebSocket observers), so coverage helps catch regressions early.Changes
Added
tests/unit/galaxy/core/test_events.pywith 37 test cases covering:EventTypeEvent/ sub-dataclassesTaskEvent,ConstellationEvent,AgentEvent,DeviceEvent)IEventObserverIEventPublisherEventBusget_event_bus()Testing
Tests follow the existing
tests/unit/galaxy/conventions (pytest classes,pytest-asynciofor async paths,unittest.mock.AsyncMockfor observer mocks). All tests are designed for Python 3.10+ which is the project's stated minimum.