Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow creating runs with no experiments #572

Merged
merged 1 commit into from
Dec 20, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions backend/src/apiserver/server/run_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,6 @@ func (s *RunServer) validateCreateRunRequest(request *api.CreateRunRequest) erro
if run.Name == "" {
return util.NewInvalidInputError("The run name is empty. Please specify a valid name.")
}
// Run must be created under an experiment.
if err := ValidateExperimentResourceReference(s.resourceManager, run.ResourceReferences); err != nil {
return util.Wrap(err, "The run must have a valid experiment resource reference.")
}

if err := ValidatePipelineSpec(s.resourceManager, run.PipelineSpec); err != nil {
return util.Wrap(err, "The pipeline spec is invalid.")
Expand Down
16 changes: 16 additions & 0 deletions backend/src/apiserver/server/run_server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,22 @@ func TestValidateCreateRunRequest_EmptyName(t *testing.T) {
assert.Contains(t, err.Error(), "The run name is empty")
}

func TestValidateCreateRunRequest_NoExperiment(t *testing.T) {
clients, manager, _ := initWithExperiment(t)
defer clients.Close()
server := NewRunServer(manager)
run := &api.Run{
Name: "123",
ResourceReferences: nil,
PipelineSpec: &api.PipelineSpec{
WorkflowManifest: testWorkflow.ToStringForStore(),
Parameters: []*api.Parameter{{Name: "param1", Value: "world"}},
},
}
err := server.validateCreateRunRequest(&api.CreateRunRequest{Run: run})
assert.Nil(t, err)
}

func TestValidateCreateRunRequest_EmptyPipelineSpec(t *testing.T) {
clients, manager, _ := initWithExperiment(t)
defer clients.Close()
Expand Down