Skip to content

Commit 059d690

Browse files
authored
Merge pull request #71 from codeGROOVE-dev/reliable
Add more integration testing coverage
2 parents 0513ae1 + fb18ea1 commit 059d690

File tree

87 files changed

+2076
-1934
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

87 files changed

+2076
-1934
lines changed

.golangci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ linters:
7070
- testableexamples # checks if examples are testable (have an expected output)
7171
- testpackage # makes you use a separate _test package
7272
- paralleltest # not every test should be in parallel
73+
- tparallel # table-driven tests share mock servers for performance
7374
- wrapcheck # not required
7475
- wsl # [too strict and mostly code is not more readable] whitespace linter forces you to use empty lines
7576
- wsl_v5 # [too strict and mostly code is not more readable] add or remove empty lines

cmd/server/main.go

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -249,8 +249,8 @@ func run(ctx context.Context, cancel context.CancelFunc, cfg *config.ServerConfi
249249
// Get GitHub token from one of the installations
250250
var githubToken string
251251
for _, org := range githubManager.AllOrgs() {
252-
if client, ok := githubManager.ClientForOrg(org); ok {
253-
githubToken = client.InstallationToken(ctx)
252+
if ghClient, ok := githubManager.ClientForOrg(org); ok {
253+
githubToken = ghClient.InstallationToken(ctx)
254254
break
255255
}
256256
}
@@ -671,8 +671,6 @@ func (cm *coordinatorManager) handleRefreshInstallations(ctx context.Context) {
671671
// runBotCoordinators manages bot coordinators for all GitHub installations.
672672
// It spawns one coordinator per org and refreshes the list every 5 minutes.
673673
// Failed coordinators are automatically restarted every minute.
674-
//
675-
//nolint:interfacebloat // Interface mirrors state.Store for local type safety
676674
func runBotCoordinators(
677675
ctx context.Context,
678676
slackManager *slack.Manager,
@@ -733,7 +731,7 @@ func runBotCoordinators(
733731

734732
// Run cleanup once on startup
735733
go func() {
736-
if err := stateStore.Cleanup(); err != nil {
734+
if err := stateStore.Cleanup(context.Background()); err != nil {
737735
slog.Warn("initial state cleanup failed", "error", err)
738736
}
739737
}()
@@ -767,7 +765,7 @@ func runBotCoordinators(
767765
case <-cleanupTicker.C:
768766
// Periodic cleanup of old state data
769767
go func() {
770-
if err := stateStore.Cleanup(); err != nil {
768+
if err := stateStore.Cleanup(context.Background()); err != nil {
771769
slog.Warn("state cleanup failed", "error", err)
772770
} else {
773771
slog.Debug("state cleanup completed successfully")

0 commit comments

Comments
 (0)