@@ -3,13 +3,15 @@ package keeper_test
33import (
44 "fmt"
55 "math/big"
6+ "net/http"
67 "testing"
78 "time"
89
910 "github.com/ethereum/go-ethereum/accounts/abi/bind"
1011 "github.com/ethereum/go-ethereum/common"
1112 "github.com/ethereum/go-ethereum/core/types"
1213 "github.com/ethereum/go-ethereum/eth/ethconfig"
14+ "github.com/jmoiron/sqlx"
1315 "github.com/onsi/gomega"
1416 "github.com/pkg/errors"
1517 "github.com/stretchr/testify/require"
@@ -20,6 +22,9 @@ import (
2022 commonconfig "github.com/smartcontractkit/chainlink-common/pkg/config"
2123 "github.com/smartcontractkit/chainlink-common/pkg/sqlutil"
2224 "github.com/smartcontractkit/chainlink-common/pkg/utils/tests"
25+ "github.com/smartcontractkit/chainlink/v2/core/bridges"
26+ "github.com/smartcontractkit/chainlink/v2/core/services/keystore"
27+ "github.com/smartcontractkit/chainlink/v2/core/services/pipeline"
2328
2429 "github.com/smartcontractkit/chainlink-evm/gethwrappers/generated/basic_upkeep_contract"
2530 "github.com/smartcontractkit/chainlink-evm/gethwrappers/generated/keeper_registry_logic1_3"
@@ -602,3 +607,27 @@ func TestMaxPerformDataSize(t *testing.T) {
602607 g .Eventually (receivedBytes , 20 * time .Second , cltest .DBPollingInterval ).Should (gomega .Equal (smallPayload ))
603608 })
604609}
610+
611+ type JobPipelineV2TestHelper struct {
612+ Prm pipeline.ORM
613+ Jrm job.ORM
614+ Pr pipeline.Runner
615+ }
616+
617+ type JobPipelineConfig interface {
618+ pipeline.Config
619+ MaxSuccessfulRuns () uint64
620+ }
621+
622+ func NewJobPipelineV2 (t testing.TB , cfg pipeline.BridgeConfig , jpcfg JobPipelineConfig , legacyChains legacyevm.LegacyChainContainer , db * sqlx.DB , keyStore keystore.Master , restrictedHTTPClient , unrestrictedHTTPClient * http.Client ) JobPipelineV2TestHelper {
623+ lggr := logger .TestLogger (t )
624+ prm := pipeline .NewORM (db , lggr , jpcfg .MaxSuccessfulRuns ())
625+ btORM := bridges .NewORM (db )
626+ jrm := job .NewORM (db , prm , btORM , keyStore , lggr )
627+ pr := pipeline .NewRunner (prm , btORM , jpcfg , cfg , legacyChains , keyStore .Eth (), keyStore .VRF (), lggr , restrictedHTTPClient , unrestrictedHTTPClient )
628+ return JobPipelineV2TestHelper {
629+ prm ,
630+ jrm ,
631+ pr ,
632+ }
633+ }
0 commit comments