Skip to content

Commit e7be29c

Browse files
authored
fix(config): remove t.Parallel from tests sharing global singletons (#53)
* chore: add CODEOWNERS and dependabot.yml Add CODEOWNERS for PR review routing and dependabot.yml for automated dependency updates (gomod + github-actions, weekly, grouped). * test: add t.Parallel() to unit tests for concurrent execution * chore: remove dependabot.yml * fix(config): remove t.Parallel from tests that share global singletons Tests mutating credentials.SetDefaultStore and ResetCategoryRegistry raced when run in parallel — remove t.Parallel only from those tests.
1 parent dbf63b7 commit e7be29c

3 files changed

Lines changed: 0 additions & 12 deletions

File tree

config/category_test.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ func TestDefaultCategories_AllPresent(t *testing.T) {
1818
}
1919

2020
func TestCategoryRegistry_Resolve(t *testing.T) {
21-
t.Parallel()
2221
ResetCategoryRegistry()
2322
defer ResetCategoryRegistry()
2423

@@ -34,7 +33,6 @@ func TestCategoryRegistry_Resolve(t *testing.T) {
3433
}
3534

3635
func TestCategoryRegistry_ResolveFallback(t *testing.T) {
37-
t.Parallel()
3836
ResetCategoryRegistry()
3937
defer ResetCategoryRegistry()
4038

@@ -49,7 +47,6 @@ func TestCategoryRegistry_ResolveFallback(t *testing.T) {
4947
}
5048

5149
func TestCategoryRegistry_Override(t *testing.T) {
52-
t.Parallel()
5350
ResetCategoryRegistry()
5451
defer ResetCategoryRegistry()
5552

@@ -66,7 +63,6 @@ func TestCategoryRegistry_Override(t *testing.T) {
6663
}
6764

6865
func TestCategoryRegistry_ResolveWithDefaults(t *testing.T) {
69-
t.Parallel()
7066
ResetCategoryRegistry()
7167
defer ResetCategoryRegistry()
7268

@@ -89,7 +85,6 @@ func TestCategoryRegistry_ResolveWithDefaults(t *testing.T) {
8985
}
9086

9187
func TestCategoryRegistry_AllCategories(t *testing.T) {
92-
t.Parallel()
9388
ResetCategoryRegistry()
9489
defer ResetCategoryRegistry()
9590

@@ -101,7 +96,6 @@ func TestCategoryRegistry_AllCategories(t *testing.T) {
10196
}
10297

10398
func TestResolveCategory_Convenience(t *testing.T) {
104-
t.Parallel()
10599
ResetCategoryRegistry()
106100
defer ResetCategoryRegistry()
107101

config/config_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import (
1010
)
1111

1212
func TestResolveProviderRequest(t *testing.T) {
13-
t.Parallel()
1413
// Clear provider env vars to test default resolution
1514
os.Unsetenv("OPENAI_BASE_URL")
1615
os.Unsetenv("OPENAI_API_BASE")
@@ -56,7 +55,6 @@ func TestIsLocalProviderURL(t *testing.T) {
5655
}
5756

5857
func TestIsOpenAICompatibleRuntimeEnabled(t *testing.T) {
59-
t.Parallel()
6058
store := &credentials.MapStore{}
6159
credentials.SetDefaultStore(store)
6260
t.Cleanup(func() { credentials.SetDefaultStore(nil) })

config/runtime_test.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,6 @@ func TestProviderModelEnvKeys_AllProvidersPresent(t *testing.T) {
119119
}
120120

121121
func TestResolveOpenAICompatibleRuntime_WithEnv(t *testing.T) {
122-
t.Parallel()
123122
store := &credentials.MapStore{}
124123
credentials.SetDefaultStore(store)
125124
t.Cleanup(func() { credentials.SetDefaultStore(nil) })
@@ -141,7 +140,6 @@ func TestResolveOpenAICompatibleRuntime_WithEnv(t *testing.T) {
141140
}
142141

143142
func TestResolveOpenAICompatibleRuntime_GrokProvider(t *testing.T) {
144-
t.Parallel()
145143
store := &credentials.MapStore{}
146144
credentials.SetDefaultStore(store)
147145
t.Cleanup(func() { credentials.SetDefaultStore(nil) })
@@ -160,7 +158,6 @@ func TestResolveOpenAICompatibleRuntime_GrokProvider(t *testing.T) {
160158
}
161159

162160
func TestResolveOpenAICompatibleRuntime_FallbackModel(t *testing.T) {
163-
t.Parallel()
164161
clearKeys := []string{
165162
"OPENROUTER_API_KEY", "XAI_API_KEY", "GEMINI_API_KEY",
166163
"ANTHROPIC_API_KEY", "CANOPYWAVE_API_KEY", "DEEPSEEK_API_KEY", "ZAI_API_KEY", "OPENAI_API_KEY",
@@ -180,7 +177,6 @@ func TestResolveOpenAICompatibleRuntime_FallbackModel(t *testing.T) {
180177
}
181178

182179
func TestResolveOpenAICompatibleRuntime_NoKeys(t *testing.T) {
183-
t.Parallel()
184180
store := &credentials.MapStore{}
185181
credentials.SetDefaultStore(store)
186182
t.Cleanup(func() { credentials.SetDefaultStore(nil) })

0 commit comments

Comments
 (0)