@@ -11,14 +11,35 @@ import (
1111 "github.com/smartcontractkit/chainlink-common/keystore/corekeys/csakey"
1212 "github.com/smartcontractkit/chainlink-common/pkg/beholder"
1313 "github.com/smartcontractkit/chainlink-common/pkg/beholder/beholdertest"
14+ commoncfg "github.com/smartcontractkit/chainlink-common/pkg/config"
1415 "github.com/smartcontractkit/chainlink-common/pkg/services/servicetest"
1516 commonv1 "github.com/smartcontractkit/chainlink-protos/node-platform/common/v1"
1617 "github.com/smartcontractkit/chainlink/v2/core/internal/cltest"
18+ "github.com/smartcontractkit/chainlink/v2/core/internal/testutils/configtest"
1719 "github.com/smartcontractkit/chainlink/v2/core/logger"
1820 "github.com/smartcontractkit/chainlink/v2/core/services/chainlink"
1921 keystoremocks "github.com/smartcontractkit/chainlink/v2/core/services/keystore/mocks"
2022)
2123
24+ func TestNewNodePlatformBuildInfoConfig_UsesThreeMinuteBeat (t * testing.T ) {
25+ csaStore := & keystoremocks.CSA {}
26+ keyStore := & keystoremocks.Master {}
27+ keyStore .EXPECT ().CSA ().Return (csaStore ).Once ()
28+
29+ cfg := configtest .NewGeneralConfig (t , func (c * chainlink.Config , _ * chainlink.Secrets ) {
30+ c .Telemetry .HeartbeatInterval = commoncfg .MustNewDuration (5 * time .Second )
31+ })
32+
33+ buildInfoCfg := chainlink .NewNodePlatformBuildInfoConfig (chainlink.ApplicationOpts {
34+ Config : cfg ,
35+ Logger : logger .TestLogger (t ),
36+ KeyStore : keyStore ,
37+ })
38+
39+ require .Equal (t , 3 * time .Minute , buildInfoCfg .Beat )
40+ require .Same (t , csaStore , buildInfoCfg .CSAKeyStore )
41+ }
42+
2243func TestNodePlatformBuildInfo_EmitsNodeBuildInfo (t * testing.T ) {
2344 obs := beholdertest .NewObserver (t )
2445
0 commit comments