-
Notifications
You must be signed in to change notification settings - Fork 42
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
Conversation
There was a problem hiding this 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 { |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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.
No description provided.