Skip to content

Commit

Permalink
Fix TestScripts
Browse files Browse the repository at this point in the history
  • Loading branch information
pkcll committed Nov 8, 2024
1 parent 8bc9e7f commit f35ac86
Show file tree
Hide file tree
Showing 19 changed files with 46 additions and 6 deletions.
14 changes: 8 additions & 6 deletions core/services/chainlink/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -556,12 +556,14 @@ func TestConfig_Marshal(t *testing.T) {
Release: ptr("v1.2.3"),
}
full.Telemetry = toml.Telemetry{
Enabled: ptr(true),
CACertFile: ptr("cert-file"),
Endpoint: ptr("example.com/collector"),
InsecureConnection: ptr(true),
ResourceAttributes: map[string]string{"Baz": "test", "Foo": "bar"},
TraceSampleRatio: ptr(0.01),
Enabled: ptr(true),
CACertFile: ptr("cert-file"),
Endpoint: ptr("example.com/collector"),
InsecureConnection: ptr(true),
ResourceAttributes: map[string]string{"Baz": "test", "Foo": "bar"},
TraceSampleRatio: ptr(0.01),
EmitterBatchProcessor: ptr(true),
EmitterExportTimeout: commoncfg.MustNewDuration(1 * time.Second),
}
full.EVM = []*evmcfg.EVMConfig{
{
Expand Down
2 changes: 2 additions & 0 deletions core/services/chainlink/testdata/config-empty-effective.toml
Original file line number Diff line number Diff line change
Expand Up @@ -286,3 +286,5 @@ CACertFile = ''
Endpoint = ''
InsecureConnection = false
TraceSampleRatio = 0.01
EmitterBatchProcessor = true
EmitterExportTimeout = "1s"
2 changes: 2 additions & 0 deletions core/services/chainlink/testdata/config-full.toml
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,8 @@ CACertFile = 'cert-file'
Endpoint = 'example.com/collector'
InsecureConnection = true
TraceSampleRatio = 0.01
EmitterBatchProcessor = true
EmitterExportTimeout = "1s"

[Telemetry.ResourceAttributes]
Baz = 'test'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,8 @@ CACertFile = ''
Endpoint = ''
InsecureConnection = false
TraceSampleRatio = 0.01
EmitterBatchProcessor = true
EmitterExportTimeout = "1s"

[[EVM]]
ChainID = '1'
Expand Down
2 changes: 2 additions & 0 deletions core/web/resolver/testdata/config-empty-effective.toml
Original file line number Diff line number Diff line change
Expand Up @@ -286,3 +286,5 @@ CACertFile = ''
Endpoint = ''
InsecureConnection = false
TraceSampleRatio = 0.01
EmitterBatchProcessor = true
EmitterExportTimeout = "1s"
2 changes: 2 additions & 0 deletions core/web/resolver/testdata/config-full.toml
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,8 @@ CACertFile = 'cert-file'
Endpoint = 'example.com/collector'
InsecureConnection = true
TraceSampleRatio = 0.01
EmitterBatchProcessor = true
EmitterExportTimeout = "1s"

[Telemetry.ResourceAttributes]
Baz = 'test'
Expand Down
2 changes: 2 additions & 0 deletions core/web/resolver/testdata/config-multi-chain-effective.toml
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,8 @@ CACertFile = ''
Endpoint = ''
InsecureConnection = false
TraceSampleRatio = 0.01
EmitterBatchProcessor = true
EmitterExportTimeout = "1s"

[[EVM]]
ChainID = '1'
Expand Down
3 changes: 3 additions & 0 deletions plugins/loop_registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ func (m *LoopRegistry) Register(id string) (*RegisteredLoop, error) {
envCfg.TelemetryCACertFile = m.cfgTelemetry.CACertFile()
envCfg.TelemetryAttributes = m.cfgTelemetry.ResourceAttributes()
envCfg.TelemetryTraceSampleRatio = m.cfgTelemetry.TraceSampleRatio()
// TODO: Implement these
// envCfg.TelemetryBatchProcessor = m.cfgTelemetry.EmitterBatchProcessor()
// envCfg.TelemetryExportTimeout = m.cfgTelemetry.EmitterExportTimeout()
}

m.registry[id] = &RegisteredLoop{Name: id, EnvCfg: envCfg}
Expand Down
3 changes: 3 additions & 0 deletions plugins/loop_registry_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,7 @@ func TestLoopRegistry_Register(t *testing.T) {
require.Equal(t, "http://localhost:9001", envCfg.TelemetryEndpoint)
require.Equal(t, loop.OtelAttributes{"foo": "bar"}, envCfg.TelemetryAttributes)
require.Equal(t, 0.42, envCfg.TelemetryTraceSampleRatio)
// TODO: EmitterBatchProcessor and EmitterExportTimeout to envCfg
// require.False(t, true, envCfg.EmitterBatchProcessor)
// require.Equal(t, 1*time.Second, envCfg.EmitterExportTimeout)
}
2 changes: 2 additions & 0 deletions testdata/scripts/config/merge_raw_configs.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,8 @@ CACertFile = ''
Endpoint = ''
InsecureConnection = false
TraceSampleRatio = 0.01
EmitterBatchProcessor = true
EmitterExportTimeout = '1s'

[[Aptos]]
ChainID = '1'
Expand Down
2 changes: 2 additions & 0 deletions testdata/scripts/node/validate/default.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,8 @@ CACertFile = ''
Endpoint = ''
InsecureConnection = false
TraceSampleRatio = 0.01
EmitterBatchProcessor = true
EmitterExportTimeout = '1s'

Invalid configuration: invalid secrets: 2 errors:
- Database.URL: empty: must be provided and non-empty
Expand Down
2 changes: 2 additions & 0 deletions testdata/scripts/node/validate/defaults-override.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,8 @@ CACertFile = ''
Endpoint = ''
InsecureConnection = false
TraceSampleRatio = 0.01
EmitterBatchProcessor = true
EmitterExportTimeout = '1s'

[[EVM]]
ChainID = '1'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,8 @@ CACertFile = ''
Endpoint = ''
InsecureConnection = false
TraceSampleRatio = 0.01
EmitterBatchProcessor = true
EmitterExportTimeout = '1s'

[[EVM]]
ChainID = '1'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,8 @@ CACertFile = ''
Endpoint = ''
InsecureConnection = false
TraceSampleRatio = 0.01
EmitterBatchProcessor = true
EmitterExportTimeout = '1s'

[[EVM]]
ChainID = '1'
Expand Down
2 changes: 2 additions & 0 deletions testdata/scripts/node/validate/disk-based-logging.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,8 @@ CACertFile = ''
Endpoint = ''
InsecureConnection = false
TraceSampleRatio = 0.01
EmitterBatchProcessor = true
EmitterExportTimeout = '1s'

[[EVM]]
ChainID = '1'
Expand Down
2 changes: 2 additions & 0 deletions testdata/scripts/node/validate/invalid-ocr-p2p.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,8 @@ CACertFile = ''
Endpoint = ''
InsecureConnection = false
TraceSampleRatio = 0.01
EmitterBatchProcessor = true
EmitterExportTimeout = '1s'

Invalid configuration: invalid configuration: P2P.V2.Enabled: invalid value (false): P2P required for OCR or OCR2. Please enable P2P or disable OCR/OCR2.

Expand Down
2 changes: 2 additions & 0 deletions testdata/scripts/node/validate/invalid.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,8 @@ CACertFile = ''
Endpoint = ''
InsecureConnection = false
TraceSampleRatio = 0.01
EmitterBatchProcessor = true
EmitterExportTimeout = '1s'

[[EVM]]
ChainID = '1'
Expand Down
2 changes: 2 additions & 0 deletions testdata/scripts/node/validate/valid.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,8 @@ CACertFile = ''
Endpoint = ''
InsecureConnection = false
TraceSampleRatio = 0.01
EmitterBatchProcessor = true
EmitterExportTimeout = '1s'

[[EVM]]
ChainID = '1'
Expand Down
2 changes: 2 additions & 0 deletions testdata/scripts/node/validate/warnings.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,8 @@ CACertFile = ''
Endpoint = ''
InsecureConnection = false
TraceSampleRatio = 0.01
EmitterBatchProcessor = true
EmitterExportTimeout = '1s'

# Configuration warning:
Tracing.TLSCertPath: invalid value (something): must be empty when Tracing.Mode is 'unencrypted'
Expand Down

0 comments on commit f35ac86

Please sign in to comment.