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 #4405 from eval-exec/exec/fix-config-notify
[Breaking Change] Fix default `ckb.toml`'s `[notifier]` to `[notify]`
- Loading branch information
Showing
11 changed files
with
54 additions
and
5 deletions.
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
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
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
49 changes: 49 additions & 0 deletions
49
util/app-config/src/tests/bats_tests/load_notify_config.bats
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,49 @@ | ||
#!/usr/bin/env bats | ||
bats_load_library 'bats-assert' | ||
bats_load_library 'bats-support' | ||
|
||
|
||
_init() { | ||
bash -c "ckb init -C ${CKB_DIRNAME} -f " | ||
} | ||
|
||
_uncomment_notify_config() { | ||
sed -i 's/# \[notify\]/\[notify\]/g' ${CKB_DIRNAME}/ckb.toml | ||
} | ||
|
||
|
||
_run() { | ||
ckb run -C ${CKB_DIRNAME} &> ${TMP_DIR}/ckb_notify.log & | ||
PID=$! | ||
sleep 3 | ||
kill ${PID} | ||
|
||
while kill -0 ${PID}; do | ||
sleep 1 | ||
done | ||
|
||
grep -q "CKB shutdown" ${TMP_DIR}/ckb_notify.log | ||
} | ||
|
||
_log_no_error() { | ||
if grep -q -i error ${TMP_DIR}/ckb_notify.log; then | ||
echo "error found in log" | ||
return 1 | ||
fi | ||
} | ||
|
||
function run_with_uncomment_notify_config { #@test | ||
run _init | ||
[ "$status" -eq 0 ] | ||
|
||
run _uncomment_notify_config | ||
[ "$status" -eq 0 ] | ||
|
||
run _run | ||
[ "$status" -eq 0 ] | ||
|
||
run _log_no_error | ||
[ "$status" -eq 0 ] | ||
|
||
cat ${TMP_DIR}/ckb_notify.log | ||
} |
File renamed without changes.