Skip to content

test: improve test parallelism, deterministic sync, and DI refactoring#234

Merged
indaco merged 9 commits intomainfrom
test/improve-test-quality
Mar 12, 2026
Merged

test: improve test parallelism, deterministic sync, and DI refactoring#234
indaco merged 9 commits intomainfrom
test/improve-test-quality

Conversation

@indaco
Copy link
Copy Markdown
Owner

@indaco indaco commented Mar 12, 2026

Description

Improve test suite quality

Related Issue

  • None

Notes for Reviewers

  • No production logic changes except in changelogparser and versionvalidator where var openFileFn/var getCurrentBranchFn globals were moved into struct fields - behavior is identical
  • Packages still using the function-variable pattern (e.g., commands/bump, config, core) had t.Parallel() intentionally removed until they get the same DI refactoring
  • Add ManifestLoader field to ExtensionHookRunner struct, replacing direct calls to the extensions.LoadExtensionManifestFn global. RunHooks() and LoadExtensionsForHook() now use the injected loader, enabling safe t.Parallel() under -race.

indaco added 9 commits March 12, 2026 10:07
SetTheme()/resetTheme() mutate package-level var currentTheme, causing race conditions when subtests run in parallel under -race.
Each parallel subtest now uses its own t.TempDir() instead of sharing a single script path that races between write and exec.
Add ManifestLoader field to ExtensionHookRunner struct, replacing direct calls to the extensions.LoadExtensionManifestFn global.
RunHooks() and LoadExtensionsForHook() now use the injected loader, enabling safe t.Parallel() under -race.
@indaco indaco merged commit 5f0a137 into main Mar 12, 2026
7 checks passed
@indaco indaco deleted the test/improve-test-quality branch March 12, 2026 10:41
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