Open
Conversation
Tests cover: ResponseService (response planning, fact filtering, PID tracking, operation lifecycle), ProcessNode/ProcessTree (tree operations, parent/child traversal, PID-to-GUID mapping, store dedup), all 8 parsers (basic_strip, childprocess, ecs_sysmon, key_value, ports, process, processguids, sysmon), all 4 requirements (base_requirement, basic, has_property, source_fact), and hook.py (metadata, enable, expansion). Includes pytest.ini, tox.ini, and a conftest.py with lightweight framework stubs enabling isolated testing without the full Caldera installation.
There was a problem hiding this comment.
Pull request overview
Adds a new pytest-based test suite intended to comprehensively cover the response plugin’s core services, process tree logic, parsers, requirements, and hook integration, along with local tooling to run tests via pytest/tox.
Changes:
- Introduces new pytest tests for
ResponseService,ProcessNode/ProcessTree, parsers, requirements, andhook.py - Adds a lightweight
conftest.pythat stubs Caldera/framework modules and loads plugin modules for isolated execution - Adds
pytest.iniandtox.inito standardize local test execution across multiple Python versions
Reviewed changes
Copilot reviewed 18 out of 21 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| tox.ini | Adds tox environments to run pytest across multiple Python versions |
| pytest.ini | Configures pytest discovery and asyncio handling |
| tests/conftest.py | Provides framework stubs + dynamic module loading to run plugin tests without Caldera |
| tests/test_response_svc.py | Unit tests for ResponseService helpers and key flows |
| tests/test_process_tree.py | Tests for ProcessNode and ProcessTree behavior |
| tests/test_hook.py | Tests plugin metadata and enable/expansion behavior |
| tests/test_parsers/test_basic_strip.py | Tests basic_strip parser |
| tests/test_parsers/test_childprocess.py | Tests childprocess parser |
| tests/test_parsers/test_ecs_sysmon.py | Tests ecs_sysmon parser |
| tests/test_parsers/test_key_value.py | Tests key_value parser |
| tests/test_parsers/test_ports.py | Tests ports parser |
| tests/test_parsers/test_process.py | Tests process parser |
| tests/test_parsers/test_processguids.py | Tests processguids parser |
| tests/test_parsers/test_sysmon.py | Tests sysmon parser |
| tests/test_requirements/test_base_requirement.py | Tests BaseRequirement helpers/validation |
| tests/test_requirements/test_basic.py | Tests basic requirement |
| tests/test_requirements/test_has_property.py | Tests has_property requirement |
| tests/test_requirements/test_source_fact.py | Tests source_fact requirement |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+8
to
+10
|
|
||
| # Root of the cloned repo | ||
| REPO_ROOT = '/tmp/response-pytest' |
Comment on lines
+2
to
+10
| import sys | ||
| import json | ||
| import asyncio | ||
| import pytest | ||
| from unittest.mock import AsyncMock, MagicMock, patch | ||
|
|
||
| sys.path.insert(0, '/tmp/response-pytest') | ||
|
|
||
| from tests.conftest import ( |
Comment on lines
+39
to
+42
| call_kwargs = BaseWorld.set_config.call_args | ||
| assert 'test-ability-id' in call_kwargs[1]['value'] or 'test-ability-id' in call_kwargs[0][0] if call_kwargs[0] else True | ||
|
|
||
|
|
Comment on lines
+3
to
+6
| import json | ||
| import asyncio | ||
| import pytest | ||
| from unittest.mock import AsyncMock, MagicMock, patch |
| return mod | ||
|
|
||
|
|
||
| def _install_stubs(): |
Comment on lines
+293
to
+294
| _install_stubs() | ||
|
|
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
ResponseService(response planning, fact filtering, PID tracking, operation lifecycle),ProcessNode/ProcessTree(tree operations, parent/child traversal, PID-to-GUID mapping, store dedup), all 8 parsers (basic_strip,childprocess,ecs_sysmon,key_value,ports,process,processguids,sysmon), all 4 requirements (base_requirement,basic,has_property,source_fact), andhook.py(metadata, enable, expansion)pytest.ini,tox.ini, and aconftest.pywith lightweight framework stubs enabling isolated testing without the full Caldera installationTest plan
pytest -vGenerated with Claude Code