@feigi/fleet-ctl 3.30.27 → 3.30.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/scripts/derive-testcmd.sh +65 -38
package/package.json
CHANGED
|
@@ -368,11 +368,17 @@ esac
|
|
|
368
368
|
# `tests 0` and exits 0. The suite moved and the Recipe did not, so it is
|
|
369
369
|
# stale, refused like a binary that is gone. Tracked, not present on disk: a
|
|
370
370
|
# fresh worktree holds only what is tracked. Only a word the shell globs as
|
|
371
|
-
# written, from <repo>, can be settled without running the command
|
|
372
|
-
# carrying quoting or an expansion
|
|
373
|
-
#
|
|
374
|
-
# and
|
|
375
|
-
#
|
|
371
|
+
# written, from <repo>, can be settled without running the command. A word
|
|
372
|
+
# carrying quoting or an expansion is accepted unprobed, whole, since an
|
|
373
|
+
# operator in it may be quoted; any other word is split at each `;`, `&`, `|`,
|
|
374
|
+
# `(` and `)`, operators to the shell whether or not whitespace surrounds
|
|
375
|
+
# them, and each piece is judged as a word of its own. An option, an `=`
|
|
376
|
+
# assignment or value, a path outside <repo>, or the target of a `<` or `>`
|
|
377
|
+
# redirection is the program's own to read, or selects no test, and is
|
|
378
|
+
# accepted unprobed too. The scan stops at a `cd` or `pushd`, past which a
|
|
379
|
+
# pattern no longer resolves from <repo>, and at a word that is not split but
|
|
380
|
+
# ends in an operator then `cd` or `pushd`. A word right after an option
|
|
381
|
+
# written without `=`, with no operator between them, is accepted unless it
|
|
376
382
|
# has a `/` or a `.`: it may be that option's value, which names no path. A
|
|
377
383
|
# pattern under a path git ignores names generated output, such as a build
|
|
378
384
|
# the Install step produces, which is never tracked, so it is accepted too,
|
|
@@ -422,44 +428,65 @@ if [ "$field" = test ]; then
|
|
|
422
428
|
prev=
|
|
423
429
|
# shellcheck disable=SC2086 # field splitting is the point: scanning every word
|
|
424
430
|
for word in $value; do
|
|
425
|
-
before=$prev
|
|
426
|
-
prev=$word
|
|
427
431
|
case $word in
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
esac
|
|
433
|
-
case $before in
|
|
434
|
-
-*=*) ;;
|
|
435
|
-
-*) case $word in */*|*.*) ;; *) continue ;; esac ;;
|
|
432
|
+
*[\'\"\\\$\`\{\}\~]*)
|
|
433
|
+
case $word in *[\(\;\&\|]cd|*[\(\;\&\|]pushd) break ;; esac
|
|
434
|
+
prev=$word
|
|
435
|
+
continue ;;
|
|
436
436
|
esac
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
tracked=$(git -C "$repo" ls-files -- ":(glob)$word" ":(glob)${word%/}/**" 2>"$errf") || {
|
|
441
|
-
listed=$?
|
|
442
|
-
die "cannot list the files tracked in $where to check its test command's pattern '$word' (git ls-files exit $listed): $(cat "$errf" 2>/dev/null)"
|
|
443
|
-
}
|
|
444
|
-
[ -z "$tracked" ] || continue
|
|
445
|
-
lead=${word%%[*?[]*}
|
|
437
|
+
before=$prev
|
|
438
|
+
rest=$word
|
|
439
|
+
first=1
|
|
446
440
|
while :; do
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
441
|
+
if [ -z "$first" ]; then
|
|
442
|
+
case $rest in
|
|
443
|
+
*[\;\&\|\(\)]*) rest=${rest#*[\;\&\|\(\)]} ;;
|
|
444
|
+
*) break ;;
|
|
445
|
+
esac
|
|
446
|
+
before=
|
|
447
|
+
fi
|
|
448
|
+
first=
|
|
449
|
+
piece=${rest%%[\;\&\|\(\)]*}
|
|
450
|
+
follows=$prev
|
|
451
|
+
prev=$piece
|
|
452
|
+
case $follows in *[\<\>]) continue ;; esac
|
|
453
|
+
case $piece in
|
|
454
|
+
cd|pushd) break 2 ;;
|
|
455
|
+
-*|*=*|/*|*..*|*[\<\>]*) continue ;;
|
|
456
|
+
*'*'*|*'?'*|*'['*']'*) ;;
|
|
457
|
+
*) continue ;;
|
|
458
|
+
esac
|
|
459
|
+
case $before in
|
|
460
|
+
-*=*) ;;
|
|
461
|
+
-*) case $piece in */*|*.*) ;; *) continue ;; esac ;;
|
|
462
|
+
esac
|
|
463
|
+
# The second pathspec is the directories the piece matches: the shell
|
|
464
|
+
# hands `tests/*` the directory `tests/unit`, which ls-files lists only as
|
|
465
|
+
# the prefix of the files beneath it.
|
|
466
|
+
tracked=$(git -C "$repo" ls-files -- ":(glob)$piece" ":(glob)${piece%/}/**" 2>"$errf") || {
|
|
467
|
+
listed=$?
|
|
468
|
+
die "cannot list the files tracked in $where to check its test command's pattern '$piece' (git ls-files exit $listed): $(cat "$errf" 2>/dev/null)"
|
|
469
|
+
}
|
|
470
|
+
[ -z "$tracked" ] || continue
|
|
471
|
+
lead=${piece%%[*?[]*}
|
|
472
|
+
while :; do
|
|
473
|
+
case $lead in */*) lead=${lead%/*} ;; *) break ;; esac
|
|
474
|
+
opq=0
|
|
475
|
+
opaque "$lead" || opq=$?
|
|
476
|
+
case $opq in
|
|
477
|
+
0) continue 2 ;;
|
|
478
|
+
1) ;;
|
|
479
|
+
*) die "cannot ask git whether '$lead' is a symlink or a submodule in $where, to check its test command's pattern '$piece' (git ls-files exit $listed): $(cat "$errf" 2>/dev/null)" ;;
|
|
480
|
+
esac
|
|
481
|
+
done
|
|
482
|
+
ignored=0
|
|
483
|
+
git -C "$repo" check-ignore -q --no-index -- "$piece" 2>"$errf" || ignored=$?
|
|
484
|
+
case $ignored in
|
|
485
|
+
0) ;;
|
|
486
|
+
1) die "the Recipe cache at $cache is invalid: its test command's pattern '$piece' matches no file tracked in $where — a Test entrypoint that selects no tests passes having run nothing, so the Recipe is stale, not a finding; $derive" ;;
|
|
487
|
+
*) die "cannot ask git whether $repo ignores its test command's pattern '$piece' (git check-ignore exit $ignored): $(cat "$errf" 2>/dev/null)" ;;
|
|
454
488
|
esac
|
|
455
489
|
done
|
|
456
|
-
ignored=0
|
|
457
|
-
git -C "$repo" check-ignore -q --no-index -- "$word" 2>"$errf" || ignored=$?
|
|
458
|
-
case $ignored in
|
|
459
|
-
0) ;;
|
|
460
|
-
1) die "the Recipe cache at $cache is invalid: its test command's pattern '$word' matches no file tracked in $where — a Test entrypoint that selects no tests passes having run nothing, so the Recipe is stale, not a finding; $derive" ;;
|
|
461
|
-
*) die "cannot ask git whether $repo ignores its test command's pattern '$word' (git check-ignore exit $ignored): $(cat "$errf" 2>/dev/null)" ;;
|
|
462
|
-
esac
|
|
463
490
|
done
|
|
464
491
|
set +f
|
|
465
492
|
fi
|