Skip to content

feat(tests): add comprehensive firewall integration tests and log parser#26

Merged
Mossaka merged 4 commits intomainfrom
integration-test-ts
Oct 30, 2025
Merged

feat(tests): add comprehensive firewall integration tests and log parser#26
Mossaka merged 4 commits intomainfrom
integration-test-ts

Conversation

@Mossaka
Copy link
Copy Markdown
Collaborator

@Mossaka Mossaka commented Oct 30, 2025

Signed-off-by: Jiaxiao (mossaka) Zhou duibao55328@gmail.com

Signed-off-by: Jiaxiao (mossaka) Zhou <duibao55328@gmail.com>
@Mossaka Mossaka force-pushed the integration-test-ts branch from b99034d to 71b9465 Compare October 30, 2025 18:38
Comment thread .github/workflows/test-integration.yml Fixed
…mproved Node.js setup

Signed-off-by: Jiaxiao (mossaka) Zhou <duibao55328@gmail.com>
Comment thread .github/workflows/test-integration.yml Fixed
Comment thread .github/workflows/test-integration.yml Fixed
Comment thread .github/workflows/test-integration.yml Fixed
Comment thread .github/workflows/test-integration.yml Fixed
Signed-off-by: Jiaxiao (mossaka) Zhou <duibao55328@gmail.com>
Signed-off-by: Jiaxiao (mossaka) Zhou <duibao55328@gmail.com>
@Mossaka Mossaka requested a review from Copilot October 30, 2025 18:46
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link

Copilot AI Oct 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Suggested change
* Type declarations are in tests/types/jest-custom-matchers.d.ts
* Type declarations are in tests/jest-custom-matchers.d.ts

Copilot uses AI. Check for mistakes.
Comment thread package.json
Comment on lines +45 to 52
"@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",
Copy link

Copilot AI Oct 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot open a new pull request to apply changes based on this feedback

Comment thread tests/README.md
### Run Unit Tests Only

```bash
npm test:unit
Copy link

Copilot AI Oct 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing 'run' in npm command. Should be 'npm run test:unit' to match other commands in the file.

Suggested change
npm test:unit
npm run test:unit

Copilot uses AI. Check for mistakes.
@Mossaka Mossaka merged commit 377cb97 into main Oct 30, 2025
13 checks passed
@Mossaka Mossaka deleted the integration-test-ts branch October 30, 2025 18:52
@Mossaka
Copy link
Copy Markdown
Collaborator Author

Mossaka commented Oct 30, 2025

@copilot open a new pull request to apply changes based on the comments in this thread

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants