Skip to content

Commit

Permalink
run schedule jobs in parallel
Browse files Browse the repository at this point in the history
  • Loading branch information
creativeprojects committed Jun 28, 2024
1 parent 25e3d84 commit f4b298c
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
24 changes: 24 additions & 0 deletions schedule_jobs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ func configForJob(command string, at ...string) *config.Schedule {
}

func TestScheduleNilJobs(t *testing.T) {
t.Parallel()

handler := mocks.NewHandler(t)
handler.EXPECT().Init().Return(nil)
handler.EXPECT().Close()
Expand All @@ -27,6 +29,8 @@ func TestScheduleNilJobs(t *testing.T) {
}

func TestSimpleScheduleJob(t *testing.T) {
t.Parallel()

handler := mocks.NewHandler(t)
handler.EXPECT().Init().Return(nil)
handler.EXPECT().Close()
Expand All @@ -47,6 +51,8 @@ func TestSimpleScheduleJob(t *testing.T) {
}

func TestFailScheduleJob(t *testing.T) {
t.Parallel()

handler := mocks.NewHandler(t)
handler.EXPECT().Init().Return(nil)
handler.EXPECT().Close()
Expand All @@ -64,6 +70,8 @@ func TestFailScheduleJob(t *testing.T) {
}

func TestRemoveNilJobs(t *testing.T) {
t.Parallel()

handler := mocks.NewHandler(t)
handler.EXPECT().Init().Return(nil)
handler.EXPECT().Close()
Expand All @@ -73,6 +81,8 @@ func TestRemoveNilJobs(t *testing.T) {
}

func TestRemoveJob(t *testing.T) {
t.Parallel()

handler := mocks.NewHandler(t)
handler.EXPECT().Init().Return(nil)
handler.EXPECT().Close()
Expand All @@ -89,6 +99,8 @@ func TestRemoveJob(t *testing.T) {
}

func TestRemoveJobNoConfig(t *testing.T) {
t.Parallel()

handler := mocks.NewHandler(t)
handler.EXPECT().Init().Return(nil)
handler.EXPECT().Close()
Expand All @@ -105,6 +117,8 @@ func TestRemoveJobNoConfig(t *testing.T) {
}

func TestFailRemoveJob(t *testing.T) {
t.Parallel()

handler := mocks.NewHandler(t)
handler.EXPECT().Init().Return(nil)
handler.EXPECT().Close()
Expand All @@ -117,6 +131,8 @@ func TestFailRemoveJob(t *testing.T) {
}

func TestNoFailRemoveUnknownJob(t *testing.T) {
t.Parallel()

handler := mocks.NewHandler(t)
handler.EXPECT().Init().Return(nil)
handler.EXPECT().Close()
Expand All @@ -129,6 +145,8 @@ func TestNoFailRemoveUnknownJob(t *testing.T) {
}

func TestNoFailRemoveUnknownRemoveOnlyJob(t *testing.T) {
t.Parallel()

handler := mocks.NewHandler(t)
handler.EXPECT().Init().Return(nil)
handler.EXPECT().Close()
Expand All @@ -141,6 +159,8 @@ func TestNoFailRemoveUnknownRemoveOnlyJob(t *testing.T) {
}

func TestStatusNilJobs(t *testing.T) {
t.Parallel()

handler := mocks.NewHandler(t)
handler.EXPECT().Init().Return(nil)
handler.EXPECT().Close()
Expand All @@ -151,6 +171,8 @@ func TestStatusNilJobs(t *testing.T) {
}

func TestStatusJob(t *testing.T) {
t.Parallel()

handler := mocks.NewHandler(t)
handler.EXPECT().Init().Return(nil)
handler.EXPECT().Close()
Expand All @@ -165,6 +187,8 @@ func TestStatusJob(t *testing.T) {
}

func TestStatusRemoveOnlyJob(t *testing.T) {
t.Parallel()

handler := mocks.NewHandler(t)
handler.EXPECT().Init().Return(nil)
handler.EXPECT().Close()
Expand Down
1 change: 1 addition & 0 deletions update_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ func TestUpdate(t *testing.T) {
if testing.Short() {
t.SkipNow()
}
// can't run in Parallel because it changes the default logger
clog.SetTestLog(t)
defer clog.CloseTestLog()

Expand Down

0 comments on commit f4b298c

Please sign in to comment.