Open
Conversation
|
There was a problem hiding this comment.
Pull request overview
This PR expands the pytest test suite for the emu plugin, adding tests for parsers, requirements, planner, service, GUI, and the hook module. It introduces a conftest.py that stubs out caldera framework dependencies so tests can run in isolation.
Changes:
- Added
tests/conftest.pywith stub classes for caldera framework objects and sys.modules patching - Added new test files (
test_requirements.py,test_hook.py,test_emu_gui.py) and expanded existing ones (test_emu_svc.py,test_vssadmin_shadow_parser.py,test_group_filtered_planner.py) - Added
pytest.iniconfiguration andplugins/emu/conf/default.yml
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/conftest.py | Shared stubs and fixtures for running tests without caldera |
| tests/test_requirements.py | Tests for check_registered and check_lightneuron_registered requirements |
| tests/test_hook.py | Tests for hook.py enable function and module attributes |
| tests/test_emu_gui.py | Tests for EmuGUI construction and splash handler |
| tests/test_emu_svc.py | Expanded EmuService tests covering ingestion, payloads, cloning, etc. |
| tests/test_vssadmin_shadow_parser.py | Additional parser and parse method tests |
| tests/test_group_filtered_planner.py | Refactored planner tests using stubs instead of real Link objects |
| pytest.ini | pytest configuration with asyncio_mode=auto |
| plugins/emu/conf/default.yml | Default config file for emu plugin |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+42
to
+49
| # Provide minimal config | ||
| conf_dir = os.path.join('plugins', 'emu', 'conf') | ||
| os.makedirs(conf_dir, exist_ok=True) | ||
| conf_path = os.path.join(conf_dir, 'default.yml') | ||
| if not os.path.exists(conf_path): | ||
| with open(conf_path, 'w') as f: | ||
| yaml.dump({'evals_c2_host': '127.0.0.1', 'evals_c2_port': 8888}, f) | ||
|
|
Comment on lines
+174
to
+177
| # Also make the plugin available as plugins.emu | ||
| _plugins_emu_mod = type(sys)('plugins.emu') | ||
| _plugins_emu_mod.__path__ = [_repo_root] | ||
| sys.modules.setdefault('plugins.emu', _plugins_emu_mod) |
Comment on lines
+52
to
+53
| # The underlying function or its wrapper should be a coroutine function | ||
| assert asyncio.iscoroutinefunction(gui.splash) or callable(gui.splash) |
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
Test plan
pytest tests/ -vto verify all tests pass🤖 Generated with Claude Code