Skip to content

fix(init): isolate integration-test XDG paths - #499

Merged
zzet merged 1 commit into
zzet:mainfrom
peterkc:fix/xdg-init-test-isolation
Aug 8, 2026
Merged

fix(init): isolate integration-test XDG paths#499
zzet merged 1 commit into
zzet:mainfrom
peterkc:fix/xdg-init-test-isolation

Conversation

@peterkc

@peterkc peterkc commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Summary

Init tests could inherit real config paths from the developer's machine. A test
could then write temporary repositories into the user's Gortex config.

This change sends all test config, state, runtime, and daemon files to temporary
directories. A regression test proves the inherited paths remain untouched.

Before: init test -> inherited user paths
After:  init test -> temporary test paths

Changes

  • Add one helper that isolates all init test paths.
  • Use it in every runInit integration test.
  • Verify repeated init stays isolated and does not modify inherited paths.

Testing

  • All tests pass (go test -race ./...) - the full race suite was not run.
  • go test -race ./cmd/gortex -run '^TestInit' -count=1 - 22 tests passed.
  • go test ./cmd/gortex -run '^TestInitCreatesProjectMarker$' -count=1 - passed.
  • go test ./... - 12,077 tests passed across 158 packages.
  • New tests added for new functionality.
  • Benchmarks not run because the change is test isolation only.
  • The production config SHA-256 was unchanged after the qualified full suite.

Checklist

  • Code follows existing patterns in the codebase.
  • No unnecessary abstractions added.
  • Language extractor metadata is not applicable.
  • Member-edge behavior is not applicable.

@zzet

zzet commented Aug 8, 2026

Copy link
Copy Markdown
Owner

@peterkc Is any other work is expected or it accedentally stays as draft?

@peterkc
peterkc marked this pull request as ready for review August 8, 2026 13:52
@zzet
zzet merged commit 7686d8a into zzet:main Aug 8, 2026
12 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