Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ptodev committed Feb 27, 2025
1 parent e7ed631 commit 4fab89c
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 18 deletions.
2 changes: 1 addition & 1 deletion internal/component/common/config/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ type Headers struct {

func (p *Headers) Convert() *config.Headers {
if p == nil {
return &config.Headers{}
return nil
}

res := make(map[string]config.Header, len(p.Headers))
Expand Down
4 changes: 3 additions & 1 deletion internal/component/discovery/hetzner/hetzner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ func TestAlloyUnmarshal(t *testing.T) {
assert.Equal(t, 8080, args.Port)
assert.Equal(t, 10*time.Minute, args.RefreshInterval)
assert.Equal(t, "robot", args.Role)
assert.Equal(t, "foobar", args.HTTPClientConfig.HTTPHeaders.Headers["foo"][0])

header := args.HTTPClientConfig.HTTPHeaders.Headers["foo"][0]
assert.Equal(t, "foobar", string(header))
}

func TestValidate(t *testing.T) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
prometheus.remote_write "metrics_default" {
endpoint {
name = "default-c3a75f"
name = "default-b174ee"
url = "http://localhost:9009/api/prom/push"

queue_config { }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
prometheus.remote_write "metrics_default" {
endpoint {
name = "default-c3a75f"
name = "default-b174ee"
url = "http://localhost:9009/api/prom/push"

queue_config { }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
prometheus.remote_write "metrics_test1" {
endpoint {
name = "test1-c3a75f"
name = "test1-b174ee"
url = "http://localhost:9009/api/prom/push"

queue_config { }
Expand All @@ -11,7 +11,7 @@ prometheus.remote_write "metrics_test1" {

prometheus.remote_write "metrics_test2" {
endpoint {
name = "test2-1525fa"
name = "test2-6eeee7"
url = "http://localhost:9010/api/prom/push"
send_exemplars = false

Expand All @@ -23,7 +23,7 @@ prometheus.remote_write "metrics_test2" {

prometheus.remote_write "metrics_test3" {
endpoint {
name = "test3-c4d4ae"
name = "test3-20b70b"
url = "http://localhost:9011/api/prom/push"

queue_config { }
Expand All @@ -32,7 +32,7 @@ prometheus.remote_write "metrics_test3" {
}

endpoint {
name = "test3-51df17"
name = "test3-76e921"
url = "http://localhost:9012/api/prom/push"

queue_config {
Expand All @@ -45,7 +45,7 @@ prometheus.remote_write "metrics_test3" {

prometheus.remote_write "metrics_test4_sigv4_defaults" {
endpoint {
name = "test4_sigv4_defaults-b0b080"
name = "test4_sigv4_defaults-1f7913"
url = "http://localhost:9012/api/prom/push"

queue_config { }
Expand All @@ -58,7 +58,7 @@ prometheus.remote_write "metrics_test4_sigv4_defaults" {

prometheus.remote_write "metrics_test5_sigv4_explicit" {
endpoint {
name = "test5_sigv4_explicit-51a6e5"
name = "test5_sigv4_explicit-c276a0"
url = "http://localhost:9012/api/prom/push"

queue_config { }
Expand All @@ -77,7 +77,7 @@ prometheus.remote_write "metrics_test5_sigv4_explicit" {

prometheus.remote_write "metrics_test6_azuread_defaults" {
endpoint {
name = "test6_azuread_defaults-07927e"
name = "test6_azuread_defaults-e2dd54"
url = "http://localhost:9012/api/prom/push"

queue_config { }
Expand All @@ -94,7 +94,7 @@ prometheus.remote_write "metrics_test6_azuread_defaults" {

prometheus.remote_write "metrics_test7_azuread_explicit" {
endpoint {
name = "test7_azuread_explicit-8b8570"
name = "test7_azuread_explicit-3990f2"
url = "http://localhost:9012/api/prom/push"

queue_config { }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ prometheus.relabel "metrics_agent_promobee" {

prometheus.remote_write "metrics_agent" {
endpoint {
name = "agent-b8fb76"
name = "agent-b7ba8a"
url = "https://prometheus-us-central1.grafana.net/api/prom/push"

basic_auth {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
prometheus.remote_write "metrics_integrations" {
endpoint {
name = "integrations-0031a8"
name = "integrations-65e590"
url = "https://region.grafana.net/api/prom/push"

basic_auth {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
prometheus.remote_write "metrics_remote_write_name" {
endpoint {
name = "remote_write_name-c3a75f"
name = "remote_write_name-b174ee"
url = "http://localhost:9009/api/prom/push"

queue_config { }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ prometheus.scrape "metrics_agent_prometheus" {

prometheus.remote_write "metrics_agent" {
endpoint {
name = "agent-6489d6"
name = "agent-f579d1"
url = "https://prometheus-us-central1.grafana.net/api/prom/push"

queue_config { }
Expand Down Expand Up @@ -41,7 +41,7 @@ prometheus.scrape "integrations_statsd_exporter" {

prometheus.remote_write "integrations" {
endpoint {
name = "agent-6489d6"
name = "agent-f579d1"
url = "https://prometheus-us-central1.grafana.net/api/prom/push"

queue_config { }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ prometheus.scrape "metrics_name_jobName" {

prometheus.remote_write "metrics_name" {
endpoint {
name = "name-c3a75f"
name = "name-b174ee"
url = "http://localhost:9009/api/prom/push"

queue_config { }
Expand Down

0 comments on commit 4fab89c

Please sign in to comment.