fix alert context CI when feature flags are enabled (#1979)

This commit is contained in:
mmetc 2023-01-09 16:18:06 +01:00 committed by GitHub
parent 7284c0a47a
commit c49c1cbf2a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 5 deletions

View file

@ -296,6 +296,10 @@ can have separated `$output` and `$stderr` variables.
The above is better explained in the bats-core tutorial. If you have not read it
yet, now is a good time.
For convenience, the `rune` function is an alias for `run --separate-stderr`, which
can be used in most cases. For example, you don't want extraneous log messages in
the way when you check the output of a command.
The `$output` variable gets special treatment with the
[bats-support](https://github.com/bats-core/bats-support) and
[bats-assert][https://github.com/bats-core/bats-assert) plugins and can be

View file

@ -57,11 +57,11 @@ teardown() {
sleep 2
rm -f -- "${tmpfile}"
run -0 cscli alerts list -o json
run -0 jq '.[0].id' <(output)
rune -0 cscli alerts list -o json
rune -0 jq '.[0].id' <(output)
ALERT_ID="$output"
run -0 cscli alerts inspect "$ALERT_ID" -o json
run -0 jq -c '.meta | sort_by(.key) | map([.key,.value])' <(output)
rune -0 cscli alerts inspect "$ALERT_ID" -o json
rune -0 jq -c '.meta | sort_by(.key) | map([.key,.value])' <(output)
assert_json '[["source_host","[\"sd-126005\"]"],["source_ip","[\"1.1.1.172\"]"],["target_user","[\"netflix\"]"]]'
}
}