Skip to content

test(enrichment): unit coverage for the IaC-misconfig analyzer pure scanner #2096

Description

@JSONbored

review-enrichment/src/analyzers/iac-misconfig.ts (218 lines) has no test. isRelevantConfigPath and scanPatchForIacMisconfig are pure/path+patch-driven and easily unit-tested for full branch coverage. Part of the REES analyzer runtime.

Deliverables

  • Create review-enrichment/test/iac-misconfig.test.ts
  • isRelevantConfigPath: Terraform/YAML/Dockerfile/compose relevant paths vs unrelated source paths
  • scanPatchForIacMisconfig: each misconfig pattern the scanner recognizes (added lines only), and a clean patch → no findings
  • Finding shape (file/line/rule/severity) and stable ordering
  • Network/request wiring (scanIacMisconfig) can stay out of scope — cover the pure exports

References

  • review-enrichment/src/analyzers/iac-misconfig.ts:42
  • review-enrichment/src/analyzers/iac-misconfig.ts:61
  • review-enrichment/src/analyzers/iac-misconfig.ts:201

Part of #1499.


size: S · gittensor:bug

Metadata

Metadata

Assignees

No one assigned

    Labels

    gittensor:bugGittensor-scored bug fix — scores a 0.05x multiplier.help wantedExtra attention is needed

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions