Files
steampipe/tests/acceptance/json_patch.sh
kaidaguerre 07782a2b13 Adds support for verbose timing information. Closes #4237. Closes #4244
- JSON output format has changed to move the rows to under a `rows` property, with timing information under the `metadata` property
- Update timing display to show rows returned and rows fetched, as well as adding verbose mode which lists all scans
- Use enums for output mode and timing mode - timing is now either `on`, `off` or `verbose`
- Bugfix: ensure error is returned from ExecuteSystemClientCall. Closes #4246
2024-04-17 10:12:17 +01:00

23 lines
766 B
Bash
Executable File

#!/bin/bash -e
# This script accepts a patch format and evaluates the diffs if any.
patch_file=$1
patch_keys=$(echo $patch_file | jq -r '. | keys[]')
for i in $patch_keys; do
op=$(echo $patch_file | jq -r -c ".[${i}]" | jq -r ".op")
path=$(echo $patch_file | jq -r -c ".[${i}]" | jq -r ".path")
value=$(echo $patch_file | jq -r -c ".[${i}]" | jq -r ".value")
# ignore the diff of paths 'end_time', 'start_time' and 'schema_version',
# print the rest
if [[ $op != "test" ]] && [[ $path != "/end_time" ]] && [[ $path != "/start_time" ]] && [[ $path != "/schema_version" ]] && [[ $path != "/metadata"* ]]; then
if [[ $op == "remove" ]]; then
echo "key: $path"
echo "expected: $value"
else
echo "actual: $value"
fi
fi
done