Prechádzať zdrojové kódy

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

mmetc 2 rokov pred
rodič
commit
c49c1cbf2a
2 zmenil súbory, kde vykonal 9 pridanie a 5 odobranie
  1. 4 0
      tests/README.md
  2. 5 5
      tests/bats/81_alert_context.bats

+ 4 - 0
tests/README.md

@@ -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

+ 5 - 5
tests/bats/81_alert_context.bats

@@ -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\"]"]]'
-}
+}