Fix erroneous calls to Job related functions
Some functions were left behind when we added WorkflowJobID. Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
This commit is contained in:
parent
8bda81d6cc
commit
4341b4869c
2 changed files with 12 additions and 12 deletions
|
|
@ -248,7 +248,7 @@ func (s *sqlDatabase) CreateOrUpdateJob(ctx context.Context, job params.Job) (pa
|
|||
var err error
|
||||
|
||||
searchField := "workflow_job_id = ?"
|
||||
var searchVal any = job.ID
|
||||
var searchVal any = job.WorkflowJobID
|
||||
if job.ScaleSetJobID != "" {
|
||||
searchField = "scale_set_job_id = ?"
|
||||
searchVal = job.ScaleSetJobID
|
||||
|
|
|
|||
|
|
@ -50,12 +50,12 @@ func (s *WatcherStoreTestSuite) TestJobWatcher() {
|
|||
consumeEvents(consumer)
|
||||
|
||||
jobParams := params.Job{
|
||||
ID: 1,
|
||||
RunID: 2,
|
||||
Action: "test-action",
|
||||
Conclusion: "started",
|
||||
Status: "in_progress",
|
||||
Name: "test-job",
|
||||
WorkflowJobID: 2,
|
||||
RunID: 2,
|
||||
Action: "test-action",
|
||||
Conclusion: "started",
|
||||
Status: "in_progress",
|
||||
Name: "test-job",
|
||||
}
|
||||
|
||||
job, err := s.store.CreateOrUpdateJob(s.ctx, jobParams)
|
||||
|
|
@ -76,8 +76,8 @@ func (s *WatcherStoreTestSuite) TestJobWatcher() {
|
|||
s.T().Fatal("expected payload not received")
|
||||
}
|
||||
|
||||
jobParams.Conclusion = "success"
|
||||
updatedJob, err := s.store.CreateOrUpdateJob(s.ctx, jobParams)
|
||||
job.Conclusion = "success"
|
||||
updatedJob, err := s.store.CreateOrUpdateJob(s.ctx, job)
|
||||
s.Require().NoError(err)
|
||||
|
||||
select {
|
||||
|
|
@ -94,7 +94,7 @@ func (s *WatcherStoreTestSuite) TestJobWatcher() {
|
|||
entityID, err := uuid.NewUUID()
|
||||
s.Require().NoError(err)
|
||||
|
||||
err = s.store.LockJob(s.ctx, updatedJob.ID, entityID.String())
|
||||
err = s.store.LockJob(s.ctx, updatedJob.WorkflowJobID, entityID.String())
|
||||
s.Require().NoError(err)
|
||||
|
||||
select {
|
||||
|
|
@ -110,7 +110,7 @@ func (s *WatcherStoreTestSuite) TestJobWatcher() {
|
|||
s.T().Fatal("expected payload not received")
|
||||
}
|
||||
|
||||
err = s.store.UnlockJob(s.ctx, updatedJob.ID, entityID.String())
|
||||
err = s.store.UnlockJob(s.ctx, updatedJob.WorkflowJobID, entityID.String())
|
||||
s.Require().NoError(err)
|
||||
|
||||
select {
|
||||
|
|
@ -134,7 +134,7 @@ func (s *WatcherStoreTestSuite) TestJobWatcher() {
|
|||
// We don't care about the update event here.
|
||||
consumeEvents(consumer)
|
||||
|
||||
err = s.store.BreakLockJobIsQueued(s.ctx, updatedJob.ID)
|
||||
err = s.store.BreakLockJobIsQueued(s.ctx, updatedJob.WorkflowJobID)
|
||||
s.Require().NoError(err)
|
||||
|
||||
select {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue