Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions core/services/chainlink/config_audit_logger_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
)

func TestAuditLoggerConfig(t *testing.T) {
t.Parallel()
opts := GeneralConfigOpts{
ConfigStrings: []string{fullTOML},
}
Expand Down
1 change: 1 addition & 0 deletions core/services/chainlink/config_auto_pprof_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
)

func TestAutoPprofTest(t *testing.T) {
t.Parallel()
opts := GeneralConfigOpts{
ConfigStrings: []string{fullTOML},
}
Expand Down
8 changes: 8 additions & 0 deletions core/services/chainlink/config_capabilities_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
)

func TestCapabilitiesLocalConfig(t *testing.T) {
t.Parallel()
opts := GeneralConfigOpts{
ConfigStrings: []string{fullTOML},
}
Expand All @@ -31,6 +32,7 @@ func TestCapabilitiesLocalConfig(t *testing.T) {
}

func TestCapabilitiesLocalConfigEmpty(t *testing.T) {
t.Parallel()
tomlStr := `
[Capabilities.Local]
`
Expand All @@ -46,6 +48,7 @@ func TestCapabilitiesLocalConfigEmpty(t *testing.T) {
}

func TestValidateCapabilityID(t *testing.T) {
t.Parallel()
tests := []struct {
name string
capID string
Expand All @@ -66,6 +69,7 @@ func TestValidateCapabilityID(t *testing.T) {

for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
t.Parallel()
err := toml.ValidateCapabilityID(tt.capID)
if tt.wantErr {
assert.Error(t, err)
Expand All @@ -77,7 +81,9 @@ func TestValidateCapabilityID(t *testing.T) {
}

func TestLocalCapabilitiesValidation(t *testing.T) {
t.Parallel()
t.Run("valid config with regex patterns", func(t *testing.T) {
t.Parallel()
cfg := toml.LocalCapabilities{
RegistryBasedLaunchAllowlist: []string{"^cron@1\\.0\\.0$", "^http-actions@.*$", ".*"},
}
Expand All @@ -86,6 +92,7 @@ func TestLocalCapabilitiesValidation(t *testing.T) {
})

t.Run("invalid regex pattern", func(t *testing.T) {
t.Parallel()
cfg := toml.LocalCapabilities{
RegistryBasedLaunchAllowlist: []string{"[invalid"},
}
Expand All @@ -96,6 +103,7 @@ func TestLocalCapabilitiesValidation(t *testing.T) {
})

t.Run("multiple errors", func(t *testing.T) {
t.Parallel()
cfg := toml.LocalCapabilities{
RegistryBasedLaunchAllowlist: []string{"[invalid1", "[invalid2"},
}
Expand Down
1 change: 1 addition & 0 deletions core/services/chainlink/config_ccv_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ APISecret = "indexer-api-secret"
)

func TestCCVConfig(t *testing.T) {
t.Parallel()
opts := GeneralConfigOpts{
SecretsStrings: []string{secretsCCV},
}
Expand Down
5 changes: 5 additions & 0 deletions core/services/chainlink/config_cre_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ URL = "file:///path/to/workflows"
)

func TestCREConfig(t *testing.T) {
t.Parallel()
opts := GeneralConfigOpts{
SecretsStrings: []string{secretsCRE},
ConfigStrings: []string{configCRE},
Expand All @@ -57,6 +58,7 @@ func TestCREConfig(t *testing.T) {
}

func TestCREConfigWithFileURL(t *testing.T) {
t.Parallel()
opts := GeneralConfigOpts{
ConfigStrings: []string{configCREWithFileURL},
}
Expand All @@ -71,6 +73,7 @@ func TestCREConfigWithFileURL(t *testing.T) {
}

func TestEmptyCREConfig(t *testing.T) {
t.Parallel()
cfg := creConfig{s: toml.CreSecrets{}, c: toml.CreConfig{}}
assert.Empty(t, cfg.StreamsAPIKey())
assert.Empty(t, cfg.StreamsAPISecret())
Expand All @@ -85,6 +88,7 @@ func TestEmptyCREConfig(t *testing.T) {
}

func TestWorkflowFetcherConfig(t *testing.T) {
t.Parallel()
testCases := []struct {
name string
config string
Expand Down Expand Up @@ -118,6 +122,7 @@ URL = "file:///local/path/to/workflows"

for _, tc := range testCases {
t.Run(tc.name, func(t *testing.T) {
t.Parallel()
opts := GeneralConfigOpts{
ConfigStrings: []string{tc.config},
}
Expand Down
1 change: 1 addition & 0 deletions core/services/chainlink/config_database_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
)

func TestDatabaseConfig(t *testing.T) {
t.Parallel()
opts := GeneralConfigOpts{
ConfigStrings: []string{fullTOML},
SecretsStrings: []string{`[Database]
Expand Down
1 change: 1 addition & 0 deletions core/services/chainlink/config_feature_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
)

func TestFeatureConfig(t *testing.T) {
t.Parallel()
opts := GeneralConfigOpts{
ConfigStrings: []string{fullTOML},
}
Expand Down
3 changes: 3 additions & 0 deletions core/services/chainlink/config_general_dev_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ func TestTOMLGeneralConfig_DevModeInsecureConfig(t *testing.T) {
t.Parallel()

t.Run("all insecure configs are false by default", func(t *testing.T) {
t.Parallel()
config, err := GeneralConfigOpts{}.New()
require.NoError(t, err)

Expand All @@ -26,6 +27,7 @@ func TestTOMLGeneralConfig_DevModeInsecureConfig(t *testing.T) {
})

t.Run("insecure config ignore override on non-dev builds", func(t *testing.T) {
t.Parallel()
config, err := GeneralConfigOpts{
OverrideFn: func(c *Config, s *Secrets) {
*c.Insecure.DevWebServer = true
Expand All @@ -43,6 +45,7 @@ func TestTOMLGeneralConfig_DevModeInsecureConfig(t *testing.T) {
})

t.Run("ParseConfig accepts insecure values on dev builds", func(t *testing.T) {
t.Parallel()
opts := GeneralConfigOpts{
ConfigStrings: []string{
`
Expand Down
1 change: 1 addition & 0 deletions core/services/chainlink/config_insecure_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
)

func TestInsecureConfig(t *testing.T) {
t.Parallel()
opts := GeneralConfigOpts{
ConfigStrings: []string{fullTOML},
}
Expand Down
1 change: 1 addition & 0 deletions core/services/chainlink/config_job_distributor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
)

func TestJobDistributorConfig(t *testing.T) {
t.Parallel()
opts := GeneralConfigOpts{
ConfigStrings: []string{fullTOML},
}
Expand Down
1 change: 1 addition & 0 deletions core/services/chainlink/config_job_pipeline_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
)

func TestJobPipelineConfigTest(t *testing.T) {
t.Parallel()
opts := GeneralConfigOpts{
ConfigStrings: []string{fullTOML},
}
Expand Down
1 change: 1 addition & 0 deletions core/services/chainlink/config_log_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
)

func TestLogConfig(t *testing.T) {
t.Parallel()
opts := GeneralConfigOpts{
ConfigStrings: []string{fullTOML},
}
Expand Down
2 changes: 2 additions & 0 deletions core/services/chainlink/config_mercury_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ Password = "password2"
)

func TestMercuryConfig(t *testing.T) {
t.Parallel()
opts := GeneralConfigOpts{
SecretsStrings: []string{secretsMercury},
}
Expand All @@ -37,6 +38,7 @@ func TestMercuryConfig(t *testing.T) {
}

func TestMercuryTLS(t *testing.T) {
t.Parallel()
certPath := "/path/to/cert.pem"
transmission := toml.Mercury{
TLS: toml.MercuryTLS{
Expand Down
1 change: 1 addition & 0 deletions core/services/chainlink/config_ocr2_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
)

func TestOCR2Config(t *testing.T) {
t.Parallel()
opts := GeneralConfigOpts{
ConfigStrings: []string{fullTOML},
}
Expand Down
1 change: 1 addition & 0 deletions core/services/chainlink/config_ocr_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
)

func TestOCRConfig(t *testing.T) {
t.Parallel()
opts := GeneralConfigOpts{
ConfigStrings: []string{fullTOML},
}
Expand Down
1 change: 1 addition & 0 deletions core/services/chainlink/config_p2p_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
)

func TestP2PConfig(t *testing.T) {
t.Parallel()
opts := GeneralConfigOpts{
ConfigStrings: []string{fullTOML},
}
Expand Down
1 change: 1 addition & 0 deletions core/services/chainlink/config_password_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
)

func TestPasswordConfig(t *testing.T) {
t.Parallel()
opts := GeneralConfigOpts{
ConfigStrings: []string{fullTOML},
}
Expand Down
1 change: 1 addition & 0 deletions core/services/chainlink/config_prometheus_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
)

func TestPrometheusConfig(t *testing.T) {
t.Parallel()
opts := GeneralConfigOpts{
ConfigStrings: []string{fullTOML},
}
Expand Down
1 change: 1 addition & 0 deletions core/services/chainlink/config_pyroscope_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
)

func TestPyroscopeConfigTest(t *testing.T) {
t.Parallel()
opts := GeneralConfigOpts{
ConfigStrings: []string{fullTOML},
SecretsStrings: []string{secretsFullTOML},
Expand Down
4 changes: 4 additions & 0 deletions core/services/chainlink/config_telemetry_ingress_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
)

func TestTelemetryIngressConfig(t *testing.T) {
t.Parallel()
opts := GeneralConfigOpts{
ConfigStrings: []string{fullTOML},
}
Expand All @@ -36,7 +37,9 @@ func TestTelemetryIngressConfig(t *testing.T) {
}

func TestTelemetryIngressConfig_ChipIngressEnabled(t *testing.T) {
t.Parallel()
t.Run("returns false when ChipIngressEnabled is explicitly false", func(t *testing.T) {
t.Parallel()
falseVal := false
config := &telemetryIngressConfig{
c: toml.TelemetryIngress{
Expand All @@ -47,6 +50,7 @@ func TestTelemetryIngressConfig_ChipIngressEnabled(t *testing.T) {
})

t.Run("returns true when ChipIngressEnabled is true", func(t *testing.T) {
t.Parallel()
trueVal := true
config := &telemetryIngressConfig{
c: toml.TelemetryIngress{
Expand Down
Loading
Loading