Skip to content

Commit

Permalink
[coordinator] Add Graphite Carbon rewrite cleanup integration test
Browse files Browse the repository at this point in the history
  • Loading branch information
robskillington committed Dec 27, 2020
1 parent 7f34add commit bbdc2e5
Show file tree
Hide file tree
Showing 8 changed files with 77 additions and 0 deletions.
9 changes: 9 additions & 0 deletions scripts/docker-integration-tests/carbon/expected/dbaz.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[
{
"id": "d.bar.baz",
"text": "baz",
"leaf": 1,
"expandable": 0,
"allowChildren": 0
}
]
9 changes: 9 additions & 0 deletions scripts/docker-integration-tests/carbon/expected/ebaz.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[
{
"id": "e.bar.baz",
"text": "baz",
"leaf": 1,
"expandable": 0,
"allowChildren": 0
}
]
9 changes: 9 additions & 0 deletions scripts/docker-integration-tests/carbon/expected/fbaz.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[
{
"id": "f.bar.baz",
"text": "baz",
"leaf": 1,
"expandable": 0,
"allowChildren": 0
}
]
9 changes: 9 additions & 0 deletions scripts/docker-integration-tests/carbon/expected/gbaz.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[
{
"id": "g.bar.baz",
"text": "baz",
"leaf": 1,
"expandable": 0,
"allowChildren": 0
}
]
9 changes: 9 additions & 0 deletions scripts/docker-integration-tests/carbon/expected/hbarbaz.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[
{
"id": "h.bar_baz",
"text": "bar_baz",
"leaf": 1,
"expandable": 0,
"allowChildren": 0
}
]
9 changes: 9 additions & 0 deletions scripts/docker-integration-tests/carbon/expected/ibarbaz.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[
{
"id": "i.bar_baz",
"text": "bar_baz",
"leaf": 1,
"expandable": 0,
"allowChildren": 0
}
]
2 changes: 2 additions & 0 deletions scripts/docker-integration-tests/carbon/m3coordinator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ clusters:
carbon:
ingester:
listenAddress: "0.0.0.0:7204"
rewrite:
cleanup: true
rules:
- pattern: .*min.aggregate.*
aggregation:
Expand Down
21 changes: 21 additions & 0 deletions scripts/docker-integration-tests/carbon/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,28 @@ echo "quail 42 $t" | nc 0.0.0.0 7204
ATTEMPTS=20 MAX_TIMEOUT=4 TIMEOUT=1 retry_with_backoff read_carbon 'quail' 42

t=$(date +%s)

# Test basic cases
echo "a 0 $t" | nc 0.0.0.0 7204
echo "a.bar 0 $t" | nc 0.0.0.0 7204
echo "a.biz 0 $t" | nc 0.0.0.0 7204
echo "a.biz.cake 0 $t" | nc 0.0.0.0 7204
echo "a.bar.caw.daz 0 $t" | nc 0.0.0.0 7204
echo "a.bag 0 $t" | nc 0.0.0.0 7204
echo "c:bar.c:baz 0 $t" | nc 0.0.0.0 7204

# Test rewrite multiple dots
echo "d..bar.baz 0 $t" | nc 0.0.0.0 7204
echo "e.bar...baz 0 $t" | nc 0.0.0.0 7204

# Test rewrite leading or trailing dots
echo "..f.bar.baz 0 $t" | nc 0.0.0.0 7204
echo "g.bar.baz.. 0 $t" | nc 0.0.0.0 7204

# Test rewrite bad chars
echo "h.bar@@baz 0 $t" | nc 0.0.0.0 7204
echo "i.bar!!baz 0 $t" | nc 0.0.0.0 7204

ATTEMPTS=10 TIMEOUT=1 retry_with_backoff find_carbon a* a.json
ATTEMPTS=2 TIMEOUT=1 retry_with_backoff find_carbon a.b* a.b.json
ATTEMPTS=2 TIMEOUT=1 retry_with_backoff find_carbon a.ba[rg] a.ba.json
Expand All @@ -102,3 +117,9 @@ ATTEMPTS=2 TIMEOUT=1 retry_with_backoff find_carbon a.d none.json
ATTEMPTS=2 TIMEOUT=1 retry_with_backoff find_carbon *.*.*.*.* none.json
ATTEMPTS=2 TIMEOUT=1 retry_with_backoff find_carbon c:* cbar.json
ATTEMPTS=2 TIMEOUT=1 retry_with_backoff find_carbon c:bar.* cbaz.json
ATTEMPTS=2 TIMEOUT=1 retry_with_backoff find_carbon d.bar.* dbaz.json
ATTEMPTS=2 TIMEOUT=1 retry_with_backoff find_carbon e.bar.* ebaz.json
ATTEMPTS=2 TIMEOUT=1 retry_with_backoff find_carbon f.bar.* fbaz.json
ATTEMPTS=2 TIMEOUT=1 retry_with_backoff find_carbon g.bar.* gbaz.json
ATTEMPTS=2 TIMEOUT=1 retry_with_backoff find_carbon h.bar* hbarbaz.json
ATTEMPTS=2 TIMEOUT=1 retry_with_backoff find_carbon i.bar* ibarbaz.json

0 comments on commit bbdc2e5

Please sign in to comment.