1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-24 22:11:15 +02:00

Merge pull request #13251 from Mic92/json-log-path

Add `json-log-path` setting (revisted)
This commit is contained in:
Jörg Thalheim 2025-05-23 11:25:40 +02:00 committed by GitHub
commit 4cc312a6e1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 217 additions and 8 deletions

View file

@ -33,3 +33,12 @@ if isDaemonNewer "2.26"; then
# Build works despite ill-formed structured build log entries.
expectStderr 0 nix build -f ./logging/unusual-logging.nix --no-link | grepQuiet 'warning: Unable to handle a JSON message from the derivation builder:'
fi
# Test json-log-path.
if [[ "$NIX_REMOTE" != "daemon" ]]; then
clearStore
nix build -vv --file dependencies.nix --no-link --json-log-path "$TEST_ROOT/log.json" 2>&1 | grepQuiet 'building.*dependencies-top.drv'
jq < "$TEST_ROOT/log.json"
grep '{"action":"start","fields":\[".*-dependencies-top.drv","",1,1\],"id":.*,"level":3,"parent":0' "$TEST_ROOT/log.json" >&2
(( $(grep '{"action":"msg","level":5,"msg":"executing builder .*"}' "$TEST_ROOT/log.json" | wc -l) == 5 ))
fi