Skip to content

⚡ fixed test errors - #9

Merged
mandus merged 9 commits into
mainfrom
feat/test-fixtures
Jun 7, 2026
Merged

mandus merged 9 commits into
mainfrom
feat/test-fixtures

Conversation

@mandus

@mandus mandus commented Jun 7, 2026

Copy link
Copy Markdown
Owner

No description provided.

Åsmund Ødegård 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.

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.

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/testhelper package to create isolated temp environments and generate ephemeral GPG keys for tests.
  • Extended pass/pkg/gpg with 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.

Comment thread pass/pkg/gpg/gpg.go
Comment thread pass/internal/testhelper/testhelper.go Outdated
Comment thread pass/internal/testhelper/testhelper.go Outdated
Comment thread pass/internal/testhelper/testhelper.go Outdated
Comment thread pass/internal/testhelper/testhelper.go Outdated
Comment thread pass/internal/testhelper/testhelper.go Outdated
Comment thread pass/internal/testhelper/testhelper.go Outdated
Comment thread pass/internal/testhelper/testhelper.go Outdated
Comment thread specs/pass-test-fixtures-spec.md Outdated
Comment thread specs/pass-test-fixtures-spec.md
Åsmund Ødegård and others added 5 commits June 7, 2026 16:45
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
@mandus
mandus merged commit 32ac83f into main Jun 7, 2026
1 check passed
@mandus
mandus deleted the feat/test-fixtures branch June 25, 2026 15:48
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