Skip to content

test(pgp): pin DOMAIN constant, file-write paths, and PgpSpec derives#736

Merged
EffortlessSteven merged 1 commit into
mainfrom
claude/coverage-pgp-extra-coverage-E47b2
May 16, 2026
Merged

test(pgp): pin DOMAIN constant, file-write paths, and PgpSpec derives#736
EffortlessSteven merged 1 commit into
mainfrom
claude/coverage-pgp-extra-coverage-E47b2

Conversation

@EffortlessSteven

Copy link
Copy Markdown
Member

Summary

uselesskey-pgp already has a tests/mutant_killers.rs pinning the kind-name and stable-byte tables, but:

  1. DOMAIN_PGP_KEYPAIR was not pinned anywhere in the workspace.
  2. write_private_key_armored / write_public_key_armored were only covered transitively through the facade crate's integration test — no in-crate test asserted the path/contents.
  3. PgpSpec Copy/Hash derive participation was only implied by call-site convenience, not asserted.

Adds tests/pgp_extra_coverage.rs matching the established <crate>_extra_coverage.rs pattern from uselesskey-hmac, uselesskey-ed25519, uselesskey-entropy, and uselesskey-jwk. Tests-only — no production code changes.

Pins

  • domain_constant_is_stableDOMAIN_PGP_KEYPAIR == "uselesskey:pgp:keypair".
  • pgp_spec_is_copy_and_usable_after_move / pgp_spec_participates_in_hash_collections — pin Copy/Hash via call-site behaviour.
  • write_private_key_armored_round_trips_to_file / write_public_key_armored_round_trips_to_file — read back the tempfile and assert byte-for-byte equivalence with the in-memory armored output plus expected BEGIN PGP … markers.
  • mismatched_public_key_armored_is_distinct_pgp_armor — pin the "valid armor / different fingerprint" contract for the negative fixture.
  • pgp_keypair_clone_preserves_label_spec_and_material — pin Clone across label, spec, fingerprint, and both armored representations.

Returns TestResult<()> and routes assertions through uselesskey-test-support's helpers, so this PR adds zero new panic-family debt.

Test plan

  • cargo test -p uselesskey-pgp --test pgp_extra_coverage --release — all 7 new tests pass
  • cargo clippy -p uselesskey-pgp --all-targets --all-features -- -D warnings clean
  • cargo fmt -p uselesskey-pgp clean
  • CI green on PR

Generated by Claude Code

`uselesskey-pgp` had a `tests/mutant_killers.rs` pinning the kind-name
and stable-byte tables, but `DOMAIN_PGP_KEYPAIR` was not pinned anywhere
in the workspace and the `write_private_key_armored` /
`write_public_key_armored` paths were only covered transitively through
the facade crate's integration test.

Adds `tests/pgp_extra_coverage.rs` (tests-only) matching the existing
pattern in `uselesskey-hmac`, `uselesskey-ed25519`, `uselesskey-entropy`,
and `uselesskey-jwk`:

- `domain_constant_is_stable` — pins `DOMAIN_PGP_KEYPAIR` value.
- `pgp_spec_is_copy_and_usable_after_move` /
  `pgp_spec_participates_in_hash_collections` — pin `Copy`/`Hash`
  derives via call-site behaviour so they can't silently disappear.
- `write_private_key_armored_round_trips_to_file` /
  `write_public_key_armored_round_trips_to_file` — read back the
  tempfile and assert byte-for-byte equivalence with the in-memory
  armored output plus expected `BEGIN PGP …` markers.
- `mismatched_public_key_armored_is_distinct_pgp_armor` — pin the
  "valid armor / different fingerprint" contract for the negative
  fixture.
- `pgp_keypair_clone_preserves_label_spec_and_material` — pins
  `Clone` semantics across the full public surface.

Adds `uselesskey-test-support` as a dev-dep so the file can use
`TestResult`/`ensure!`/`ensure_eq!`/`require_ok` and add zero new
panic-family debt.
@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@coderabbitai

coderabbitai Bot commented May 16, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@EffortlessSteven has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 25 minutes and 50 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: cf6b0fd7-5cd0-4e99-b77c-c63b7080bd6d

📥 Commits

Reviewing files that changed from the base of the PR and between ac9aba2 and c0307a5.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (2)
  • crates/uselesskey-pgp/Cargo.toml
  • crates/uselesskey-pgp/tests/pgp_extra_coverage.rs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/coverage-pgp-extra-coverage-E47b2

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

Comment @coderabbitai help to get the list of available commands and usage tips.

@EffortlessSteven EffortlessSteven marked this pull request as ready for review May 16, 2026 08:47
@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@EffortlessSteven EffortlessSteven merged commit d17b2d6 into main May 16, 2026
5 of 6 checks passed
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