Skip to content

Added unit test for credstore and fixed ressource typo - #99

Merged
MiaKoring merged 5 commits into
amethystsoft:mainfrom
MiaKoring:test-wincredstore
Jul 23, 2026
Merged

Added unit test for credstore and fixed ressource typo#99
MiaKoring merged 5 commits into
amethystsoft:mainfrom
MiaKoring:test-wincredstore

Conversation

@MiaKoring

@MiaKoring MiaKoring commented Jul 23, 2026

Copy link
Copy Markdown
Member

Resolves #98

Summary

  • Added a Windows-only unit test covering credential storage and retrieval.
  • Fixed the Windows credential resource parameter typo consistently across the credential store and managed object context.
  • The test validates that retrieved secrets match stored values, providing strong coverage for the credential-store flow.

@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@MiaKoring, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 46 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 7bd8319a-05f5-4866-b343-58f05fb69311

📥 Commits

Reviewing files that changed from the base of the PR and between a7ca6d0 and cdba76d.

📒 Files selected for processing (2)
  • Sources/Vein/ModelContext/WindowsCredential.swift
  • Tests/VeinTests/Windows/CredStoreTests.swift
📝 Walkthrough

Walkthrough

The Windows credential helper and its database key callers now use the ressource argument label. A Windows-only async test stores and retrieves a credential, asserting that the returned secret matches the stored value.

Changes

Windows credential alignment

Layer / File(s) Summary
Credential API alignment and round-trip validation
Sources/Vein/ModelContext/WindowsCredential.swift, Sources/Vein/ModelContext/ManagedObjectContext/ManagedObjectContext.swift, Tests/VeinTests/Windows/CredStoreTests.swift
WinCredential.store and retrieve use the ressource parameter label, database key generation updates both calls, and a Windows-only test verifies credential storage and retrieval.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Possibly related PRs

  • amethystsoft/vein#88: Introduced the Windows Credential Manager helper used by the updated database key flow.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the Windows credstore test addition and the typo fix.
Linked Issues check ✅ Passed The PR adds a Windows-only credential store encode/decode test and fixes the resource label typo, matching issue #98.
Out of Scope Changes check ✅ Passed The changes stay focused on the linked issue with no clear unrelated additions.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@Tests/VeinTests/Windows/CredStoreTests.swift`:
- Around line 1-24: Run the repository’s SwiftFormat configuration against the
WinCredentialTest test file, ensuring it adds the required source header,
corrects indentation, removes trailing whitespace, and ends the file with a
final newline while preserving the test behavior.
- Around line 9-19: Update the test around WinCredential.store and
WinCredential.retrieve to use a unique per-run ressource instead of the fixed
target, and add teardown cleanup via defer or the test’s teardown mechanism to
remove the stored credential after execution. Ensure cleanup runs even when
assertions or retrieval fail.
- Around line 13-17: Update the test around WinCredential.store to assert that
the returned Bool indicates success before attempting retrieval, ensuring the
test validates the credential write rather than relying on potentially stale
data.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 1a13c2eb-d0c8-40ff-a407-af457ba34859

📥 Commits

Reviewing files that changed from the base of the PR and between 611f18d and a7ca6d0.

📒 Files selected for processing (3)
  • Sources/Vein/ModelContext/ManagedObjectContext/ManagedObjectContext.swift
  • Sources/Vein/ModelContext/WindowsCredential.swift
  • Tests/VeinTests/Windows/CredStoreTests.swift

Comment thread Tests/VeinTests/Windows/CredStoreTests.swift Outdated
Comment thread Tests/VeinTests/Windows/CredStoreTests.swift Outdated
Comment thread Tests/VeinTests/Windows/CredStoreTests.swift Outdated
@MiaKoring
MiaKoring merged commit 4202a8e into amethystsoft:main Jul 23, 2026
11 of 12 checks passed
@MiaKoring
MiaKoring deleted the test-wincredstore branch July 23, 2026 14:19
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.

unit test Windows key store encoding/decoding

1 participant