mirror of
https://github.com/kvz/bash3boilerplate.git
synced 2025-05-29 04:44:11 +00:00
Add debug test scenario
This commit is contained in:
parent
ecd6a9f04b
commit
30cfd19fd9
1
test/fixture/debug.exitcode
Normal file
1
test/fixture/debug.exitcode
Normal file
@ -0,0 +1 @@
|
||||
1
|
12
test/fixture/debug.stdio
Normal file
12
test/fixture/debug.stdio
Normal file
@ -0,0 +1,12 @@
|
||||
B3BP:STDIO_REPLACE_DATETIMES
|
||||
{datetime} UTC [32m[ debug][0m cli arg arg_f = () -> {tmpdir}/x
|
||||
{datetime} UTC [32m[ info][0m You are on {os}
|
||||
{datetime} UTC [32m[ debug][0m Info useful to developers for debugging the application, not useful during operations.
|
||||
{datetime} UTC [32m[ info][0m Normal operational messages - may be harvested for reporting, measuring throughput, etc. - no action required.
|
||||
{datetime} UTC [32m[ notice][0m Events that are unusual but not error conditions - might be summarized in an email to developers or admins to spot potential problems - no immediate action required.
|
||||
{datetime} UTC [31m[ warning][0m Warning messages, not an error, but indication that an error will occur if action is not taken, e.g. file system 85% full - each item must be resolved within a given time. This is a debug message
|
||||
{datetime} UTC [31m[ error][0m Non-urgent failures, these should be relayed to developers or admins; each item must be resolved within a given time.
|
||||
{datetime} UTC [31m[ critical][0m Should be corrected immediately, but indicates failure in a primary system, an example is a loss of a backup ISP connection.
|
||||
{datetime} UTC [31m[ alert][0m Should be corrected immediately, therefore notify staff who can fix the problem. An example would be the loss of a primary ISP connection.
|
||||
{datetime} UTC [31m[emergency][0m A "panic" condition usually affecting multiple apps/servers/sites. At this level it would usually notify all tech staff on call.
|
||||
{datetime} UTC [32m[ info][0m Cleaning up. Done
|
15
test/scenario/debug/run.sh
Normal file
15
test/scenario/debug/run.sh
Normal file
@ -0,0 +1,15 @@
|
||||
#!/usr/bin/env bash
|
||||
set -o pipefail
|
||||
set -o errexit
|
||||
set -o nounset
|
||||
# set -o xtrace
|
||||
|
||||
# Set magic variables for current FILE & DIR
|
||||
__dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
__file="${__dir}/$(basename "${BASH_SOURCE[0]}")"
|
||||
__base="$(basename ${__file} .sh)"
|
||||
__root="$(cd "$(dirname $(dirname $(dirname "${__dir}")))" && pwd)"
|
||||
|
||||
echo "B3BP:STDIO_REPLACE_DATETIMES"
|
||||
|
||||
env LOG_LEVEL=8 bash "${__root}/main.sh" -f /tmp/x
|
Loading…
x
Reference in New Issue
Block a user