Repository navigation
⚡ fixed test errors - #9
Merged
Merged
Conversation
added 4 commits
June 7, 2026 13:01
Implement isolated test environment for pass password manager: - Test GPG keys infrastructure - Batch mode GPG operations - Test helper utilities - Documentation and specifications
- Remove pre-generated key infrastructure - Update tests to use on-the-fly key generation - Update documentation for ephemeral approach - Clean up unnecessary files
- Add --pinentry-mode loopback to generateTestKey to prevent GPG prompts - Simplify passphrase handling in test key generation - Update TestEncryptDecryptRoundTrip to use batch mode options Fixes issue where tests hang waiting for user interaction during GPG encryption/decryption operations.
There was a problem hiding this comment.
Pull request overview
This PR introduces an ephemeral (on-the-fly) GPG key strategy for tests in the pass module, aiming to eliminate reliance on a developer’s local GPG setup and make GPG-related tests non-interactive and reproducible.
Changes:
- Added a new
pass/internal/testhelperpackage to create isolated temp environments and generate ephemeral GPG keys for tests. - Extended
pass/pkg/gpgwith option-driven encrypt/decrypt helpers (batch mode / pinentry loopback / passphrase) and added new fixture-based tests. - Added specifications and README documentation describing the ephemeral-fixture approach and how to use it.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| specs/pass-test-fixtures-spec.md | New spec documenting ephemeral GPG test fixtures and batch-mode usage. |
| pass/testdata/README.md | New documentation for testdata layout and ephemeral-key approach. |
| pass/testdata/gpg/README.md | New GPG test utilities README explaining how to use the testhelper. |
| pass/pkg/gpg/gpg.go | Adds GPGOptions, option-based encrypt/decrypt functions, and batch-mode checking. |
| pass/pkg/gpg/gpg_test.go | Updates existing tests to use ephemeral GPG keys instead of user keyring. |
| pass/pkg/gpg/gpg_fixture_test.go | Adds new integration-style tests for batch mode and passphrase flows. |
| pass/internal/testhelper/testhelper.go | New helper package implementing temp env setup + ephemeral GPG key generation and helpers. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Update NormalizePath and NormalizePathForDisplay to handle both slash types (/ and \) for cross-platform compatibility. This ensures tests work on both Linux and Windows regardless of which slash type is used in paths. - NormalizePath now replaces both / and \ with OS-specific separator - NormalizePathForDisplay now replaces both \ and OS separator with / - This makes all tests platform-independent
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.