-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow jobs to be manually unpaused in development mode (#885)
Partly mitigates #859. It's still not clear to me if there is an actual use case or if users are trying to use "development" mode jobs for production, but making this overridable is reasonable. Beyond this fix I think we could do something in the Jobs schedule UI, but it would help to better understand the use case (or actual reason of confusion). I expect we should hint customers to move away from dev mode rather than unpause.
- Loading branch information
1 parent
c3ced68
commit 0ab125c
Showing
2 changed files
with
31 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,7 +45,23 @@ func mockBundle(mode config.Mode) *bundle.Bundle { | |
}, | ||
Resources: config.Resources{ | ||
Jobs: map[string]*resources.Job{ | ||
"job1": {JobSettings: &jobs.JobSettings{Name: "job1"}}, | ||
"job1": { | ||
JobSettings: &jobs.JobSettings{ | ||
Name: "job1", | ||
Schedule: &jobs.CronSchedule{ | ||
QuartzCronExpression: "* * * * *", | ||
}, | ||
}, | ||
}, | ||
"job2": { | ||
JobSettings: &jobs.JobSettings{ | ||
Name: "job2", | ||
Schedule: &jobs.CronSchedule{ | ||
QuartzCronExpression: "* * * * *", | ||
PauseStatus: jobs.PauseStatusUnpaused, | ||
}, | ||
}, | ||
}, | ||
}, | ||
Pipelines: map[string]*resources.Pipeline{ | ||
"pipeline1": {PipelineSpec: &pipelines.PipelineSpec{Name: "pipeline1"}}, | ||
|
@@ -82,6 +98,12 @@ func TestProcessTargetModeDevelopment(t *testing.T) { | |
// Job 1 | ||
assert.Equal(t, "[dev lennart] job1", bundle.Config.Resources.Jobs["job1"].Name) | ||
assert.Equal(t, bundle.Config.Resources.Jobs["job1"].Tags["dev"], "lennart") | ||
assert.Equal(t, bundle.Config.Resources.Jobs["job1"].Schedule.PauseStatus, jobs.PauseStatusPaused) | ||
|
||
// Job 2 | ||
assert.Equal(t, "[dev lennart] job2", bundle.Config.Resources.Jobs["job2"].Name) | ||
assert.Equal(t, bundle.Config.Resources.Jobs["job2"].Tags["dev"], "lennart") | ||
assert.Equal(t, bundle.Config.Resources.Jobs["job2"].Schedule.PauseStatus, jobs.PauseStatusUnpaused) | ||
|
||
// Pipeline 1 | ||
assert.Equal(t, "[dev lennart] pipeline1", bundle.Config.Resources.Pipelines["pipeline1"].Name) | ||
|
@@ -182,6 +204,7 @@ func TestProcessTargetModeProduction(t *testing.T) { | |
} | ||
bundle.Config.Resources.Jobs["job1"].Permissions = permissions | ||
bundle.Config.Resources.Jobs["job1"].RunAs = &jobs.JobRunAs{UserName: "[email protected]"} | ||
bundle.Config.Resources.Jobs["job2"].RunAs = &jobs.JobRunAs{UserName: "[email protected]"} | ||
bundle.Config.Resources.Pipelines["pipeline1"].Permissions = permissions | ||
bundle.Config.Resources.Experiments["experiment1"].Permissions = permissions | ||
bundle.Config.Resources.Experiments["experiment2"].Permissions = permissions | ||
|