Skip to content

Commit 42b30d2

Browse files
chore: fix gh test
1 parent 8929186 commit 42b30d2

File tree

1 file changed

+8
-16
lines changed

1 file changed

+8
-16
lines changed

apps/workspace-engine/pkg/workspace/jobdispatch/github_test.go

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,10 @@ func (m *mockGithubClient) DispatchWorkflow(ctx context.Context, owner, repo str
3838
func TestGithubDispatcher_DispatchJob_Success(t *testing.T) {
3939
// Setup mock repository with GitHub entity
4040
mockStore := store.New()
41-
if err := mockStore.GithubEntities.Upsert(context.Background(), &oapi.GithubEntity{
41+
mockStore.GithubEntities.Upsert(context.Background(), &oapi.GithubEntity{
4242
InstallationId: 12345,
4343
Slug: "test-owner",
44-
}); err != nil {
45-
t.Fatalf("Failed to upsert GitHub entity: %v", err)
46-
}
44+
})
4745

4846
// Setup mock client
4947
mockClient := &mockGithubClient{}
@@ -95,12 +93,10 @@ func TestGithubDispatcher_DispatchJob_Success(t *testing.T) {
9593

9694
func TestGithubDispatcher_DispatchJob_WithCustomRef(t *testing.T) {
9795
mockStore := store.New()
98-
if err := mockStore.GithubEntities.Upsert(context.Background(), &oapi.GithubEntity{
96+
mockStore.GithubEntities.Upsert(context.Background(), &oapi.GithubEntity{
9997
InstallationId: 12345,
10098
Slug: "test-owner",
101-
}); err != nil {
102-
t.Fatalf("Failed to upsert GitHub entity: %v", err)
103-
}
99+
})
104100

105101
mockClient := &mockGithubClient{}
106102

@@ -405,21 +401,17 @@ func TestGithubDispatcher_GetGithubEntity(t *testing.T) {
405401
for _, tt := range tests {
406402
t.Run(tt.name, func(t *testing.T) {
407403
mockStore := store.New()
408-
if err := mockStore.GithubEntities.Upsert(context.Background(), &oapi.GithubEntity{
404+
mockStore.GithubEntities.Upsert(context.Background(), &oapi.GithubEntity{
409405
InstallationId: tt.entities[0].installationID,
410406
Slug: tt.entities[0].slug,
411-
}); err != nil {
412-
t.Fatalf("Failed to upsert GitHub entity: %v", err)
413-
}
407+
})
414408

415409
// Add test entities
416410
for _, e := range tt.entities {
417-
if err := mockStore.GithubEntities.Upsert(context.Background(), &oapi.GithubEntity{
411+
mockStore.GithubEntities.Upsert(context.Background(), &oapi.GithubEntity{
418412
InstallationId: e.installationID,
419413
Slug: e.slug,
420-
}); err != nil {
421-
t.Fatalf("Failed to upsert GitHub entity: %v", err)
422-
}
414+
})
423415
}
424416

425417
dispatcher := NewGithubDispatcher(mockStore)

0 commit comments

Comments
 (0)