Skip to content

Commit

Permalink
split tests to check flags correctness individually
Browse files Browse the repository at this point in the history
  • Loading branch information
mchrome committed Mar 12, 2024
1 parent d569edc commit e6e5995
Show file tree
Hide file tree
Showing 9 changed files with 2,832 additions and 47 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ max-metrics-per-target = 10000
headers-to-log = [ "X-Ctx-Carbonapi-Uuid" ]

[feature-flags]
use-carbon-behaviour = true
dont-match-missing-tags = true

[clickhouse]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ dir = "tests/clickhouse/rollup"
template = "carbon-clickhouse.conf.tpl"

[[test.graphite_clickhouse]]
template = "graphite-clickhouse-internal-aggr.conf.tpl"
template = "graphite-clickhouse.conf.tpl"

#######################################################################################

Expand Down Expand Up @@ -113,17 +113,6 @@ targets = [
"seriesByTag('name=request_success_total.counter', 'app=test', 'project=Test', 'environment=TEST', 't=')",
]

[[test.render_checks.result]]
name = "request_success_total.counter;app=test;environment=TEST;project=Test"
path = "seriesByTag('name=request_success_total.counter', 'app=test', 'project=Test', 'environment=TEST', 't=')"
consolidation = "avg"
start = "rnow-10"
stop = "rnow+10"
step = 10
req_start = "rnow-10"
req_stop = "rnow+10"
values = [1.0, nan]

## seriesByTag('t=')

[[test.render_checks]]
Expand All @@ -134,39 +123,6 @@ targets = [
"seriesByTag('t=')",
]

[[test.render_checks.result]]
name = "request_success_total.counter;app=test;environment=TEST;project=Test"
path = "seriesByTag('t=')"
consolidation = "avg"
start = "rnow-10"
stop = "rnow+10"
step = 10
req_start = "rnow-10"
req_stop = "rnow+10"
values = [1.0, nan]

[[test.render_checks.result]]
name = "test;env=dr"
path = "seriesByTag('t=')"
consolidation = "avg"
start = "rnow-10"
stop = "rnow+10"
step = 10
req_start = "rnow-10"
req_stop = "rnow+10"
values = [1.0, nan]

[[test.render_checks.result]]
name = "test;env=prod"
path = "seriesByTag('t=')"
consolidation = "avg"
start = "rnow-10"
stop = "rnow+10"
step = 10
req_start = "rnow-10"
req_stop = "rnow+10"
values = [1.0, nan]

# seriesByTag('name=request_success_total.counter', 'app=test', 'project=Test', 'environment=TEST', 't!=') ###

[[test.render_checks]]
Expand Down Expand Up @@ -430,6 +386,38 @@ req_start = "rnow-10"
req_stop = "rnow+10"
values = [1.0, nan]

[[test.render_checks]]
from = "rnow-10"
until = "rnow+1"
timeout = "1h"
targets = [
"seriesByTag('name=request_success_total.counter', 'app=test', 'project=Test', 'environment=TEST', 't!=~cq.*')",
]

# ### seriesByTag('name=request_success_total.counter', 'app=test', 'project=Test', 'environment=TEST', 't!=~q*') ###

[[test.render_checks.result]]
name = "request_success_total.counter;app=test;environment=TEST;project=Test;t=q"
path = "seriesByTag('name=request_success_total.counter', 'app=test', 'project=Test', 'environment=TEST', 't!=~cq.*')"
consolidation = "avg"
start = "rnow-10"
stop = "rnow+10"
step = 10
req_start = "rnow-10"
req_stop = "rnow+10"
values = [1.0, nan]

[[test.render_checks.result]]
name = "request_success_total.counter;app=test;environment=TEST;project=Test;t=qac"
path = "seriesByTag('name=request_success_total.counter', 'app=test', 'project=Test', 'environment=TEST', 't!=~cq.*')"
consolidation = "avg"
start = "rnow-10"
stop = "rnow+10"
step = 10
req_start = "rnow-10"
req_stop = "rnow+10"
values = [1.0, nan]

# ## seriesByTag('name=request_success_total.counter', 'app=test', 'project=Test', 'environment=TEST', 't=*c') ###

[[test.render_checks]]
Expand Down Expand Up @@ -942,5 +930,6 @@ req_start = "rnow-10"
req_stop = "rnow+10"
values = [1.0, nan]

# # End - Test seriesByTag
# # End - Test no flags
# #########################################################################

45 changes: 45 additions & 0 deletions tests/feature_flags_false/carbon-clickhouse.conf.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
[common]

[data]
path = "/etc/carbon-clickhouse/data"
chunk-interval = "1s"
chunk-auto-interval = ""

[upload.graphite_index]
type = "index"
table = "graphite_index"
url = "{{ .CLICKHOUSE_URL }}/"
timeout = "2m30s"
cache-ttl = "1h"

[upload.graphite_tags]
type = "tagged"
table = "graphite_tags"
threads = 3
url = "{{ .CLICKHOUSE_URL }}/"
timeout = "2m30s"
cache-ttl = "1h"

[upload.graphite_reverse]
type = "points-reverse"
table = "graphite_reverse"
url = "{{ .CLICKHOUSE_URL }}/"
timeout = "2m30s"
zero-timestamp = false

[upload.graphite]
type = "points"
table = "graphite"
url = "{{ .CLICKHOUSE_URL }}/"
timeout = "2m30s"
zero-timestamp = false

[tcp]
listen = ":2003"
enabled = true
drop-future = "0s"
drop-past = "0s"

[logging]
file = "/etc/carbon-clickhouse/carbon-clickhouse.log"
level = "debug"
33 changes: 33 additions & 0 deletions tests/feature_flags_false/graphite-clickhouse.conf.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
[common]
listen = "{{ .GCH_ADDR }}"
max-cpu = 0
max-metrics-in-render-answer = 10000
max-metrics-per-target = 10000
headers-to-log = [ "X-Ctx-Carbonapi-Uuid" ]

[clickhouse]
url = "{{ .CLICKHOUSE_URL }}/?max_rows_to_read=500000000&max_result_bytes=1073741824&readonly=2&log_queries=1"
data-timeout = "30s"

index-table = "graphite_index"
index-use-daily = true
index-timeout = "1m"
internal-aggregation = true

tagged-table = "graphite_tags"
tagged-autocomplete-days = 1

[[data-table]]
# # clickhouse table name
table = "graphite"
# # points in table are stored with reverse path
reverse = false
rollup-conf = "auto"

[[logging]]
logger = ""
file = "{{ .GCH_DIR }}/graphite-clickhouse.log"
level = "info"
encoding = "json"
encoding-time = "iso8601"
encoding-duration = "seconds"
Loading

0 comments on commit e6e5995

Please sign in to comment.