Skip to content

Commit 61baee1

Browse files
committed
Modify URM Test Runner
- Add support to delete any stale lock files created in previous runs - Remove log-based result mapping (parse_and_score_log) and solely rely on the return code (0 or 1). The URM Test Runner already handles the return code, which the script can rely on. Judging pass / fail based on the logs results in some false positives. - Modify test skip logic, a suite should only be skipped if it is not in the approved list, of if the required configs are not found, or if the test executable itself is absent (or is not marked executable). Skipping of one or more tests part of the testsuite, should not result in an overall SKIP qualification, it should be either PASS OR FAIL. Signed-off-by: Kartik Nema <kartnema@qti.qualcomm.com>
1 parent eaed3e2 commit 61baee1

1 file changed

Lines changed: 10 additions & 22 deletions

File tree

  • Runner/suites/Performance/userspace-resource-manager

Runner/suites/Performance/userspace-resource-manager/run.sh

Lines changed: 10 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,17 @@ RES_FILE="./${TESTNAME}.res"
4545

4646
# ---------- Lock (avoid concurrent runs on same host) ----------
4747
LOCKFILE="/tmp/${TESTNAME}.lock"
48+
# Delete stale lock file, if it exists
49+
# rm "${LOCKFILE}"
50+
4851
if command -v flock >/dev/null 2>&1; then
4952
exec 9>"$LOCKFILE"
5053
if ! flock -n 9; then
5154
log_warn "Another ${TESTNAME} run is active; skipping"
5255
echo "$TESTNAME SKIP" >"$RES_FILE"
5356
exit 0
5457
fi
58+
trap 'exec 9>&-' EXIT INT TERM
5559
else
5660
if ! mkdir "$LOCKFILE" 2>/dev/null; then
5761
log_warn "Another ${TESTNAME} run is active; skipping"
@@ -147,16 +151,6 @@ suite_requires_base_cfgs() {
147151
done
148152
return 1
149153
}
150-
parse_and_score_log() {
151-
logf="$1"
152-
if grep -Eiq '(^|[^a-z])fail(ed)?([^a-z]|$)|Assertion failed|Terminating Suite|Segmentation fault|Backtrace' "$logf"; then
153-
return 1
154-
fi
155-
if grep -Eiq 'Run Successful|executed successfully|Ran Successfully' "$logf"; then
156-
return 0
157-
fi
158-
return 2
159-
}
160154
per_suite_timeout() {
161155
case "$1" in
162156
UrmComponentTests)
@@ -398,13 +392,7 @@ run_one() {
398392
run_cmd_maybe_timeout "$bin" >"$tlog" 2>&1
399393
rc=$?
400394

401-
parse_and_score_log "$tlog"
402-
score=$?
403-
if [ $score -eq 2 ] && [ $rc -eq 0 ]; then
404-
score=0
405-
fi
406-
407-
case $score in
395+
case $rc in
408396
0)
409397
log_pass "[TEST] $name PASS"
410398
echo "PASS" >"$tres"
@@ -417,11 +405,11 @@ run_one() {
417405
echo "[FAIL] $name (rc=$rc)" >>"$LOGDIR/summary.txt"
418406
return 1
419407
;;
420-
2)
421-
log_skip "[TEST] $name SKIP"
422-
echo "SKIP" >"$tres"
423-
echo "[SKIP] $name (rc=$rc)" >>"$LOGDIR/summary.txt"
424-
return 2
408+
*)
409+
log_fail "[TEST] $name UNKNOWN RC=$rc"
410+
echo "FAIL" >"$tres"
411+
echo "[FAIL] $name (unexpected rc=$rc)" >>"$LOGDIR/summary.txt"
412+
return 1
425413
;;
426414
esac
427415
}

0 commit comments

Comments
 (0)