feat(tests): add comprehensive firewall integration tests and log parser#26
feat(tests): add comprehensive firewall integration tests and log parser#26
Conversation
Signed-off-by: Jiaxiao (mossaka) Zhou <duibao55328@gmail.com>
b99034d to
71b9465
Compare
…mproved Node.js setup Signed-off-by: Jiaxiao (mossaka) Zhou <duibao55328@gmail.com>
Signed-off-by: Jiaxiao (mossaka) Zhou <duibao55328@gmail.com>
Signed-off-by: Jiaxiao (mossaka) Zhou <duibao55328@gmail.com>
There was a problem hiding this comment.
Pull Request Overview
This PR migrates test infrastructure from bash scripts to TypeScript-based integration tests. The change replaces ~9 bash test scripts and 2 GitHub Actions workflows with 3 TypeScript test suites (48 tests total) covering basic firewall functionality, robustness testing, and Docker egress control.
Key changes:
- Adds TypeScript test framework with Jest configuration
- Creates reusable test fixtures (AwfRunner, DockerHelper, LogParser, cleanup utilities)
- Implements custom Jest matchers for firewall-specific assertions
- Updates documentation and package scripts
- Removes deprecated bash test scripts and old workflows
Reviewed Changes
Copilot reviewed 33 out of 35 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/integration/*.test.ts | New TypeScript integration test suites covering firewall functionality |
| tests/fixtures/*.ts | Reusable test utilities for running tests and parsing logs |
| tests/setup/* | Jest configuration for integration tests |
| tests/jest-custom-matchers.d.ts | TypeScript declarations for custom matchers |
| package.json | Added test scripts and glob dependency |
| .github/workflows/test-integration.yml | New workflow replacing old bash-based tests |
| scripts/ci/*.sh | Removed deprecated bash test scripts |
| docs/*, CLAUDE.md, AGENTS.md | Updated documentation references |
| src/cli.ts | Removed unused redactSecrets function |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| /** | ||
| * Custom Jest matchers for firewall tests | ||
| * Type declarations are in tests/types/jest-custom-matchers.d.ts |
There was a problem hiding this comment.
Comment incorrectly references 'tests/types/jest-custom-matchers.d.ts' but the actual file is at 'tests/jest-custom-matchers.d.ts' (no 'types' subdirectory).
| * Type declarations are in tests/types/jest-custom-matchers.d.ts | |
| * Type declarations are in tests/jest-custom-matchers.d.ts |
| "@types/jest": "^29.0.0", | ||
| "@typescript-eslint/eslint-plugin": "^6.0.0", | ||
| "@typescript-eslint/parser": "^6.0.0", | ||
| "eslint": "^8.0.0", | ||
| "glob": "^10.3.0", | ||
| "@types/glob": "^8.1.0", | ||
| "jest": "^29.0.0", | ||
| "@types/jest": "^29.0.0", | ||
| "ts-jest": "^29.0.0", |
There was a problem hiding this comment.
The @types/jest dependency is duplicated - it appears on both line 45 and was originally on line 51 (shown as removed in the diff). This creates a redundant entry in devDependencies.
There was a problem hiding this comment.
@copilot open a new pull request to apply changes based on this feedback
| ### Run Unit Tests Only | ||
|
|
||
| ```bash | ||
| npm test:unit |
There was a problem hiding this comment.
Missing 'run' in npm command. Should be 'npm run test:unit' to match other commands in the file.
| npm test:unit | |
| npm run test:unit |
|
@copilot open a new pull request to apply changes based on the comments in this thread |
Signed-off-by: Jiaxiao (mossaka) Zhou duibao55328@gmail.com