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

Run go vet as part of the Travis CI. #626

Merged
merged 4 commits into from
Jan 8, 2019
Merged
Show file tree
Hide file tree
Changes from 2 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
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,5 @@ script:
- cd $TRAVIS_BUILD_DIR/backend/src
- gimme -f 1.11.4
- source ~/.gimme/envs/go1.11.4.env
- go vet -shadow ./...
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this means only run the shadow checks?
You might need to vet shadows separately on a second invokation, since the flag appears to be still experimental.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, good catch! I verified that go vet -all -shadow runs all checks including shadow.

- go test ./...
8 changes: 4 additions & 4 deletions backend/src/agent/persistence/worker/metrics_reporter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,12 +118,12 @@ func TestReportMetrics_Succeed(t *testing.T) {
&api.RunMetric{
Name: "accuracy",
NodeId: "node-1",
Value: &api.RunMetric_NumberValue{0.77},
Value: &api.RunMetric_NumberValue{NumberValue: 0.77},
},
&api.RunMetric{
Name: "logloss",
NodeId: "node-1",
Value: &api.RunMetric_NumberValue{1.2},
Value: &api.RunMetric_NumberValue{NumberValue: 1.2},
},
},
}
Expand Down Expand Up @@ -301,12 +301,12 @@ func TestReportMetrics_InvalidMetricsJSON_PartialFail(t *testing.T) {
&api.RunMetric{
Name: "accuracy",
NodeId: "node-2",
Value: &api.RunMetric_NumberValue{0.77},
Value: &api.RunMetric_NumberValue{NumberValue: 0.77},
},
&api.RunMetric{
Name: "logloss",
NodeId: "node-2",
Value: &api.RunMetric_NumberValue{1.2},
Value: &api.RunMetric_NumberValue{NumberValue: 1.2},
},
},
}
Expand Down
4 changes: 2 additions & 2 deletions backend/src/apiserver/server/api_converter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,13 +115,13 @@ func TestToApiRuns(t *testing.T) {
apiMetric1 := &api.RunMetric{
Name: metric1.Name,
NodeId: metric1.NodeID,
Value: &api.RunMetric_NumberValue{metric1.NumberValue},
Value: &api.RunMetric_NumberValue{NumberValue: metric1.NumberValue},
Format: api.RunMetric_RAW,
}
apiMetric2 := &api.RunMetric{
Name: metric2.Name,
NodeId: metric2.NodeID,
Value: &api.RunMetric_NumberValue{metric2.NumberValue},
Value: &api.RunMetric_NumberValue{NumberValue: metric2.NumberValue},
Format: api.RunMetric_PERCENTAGE,
}
modelRun1 := model.Run{
Expand Down
8 changes: 4 additions & 4 deletions backend/src/cmd/ml/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,22 +41,22 @@ func NewRootCmd(factory ClientFactoryInterface) *RootCommand {

pipelineClient, err := factory.CreatePipelineClient(root.ClientConfig(), root.debug)
if err != nil {
fmt.Errorf("Could not create pipelineClient: %v", err)
return fmt.Errorf("Could not create pipelineClient: %v", err)
}

jobClient, err := factory.CreateJobClient(root.ClientConfig(), root.debug)
if err != nil {
fmt.Errorf("Could not create jobClient: %v", err)
return fmt.Errorf("Could not create jobClient: %v", err)
}

runClient, err := factory.CreateRunClient(root.ClientConfig(), root.debug)
if err != nil {
fmt.Errorf("Could not create runClient: %v", err)
return fmt.Errorf("Could not create runClient: %v", err)
}

experimentClient, err := factory.CreateExperimentClient(root.ClientConfig(), root.debug)
if err != nil {
fmt.Errorf("Could not create experimentClient: %v", err)
return fmt.Errorf("Could not create experimentClient: %v", err)
}
root.pipelineUploadClient = pipelineUploadClient
root.pipelineClient = pipelineClient
Expand Down
10 changes: 5 additions & 5 deletions backend/src/crd/pkg/apis/scheduledworkflow/v1alpha1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ type ScheduledWorkflowSpec struct {

// Specification of the workflow to schedule.
// +optional
Workflow *WorkflowResource `json:"workflow, omitempty"`
Workflow *WorkflowResource `json:"workflow,omitempty"`

// TODO: support additional resource types: K8 jobs, etc.

Expand Down Expand Up @@ -189,13 +189,13 @@ type ScheduledWorkflowCondition struct {

type TriggerStatus struct {
// Time of the last creation of a workflow.
LastTriggeredTime *metav1.Time `json:lastTriggeredTime,omitempty`
LastTriggeredTime *metav1.Time `json:"lastTriggeredTime,omitempty"`

// Time of the next creation of a workflow (assuming that the schedule is enabled).
NextTriggeredTime *metav1.Time `json:nextTriggeredTime,omitempty`
NextTriggeredTime *metav1.Time `json:"nextTriggeredTime,omitempty"`

// Index of the last workflow created.
LastIndex *int64 `json:lastWorkflowIndex,omitempty`
LastIndex *int64 `json:"lastWorkflowIndex,omitempty"`
}

type WorkflowHistory struct {
Expand All @@ -220,7 +220,7 @@ type WorkflowStatus struct {
UID types.UID `json:"uid,omitempty"`

// Phase is a high level summary of the status of the workflow.
Phase v1alpha1.NodePhase `json:phase,omitempty`
Phase v1alpha1.NodePhase `json:"phase,omitempty"`

// A human readable message indicating details about why the workflow is in
// this condition.
Expand Down