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
|
var err error
|
||||||
|
|
||||||
searchField := "workflow_job_id = ?"
|
searchField := "workflow_job_id = ?"
|
||||||
var searchVal any = job.ID
|
var searchVal any = job.WorkflowJobID
|
||||||
if job.ScaleSetJobID != "" {
|
if job.ScaleSetJobID != "" {
|
||||||
searchField = "scale_set_job_id = ?"
|
searchField = "scale_set_job_id = ?"
|
||||||
searchVal = job.ScaleSetJobID
|
searchVal = job.ScaleSetJobID
|
||||||
|
|
|
||||||
|
|
@ -50,12 +50,12 @@ func (s *WatcherStoreTestSuite) TestJobWatcher() {
|
||||||
consumeEvents(consumer)
|
consumeEvents(consumer)
|
||||||
|
|
||||||
jobParams := params.Job{
|
jobParams := params.Job{
|
||||||
ID: 1,
|
WorkflowJobID: 2,
|
||||||
RunID: 2,
|
RunID: 2,
|
||||||
Action: "test-action",
|
Action: "test-action",
|
||||||
Conclusion: "started",
|
Conclusion: "started",
|
||||||
Status: "in_progress",
|
Status: "in_progress",
|
||||||
Name: "test-job",
|
Name: "test-job",
|
||||||
}
|
}
|
||||||
|
|
||||||
job, err := s.store.CreateOrUpdateJob(s.ctx, jobParams)
|
job, err := s.store.CreateOrUpdateJob(s.ctx, jobParams)
|
||||||
|
|
@ -76,8 +76,8 @@ func (s *WatcherStoreTestSuite) TestJobWatcher() {
|
||||||
s.T().Fatal("expected payload not received")
|
s.T().Fatal("expected payload not received")
|
||||||
}
|
}
|
||||||
|
|
||||||
jobParams.Conclusion = "success"
|
job.Conclusion = "success"
|
||||||
updatedJob, err := s.store.CreateOrUpdateJob(s.ctx, jobParams)
|
updatedJob, err := s.store.CreateOrUpdateJob(s.ctx, job)
|
||||||
s.Require().NoError(err)
|
s.Require().NoError(err)
|
||||||
|
|
||||||
select {
|
select {
|
||||||
|
|
@ -94,7 +94,7 @@ func (s *WatcherStoreTestSuite) TestJobWatcher() {
|
||||||
entityID, err := uuid.NewUUID()
|
entityID, err := uuid.NewUUID()
|
||||||
s.Require().NoError(err)
|
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)
|
s.Require().NoError(err)
|
||||||
|
|
||||||
select {
|
select {
|
||||||
|
|
@ -110,7 +110,7 @@ func (s *WatcherStoreTestSuite) TestJobWatcher() {
|
||||||
s.T().Fatal("expected payload not received")
|
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)
|
s.Require().NoError(err)
|
||||||
|
|
||||||
select {
|
select {
|
||||||
|
|
@ -134,7 +134,7 @@ func (s *WatcherStoreTestSuite) TestJobWatcher() {
|
||||||
// We don't care about the update event here.
|
// We don't care about the update event here.
|
||||||
consumeEvents(consumer)
|
consumeEvents(consumer)
|
||||||
|
|
||||||
err = s.store.BreakLockJobIsQueued(s.ctx, updatedJob.ID)
|
err = s.store.BreakLockJobIsQueued(s.ctx, updatedJob.WorkflowJobID)
|
||||||
s.Require().NoError(err)
|
s.Require().NoError(err)
|
||||||
|
|
||||||
select {
|
select {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue