Skip to content

test(testcerts): cover NewKeyPair default SANs - Testing Hunter - #38

Open
github-actions[bot] wants to merge 1 commit into
mainfrom
code-hunters/testing-hunter/newkeypair-default-sans-untested-8251e92a1a85abba
Open

github-actions[bot] wants to merge 1 commit into
mainfrom
code-hunters/testing-hunter/newkeypair-default-sans-untested-8251e92a1a85abba

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

Adds TestNewKeyPairSANs, protecting the documented NewKeyPair contract (recently documented in #36): no domains yields localhost, 127.0.0.1, ::1; explicit domains yield no default IPs. Previously no test asserted the actual SANs.

Evidence: removing "::1" from the default config makes the new test fail; restored, it passes.

Validation: gofmt -l . (clean), go vet ./..., go test -race -run TestNewKeyPairSANs -count=3 ., go test ./... all pass.

Generated by Run Testing Hunter · auto · 20.2 AIC · ⊞ 11K · ◷

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@coderabbitai

coderabbitai Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: de34457a-3d25-46f9-b79a-f89101a08517

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@madflojo
madflojo marked this pull request as ready for review November 1, 2026 22:38
Copilot AI balanced review requested due to automatic review settings November 1, 2026 22:38

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues are blocking approval.

No open issues 🎉

What changed in this PR

Adds regression tests for the NewKeyPair subject alternative name (SAN) behavior documented in #36, without changing production code.

Changes:

  • Verifies that no domains produces localhost, 127.0.0.1, and ::1.
  • Verifies that explicit domains are preserved without adding default IP addresses.
File Description
testcerts_test.go Adds TestNewKeyPairSANs covering default and explicit-domain certificate SANs.

Review effort: Balanced

@codecov

codecov Bot commented Nov 1, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.11%. Comparing base (3969d36) to head (1b621d2).

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #38   +/-   ##
=======================================
  Coverage   82.11%   82.11%           
=======================================
  Files           3        3           
  Lines         218      218           
=======================================
  Hits          179      179           
  Misses         21       21           
  Partials       18       18           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants