Add log capture methods to TestHarness for integration tests #697
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.
Implementation Plan for Adapter Log Capture in Integration Tests
getLogs()to return array of log objectsassertLog()to check for specific log messages with regex and levelclearLogs()to clear captured logsAdapterLoginterface for external useSummary
This PR implements log capture functionality for integration tests, enabling developers to check for specific error/warning/info messages during adapter startup and execution.
Features Added
TestHarnessto capture stdout/stderr from the adapter processlevel,timestamp, andmessagepropertiesgetLogs(): Returns array of all captured logsassertLog(pattern, level?): Checks if a log matching criteria existsclearLogs(): Clears all captured logsImplementation Details
['inherit', 'inherit', 'inherit']to['inherit', 'pipe', 'pipe']to capture outputAdapterLoginterface for TypeScript usersUse Case Example
Testing & Validation
✅ All existing tests pass
✅ New unit tests added for log capture functionality
✅ Linting passes with no errors
✅ TypeScript compilation succeeds
✅ CodeQL security scan shows no vulnerabilities
✅ Exports verified to work correctly
✅ Comprehensive documentation added to README.md
✅ Changelog updated
Files Changed
src/tests/integration/lib/harness.ts: Core implementationsrc/tests/integration/lib/harness.test.ts: Unit tests (new)src/tests/index.ts: Export AdapterLog typeREADME.md: Documentation and examplesCHANGELOG.md: Added entry for new featurebuild/: Compiled outputOriginal prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.