Skip to content

test: add tests for strategy, validationReport, and envFingerprint#139

Closed
voidborne-d wants to merge 1 commit intoEvoMap:mainfrom
voidborne-d:add-tests-strategy-validation-fingerprint
Closed

test: add tests for strategy, validationReport, and envFingerprint#139
voidborne-d wants to merge 1 commit intoEvoMap:mainfrom
voidborne-d:add-tests-strategy-validation-fingerprint

Conversation

@voidborne-d
Copy link
Contributor

Summary

Adds 45 new tests covering three previously untested GEP modules. Test count goes from 113 to 158.

Modules Covered

strategy.js (15 tests)

  • All preset definitions and required fields
  • Ratio sum validation (repair + optimize + innovate = 1.0)
  • EVOLVE_STRATEGY env var handling + FORCE_INNOVATION backward compat
  • Auto-detection, signal-based strategy switching, unknown fallback

validationReport.js (20 tests)

  • buildValidationReport with minimal/full inputs
  • overall_ok logic (all pass, any fail, empty results)
  • Duration computation, output truncation at 4000 chars
  • Field name compat (out/stdout, err/stderr), command inference
  • isValidValidationReport validation for all edge cases

envFingerprint.js (10 tests)

  • Fingerprint structure and field types
  • Hostname/cwd hashing (12-char SHA256 prefix)
  • Consistency across calls
  • Key generation (16-char hex), null handling
  • isSameEnvClass comparison

Verification

$ node --test test/*.test.js
# tests 158
# pass 158
# fail 0

Follows existing test patterns (node:test, node:assert/strict). No new dependencies.

Add 45 new tests covering three previously untested modules:

strategy.js (15 tests):
- All preset definitions and required fields
- Ratio sum validation (repair + optimize + innovate = 1.0)
- EVOLVE_STRATEGY env var handling
- FORCE_INNOVATION backward compatibility
- Auto-detection and signal-based strategy switching
- Unknown strategy fallback

validationReport.js (20 tests):
- Report construction with minimal and full inputs
- overall_ok logic (all pass, any fail, empty results)
- Duration computation from timestamps
- Output truncation at 4000 chars
- Field name compatibility (out/stdout, err/stderr)
- Command inference from results
- Custom environment fingerprint injection
- isValidValidationReport validation

envFingerprint.js (10 tests):
- Fingerprint structure and field types
- Hostname and cwd hashing (12-char SHA256 prefix)
- Consistency across calls
- Key generation (16-char hex)
- Null/invalid input handling
- Same environment class comparison

All 158 tests pass (113 existing + 45 new).
@autogame-17
Copy link
Collaborator

Thank you for this contribution! 45 well-structured tests covering three previously untested modules is a significant improvement to the project's test coverage (113 -> 158 tests).

Your changes have been merged into the main codebase with full author credit preserved. They will appear in the public repo with the next release.

fmw666 pushed a commit that referenced this pull request Mar 11, 2026
…om PR #139)

- strategy.js: 15 tests covering presets, ratios, env var handling, signal routing
- validationReport.js: 20 tests covering report construction, overall_ok logic, truncation
- envFingerprint.js: 10 tests covering fingerprint structure, hashing, key generation

Co-authored-by: voidborne-d <d.oracle@agentmail.to>
fmw666 pushed a commit that referenced this pull request Mar 11, 2026
- Update README acknowledgments for blackdogcat (PR #144) and voidborne-d (PR #139)
- Modify publish_public.js to auto-collect contributors from private
  repo commit history and include Co-authored-by trailers in the
  publish commit, so contributors appear in GitHub's Contributors graph
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.

2 participants