Skip to content

Commit

Permalink
removed unnecessary job generator for stream specs
Browse files Browse the repository at this point in the history
  • Loading branch information
msuchacz-cll committed Dec 16, 2024
1 parent 3db9372 commit 9c3f022
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
3 changes: 2 additions & 1 deletion core/services/job/job_orm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ import (
"github.com/smartcontractkit/chainlink/v2/core/services/ocrbootstrap"
"github.com/smartcontractkit/chainlink/v2/core/services/pipeline"
"github.com/smartcontractkit/chainlink/v2/core/services/relay"
"github.com/smartcontractkit/chainlink/v2/core/services/streams"
"github.com/smartcontractkit/chainlink/v2/core/services/vrf/vrfcommon"
"github.com/smartcontractkit/chainlink/v2/core/services/webhook"
"github.com/smartcontractkit/chainlink/v2/core/services/workflows/syncer"
Expand Down Expand Up @@ -446,7 +447,7 @@ func TestORM_DeleteJob_DeletesAssociatedRecords(t *testing.T) {

t.Run("it creates and deletes records for stream jobs", func(t *testing.T) {
ctx := testutils.Context(t)
jb, err := testspecs.GenerateStreamSpecJob(testspecs.GenerateStreamSpec(testspecs.StreamSpecParams{Name: "Test-stream", StreamID: 1}))
jb, err := streams.ValidatedStreamSpec(testspecs.GenerateStreamSpec(testspecs.StreamSpecParams{Name: "Test-stream", StreamID: 1}).Toml())
require.NoError(t, err)
err = jobORM.CreateJob(ctx, &jb)
require.NoError(t, err)
Expand Down
7 changes: 0 additions & 7 deletions core/testdata/testspecs/v2_specs.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (
"time"

"github.com/google/uuid"
"github.com/pelletier/go-toml/v2"
"github.com/test-go/testify/require"

"github.com/smartcontractkit/chainlink/v2/core/chains/evm/assets"
Expand Down Expand Up @@ -884,12 +883,6 @@ ds -> ds_parse -> ds_multiply;
return StreamSpec{StreamSpecParams: params, toml: toml}
}

func GenerateStreamSpecJob(spec StreamSpec) (job.Job, error) {
jb := job.Job{ExternalJobID: uuid.New()}
err := toml.Unmarshal([]byte(spec.Toml()), &jb)
return jb, err
}

// WorkflowJobSpec is a test helper that wraps both the TOML and job.Job representation of a workflow job spec
type WorkflowJobSpec struct {
toml string
Expand Down

0 comments on commit 9c3f022

Please sign in to comment.