-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #898 from cloudflare/rule/duplicate
Fix missing rule path check
- Loading branch information
Showing
4 changed files
with
95 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
http response prometheus /*/api/v1/metadata 200 {"status":"success","data":{}} | ||
http response prometheus /*/api/v1/status/config 200 {"status":"success","data":{"yaml":"global:\n scrape_interval: 30s\n"}} | ||
http response prometheus /*/api/v1/status/flags 200 {"status":"success","data":{"storage.tsdb.retention.time": "1d"}} | ||
http response prometheus /*/api/v1/query_range 200 {"status":"success","data":{"resultType":"matrix","result":[]}} | ||
http response prometheus /*/api/v1/query 200 {"status":"success","data":{"resultType":"vector","result":[]}} | ||
http start prometheus 127.0.0.1:7167 | ||
|
||
mkdir testrepo | ||
cd testrepo | ||
exec git init --initial-branch=main . | ||
|
||
cp ../src/v0.yml rules.yml | ||
exec ln -s rules.yml symlink.yml | ||
cp ../src/.pint.hcl . | ||
env GIT_AUTHOR_NAME=pint | ||
env GIT_AUTHOR_EMAIL=pint@example.com | ||
env GIT_COMMITTER_NAME=pint | ||
env GIT_COMMITTER_EMAIL=pint@example.com | ||
exec git add . | ||
exec git commit -am 'import rules and config' | ||
|
||
exec git checkout -b v1 | ||
cp ../src/v1.yml rules.yml | ||
exec git commit -am 'v1' | ||
pint.ok --no-color ci | ||
cmp stderr ../stderrV1.txt | ||
|
||
-- stderrV1.txt -- | ||
level=INFO msg="Loading configuration file" path=.pint.hcl | ||
level=INFO msg="Finding all rules to check on current git branch" base=main | ||
level=INFO msg="Configured new Prometheus server" name=prom1 uris=1 uptime=up tags=[] include=["^rules.yml$"] exclude=[] | ||
level=INFO msg="Configured new Prometheus server" name=prom2 uris=1 uptime=up tags=[] include=["^symlink.yml$"] exclude=[] | ||
-- stderrV2.txt -- | ||
-- src/v0.yml -- | ||
groups: | ||
groups: | ||
- name: g1 | ||
rules: | ||
- alert: DownAlert | ||
expr: up == 0 | ||
annotations: | ||
summary: 'Service is down' | ||
labels: | ||
cluster: dev | ||
- record: up:sum | ||
expr: up == 0 | ||
labels: | ||
cluster: dev | ||
-- src/v1.yml -- | ||
groups: | ||
- name: g1 | ||
rules: | ||
- alert: DownAlert | ||
expr: up == 0 | ||
annotations: | ||
summary: 'Service is down' | ||
labels: | ||
cluster: dev | ||
- record: new:sum | ||
expr: up == 0 | ||
- record: up:sum | ||
expr: up == 0 | ||
labels: | ||
cluster: dev | ||
-- src/.pint.hcl -- | ||
ci { | ||
baseBranch = "main" | ||
} | ||
checks { | ||
disabled = [ | ||
"promql/series", | ||
] | ||
} | ||
prometheus "prom1" { | ||
uri = "http://127.0.0.1:7167/1" | ||
timeout = "5s" | ||
required = true | ||
include = ["rules.yml"] | ||
} | ||
prometheus "prom2" { | ||
uri = "http://127.0.0.1:7167/2" | ||
timeout = "5s" | ||
required = true | ||
include = ["symlink.yml"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
codecov: | ||
token: fa0dae01-b3cf-46b7-b7d2-254e990ac824 | ||
require_ci_to_pass: false | ||
notify: | ||
wait_for_ci: false | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters