-
Notifications
You must be signed in to change notification settings - Fork 117
Add automated test suite (unit + CLI integration) and CI for scanner, modes, and report outputs #131
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Co-authored-by: marcocesarato <[email protected]>
Co-authored-by: marcocesarato <[email protected]>
|
@copilot add github action pipeline for it |
|
@copilot Lock file errors
General warnings
on pipeline |
The GitHub Actions pipeline is already configured in commit 632349d. The workflow (
The pipeline executes automatically on this PR and will show test results for all 43 tests across 5 PHP versions. |
Co-authored-by: marcocesarato <[email protected]>
Fixed in commit that updates composer.lock file. The lock file now includes PHPUnit 9.6.29 and all dependencies. The pipeline composer validation error is resolved - only a minor warning about the version field remains (not critical for functionality). Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Test Suite Implementation - COMPLETE ✅
Successfully added comprehensive automated test suite with unit tests, CLI integration tests, CI/CD integration, and full documentation.
✅ All Acceptance Criteria Met
Repeatable Test Suite ✓
composer testDocumentation ✓
📊 Test Coverage Summary
Unit Tests (24 tests):
Integration Tests (19 tests):
🎯 Test Results
📦 Deliverables
Infrastructure:
phpunit.xml- PHPUnit configurationcomposer.json- PHPUnit dependency + test scripts (test, test:unit, test:integration, test:coverage)composer.lock- Updated with PHPUnit 9.6.29 and dependencies.gitignore- Test artifact exclusions.github/workflows/php.yml- Enhanced CI with matrix testingTests:
tests/Unit/PathTest.php- 8 teststests/Unit/CodeMatchTest.php- 9 teststests/Unit/DeobfuscatorTest.php- 7 teststests/Integration/CLITestCase.php- Base class with helperstests/Integration/DefaultScanTest.php- 5 teststests/Integration/ReportModeTest.php- 4 teststests/Integration/ScanModesTest.php- 7 teststests/Integration/PathControlsTest.php- 3 testsFixtures:
tests/Fixtures/clean/- 3 clean PHP filestests/Fixtures/malware/- 4 malware samplestests/Fixtures/obfuscated/- 2 obfuscated samplesDocumentation:
TESTING.md- Complete testing guide (6.5k chars)README.md- Testing section added🚀 CI/CD Integration
✨ Key Features
🔧 Recent Fix
Original prompt
This section details on the original issue you should resolve
<issue_title>Add automated test suite (unit + CLI integration) and CI for scanner, modes, and report outputs</issue_title>
<issue_description>## Summary
This proposal adds a comprehensive automated testing setup to validate core scanning logic, CLI behaviors, predefined modes, and report generation to improve reliability and reduce regressions across releases.[1]
The suite would include fast unit tests for internal helpers and broader CLI integration tests that execute the console scanner with various flags to assert outputs, exit codes, and artifacts like HTML/text reports.[1]
Motivation
The scanner supports interactive and non‑interactive report modes, multiple detection categories, and a wide set of flags, so changes can unintentionally alter behavior or increase false positives without quick feedback loops.[1]
Automated tests and CI will help validate common workflows such as scanning a directory, toggling aggression levels, ignoring paths, and producing stable reports, providing maintainers and contributors confidence when evolving signatures and features.[1]
Scope
Proposed approach
Test plan
Example commands
Acceptance criteria
Alternatives considered
Additional context
Relevant features covered by this proposal include interactive scanning, non‑interactive report mode, report format selection, predefined scan modes, and path filtering/ignoring helpers as described in the project documentation and README usage examples.[1]
Ensuring these capabilities are exercised by automated tests will help keep results stable, reduce false positives when modes are tuned, and support safe iteration on signatures and cleaning strategies over time.[1]
1
2
[3](https://[github](https://g...
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.