Skip to content

test: add comprehensive unit tests for credential, hash, user, and trust extraction logic#223

Merged
l50 merged 3 commits into
mainfrom
test/extraction-dedup-trust-coverage
Apr 20, 2026
Merged

test: add comprehensive unit tests for credential, hash, user, and trust extraction logic#223
l50 merged 3 commits into
mainfrom
test/extraction-dedup-trust-coverage

Conversation

@l50
Copy link
Copy Markdown
Contributor

@l50 l50 commented Apr 20, 2026

Key Changes:

  • Added extensive unit tests for credential deduplication, hash extraction, user extraction, and trust parsing logic
  • Improved coverage reporting in CI workflow with cargo-llvm-cov and Codecov integration
  • Updated README to display Codecov coverage badge
  • Enhanced test coverage for utility functions, domain trust logic, and model cost estimation

Added:

  • Unit tests for deduplication and sanitization logic in credentials, including domain normalization, password checks, and ANSI stripping - ares-cli/src/dedup/tests.rs
  • Unit tests for hash and cracked password extraction, covering various hash formats and deduplication - ares-cli/src/orchestrator/output_extraction/hashes.rs
  • Unit tests for credential validation, ANSI stripping, and output extraction - ares-cli/src/orchestrator/output_extraction/mod.rs
  • Unit tests for user extraction and validation, including domain handling and machine account filtering - ares-cli/src/orchestrator/output_extraction/users.rs
  • Unit tests for utility functions such as number formatting, duration formatting, and string truncation - ares-cli/src/util.rs
  • Unit tests for domain controller detection and trust relationship categorization - ares-core/src/models/core.rs
  • Unit test for error display in delegation type parsing - ares-core/src/parsing/types.rs
  • Unit tests for token usage key formatting, model cost lookup, and usage estimation logic - ares-core/src/token_usage.rs
  • Unit tests for tool output parsing, deduplication in merged discoveries, and host service merging - ares-tools/src/parsers/mod.rs
  • Unit tests for domain trust parsing logic, including direction/type inference and normalization - ares-tools/src/parsers/trust.rs

Changed:

  • CI workflow updated to install llvm-tools-preview and cargo-llvm-cov, run tests with coverage, and upload lcov reports to Codecov - .github/workflows/rust.yaml
  • README updated to include a Codecov coverage badge for visibility of test coverage - README.md

l50 added 3 commits April 20, 2026 13:57
…ility functions

**Added:**

- Added tests for deduplication and sanitization logic, including ANSI stripping and domain normalization in `dedup/tests.rs`
- Added tests for hash extraction, deduplication, and cracked password parsing in `output_extraction/hashes.rs`
- Added unit tests for credential validation, ANSI stripping, extraction functions, and empty extraction handling in `output_extraction/mod.rs`
- Added tests for user extraction and validation, including machine account and format checks in `output_extraction/users.rs`
- Added tests for number formatting, duration formatting, and string truncation utilities in `util.rs`
- Added tests for domain controller detection and trust relationship logic in `models/core.rs`
- Added test for `ParseDelegationTypeError` display implementation in `parsing/types.rs`
**Added:**

- Integrate cargo-llvm-cov for Rust code coverage in CI workflow
- Upload coverage reports to Codecov using codecov-action in rust.yaml
- Add Codecov status badge to README.md

**Changed:**

- Replace cargo test step with cargo llvm-cov to generate coverage data in rust.yaml
**Added:**

- Added tests for blue token usage key format, model cost lookup, model field parsing, and usage cost estimation in `ares-core/src/token_usage.rs`
- Added tests for username-as-password credential filtering, adidnsdump parsing, trusted domain deduplication, and host service merging in `ares-tools/src/parsers/mod.rs`
- Added tests for outbound trust parsing, unknown direction handling, trust type inference based on domain length, and domain normalization in `ares-tools/src/parsers/trust.rs`
@dreadnode-renovate-bot dreadnode-renovate-bot Bot added area/docs Changes made to project documentation area/github Changes made to GitHub Actions workflows labels Apr 20, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 20, 2026

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

Thanks for integrating Codecov - We've got you covered ☂️

@l50 l50 merged commit f337b6a into main Apr 20, 2026
11 checks passed
@l50 l50 deleted the test/extraction-dedup-trust-coverage branch April 20, 2026 21:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/docs Changes made to project documentation area/github Changes made to GitHub Actions workflows

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant