better jq filter

This commit is contained in:
tristan 2024-01-03 11:17:47 +00:00
parent 2df95bbc56
commit a60eba976f
2 changed files with 16 additions and 15 deletions

View file

@ -8,12 +8,13 @@
inotify-tools = "inotify-tools";
};
watch = import ../tix/watch.nix mockpkgs;
in
describe "watch" [
in [
(describe "watch" [
(it "contains the command" {
actual = builtins.match ".*(run me).*" (watch {
cmd = "run me";
});
expected = ["run me"];
})
]
])
]

View file

@ -1,17 +1,17 @@
let
emotes = import ./emotes.nix;
in {
overview = ''
.[] | {
(.path):
.results[] | {
(.component): {
"${emotes.fail}": [
.results | map(select(.success==false))[] | {(.msg): {actual, expected}}
],
"${emotes.pass}": .results | map(select(.success) | .msg) | length
}
in rec {
failures = ''
[. | map(select(.results[].results[].success == false))[]
| {
(.path): .results | map(select(.results[].success == false))[]
| {
(.component): .results | map(select(.success == false))[]
| {
(.msg): {success, expected, actual}
}
}
}
}] | add
'';
overview = failures;
}