Skip to content

Commit 0cbed61

Browse files
feat(engine): integrate memory JD to test runtime (#522)
Creating the test runtime engine will now use the in memory JD by default
1 parent 99ee634 commit 0cbed61

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

.changeset/hot-sites-grow.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"chainlink-deployments-framework": minor
3+
---
4+
5+
feat(engine): integrate memory JD to test runtime

engine/test/environment/environment.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import (
1212
fdatastore "github.com/smartcontractkit/chainlink-deployments-framework/datastore"
1313
fcatalog "github.com/smartcontractkit/chainlink-deployments-framework/datastore/catalog/memory"
1414
fdeployment "github.com/smartcontractkit/chainlink-deployments-framework/deployment"
15+
foffchain "github.com/smartcontractkit/chainlink-deployments-framework/offchain/jd/memory"
1516
focr "github.com/smartcontractkit/chainlink-deployments-framework/offchain/ocr"
1617
foperations "github.com/smartcontractkit/chainlink-deployments-framework/operations"
1718
)
@@ -63,9 +64,10 @@ func (l *Loader) Load(ctx context.Context, opts ...LoadOpt) (*fdeployment.Enviro
6364
nodeIDs = []string{}
6465
}
6566

66-
// We do not set any default offchain client as it is not required for all tests.
67-
// We may want to set a default memory based offchain client in the future.
6867
oc := cmps.OffchainClient
68+
if oc == nil {
69+
oc = foffchain.NewMemoryJobDistributor()
70+
}
6971

7072
catalog, err := fcatalog.NewMemoryCatalogDataStore()
7173
if err != nil {

engine/test/environment/environment_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,8 @@ func TestLoader_Load_Options(t *testing.T) {
9595
} else {
9696
require.NoError(t, err)
9797
require.NotNil(t, env)
98-
require.NotNil(t, env.Catalog) // Catalog should always be initialized
98+
require.NotNil(t, env.Catalog) // Catalog should always be initialized
99+
require.NotNil(t, env.Offchain) // Offchain should always be initialized
99100
}
100101
})
101102
}

0 commit comments

Comments
 (0)