Skip to content

test(mcp): isolate user.home in NostrMcpServerStdioIT - #570

Merged
tcheeric merged 1 commit into
developfrom
fix/mcp-identity-listing-it
Nov 25, 2026
Merged

tcheeric merged 1 commit into
developfrom
fix/mcp-identity-listing-it

Conversation

@tcheeric

Copy link
Copy Markdown
Owner

Summary

Fixes NostrMcpServerStdioIT.aHostCanSeeWhichIdentitiesTheServerHolds failing on developer machines.

Root cause

The test was environment-dependent. The server's code and the expected wording were both correct. The default keystore type is os-keychain, which discovers identities through the alias index at ${user.home}/.nostr-java/aliases. The IT launched the server subprocess with the real user.home, so any identity the developer had created (here personal) was reported: "1 identities, signing as 'personal' by default". The test expects "No identities are configured", which holds only on clean machines such as CI.

Fix

Every server the IT launches now gets -Duser.home=<fresh temp dir>, so the test no longer depends on the host's identities. No production code changes.

Testing

mvn -B -pl nostr-java-mcp -am verify: BUILD SUCCESS. Unit tests: 199 run, 0 failures. ITs: 78 run, 0 failures (NostrMcpServerStdioIT 12/12).

@tcheeric
tcheeric merged commit b238138 into develop Nov 25, 2026
5 checks passed
This was referenced Nov 25, 2026
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.

1 participant