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

Job status api which return the job_execution_status for given job_name #11

Merged
merged 4 commits into from
Aug 16, 2018

Conversation

prashant3863
Copy link
Contributor

No description provided.

Copy link
Member

@olttwa olttwa left a comment

Choose a reason for hiding this comment

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

@prashant3863 everything looks good. We just need 3 more tests (1 in psql client, and 2 in store)

func (store *store) GetJobStatus(jobName string) (string, error) {
jobsExecutionAuditLogResult := []postgres.JobsExecutionAuditLog{}
err := store.postgresClient.Select(&jobsExecutionAuditLogResult, "SELECT job_execution_status from jobs_execution_audit_log where job_name = $1", jobName)
if err != nil {
Copy link
Member

Choose a reason for hiding this comment

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

@prashant3863 Please add test for this condition.

return "", nil
}

return jobsExecutionAuditLogResult[0].JobExecutionStatus, nil
Copy link
Member

Choose a reason for hiding this comment

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

@prashant3863 Please add test for this condition.

JobExecutionStatus: "test-job-execution-status",
}

err = postgresClient.NamedExec("INSERT INTO jobs_execution_audit_log (job_name, image_name, job_submitted_for_execution, job_args, job_submission_status, job_execution_status) VALUES (:job_name, :image_name, :job_submitted_for_execution, :job_args, :job_submission_status, :job_execution_status)", jobsExecutionAuditLog)
Copy link
Member

Choose a reason for hiding this comment

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

@prashant3863 Can we add a test for select when no rows exist in the db with given job name? That'll satisfy the job not found condition.

@olttwa olttwa merged commit a9d582c into gojek:master Aug 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants