Repository navigation
fastrpc: Support a per-invocation result name - #634
Anil (qcom-anilyada) wants to merge 1 commit into
Conversation
| RES_FILE="$SCRIPT_DIR/${TESTNAME}${RES_SUFFIX:+_${RES_SUFFIX}}.res" | ||
| RESULT_FILE="$RES_FILE" | ||
| test_result_init "$TESTNAME" "$RESULT_FILE" | ||
| test_result_init "$RESULT_TESTNAME" "$RESULT_FILE" |
There was a problem hiding this comment.
Validate the result ID and suffix before calling test_result_init. An empty ID loses the reported testcase, a newline in the ID can emit an extra result, and a suffix such as missing/variant leaves no result file while the script exits zero. Add shared validation in functestlib.sh that rejects invalid names rather than silently sanitizing them, and check the return from test_result_init before continuing.
| TESTNAME="fastrpc_test" | ||
| RES_FILE="$SCRIPT_DIR/${TESTNAME}.res" | ||
| RESULT_TESTNAME="$TESTNAME" | ||
| RES_SUFFIX="" # Optional suffix for unique result files (e.g., "adsp") |
There was a problem hiding this comment.
The agreed --res-suffix behavior in #626 also separates per-execution logs, but this currently changes only the .res filename. Logs still use logs_fastrpc_test_<timestamp>, so invocations started within the same second in one checkout can share artifacts despite different suffixes. Please include the suffix in artifact paths and use a unique run directory, or explicitly defer this part of #626. audio_create_run_directory() in audio_common.sh already provides unique retained directories and could be moved into a common helper for reuse.
There was a problem hiding this comment.
The new LOG_ROOT separates the workload artifacts, but init_env starts stdout capture before these options are parsed. Two runs started in the same second still append to the same fastrpc_test_stdout_.log, mixing their output even with different suffixes. Set a unique RUN_STDOUT_FILE before the first init_env source, or enhance its existing capture setup to allocate a separate stdout file per invocation.
There was a problem hiding this comment.
this is resolved now, now only condition where the two runs can still share a file name would be, if they have same suffix which is not expected, other cases are handled regarding file name collision, please have a look
| REPEAT: 1 # Number of repetitions (default: 1) | ||
| TIMEOUT: 120 # Required positive timeout for each fastrpc_test invocation | ||
| HEALTHCHECK_TIMEOUT: 15 # Required positive timeout for fastrpc-healthcheck | ||
| RES_SUFFIX: "" # Suffix for a unique result file (e.g., "adsp" generates fastrpc_test_adsp.res), default: unset |
There was a problem hiding this comment.
Please update fastrpc_test_README.md with examples for these options, the accepted name characters, the result filename to publish, and the matching LAVA expected ID. Explain that RES_SUFFIX changes the filename while LAVA_TESTCASE_ID changes the reported ID, so setting only the suffix does not give LAVA a unique testcase ID.
There was a problem hiding this comment.
The new README says an empty suffix is rejected, but the runner accepts it and the YAML defaults RES_SUFFIX to an empty string. Please document that the suffix is optional and may be empty, while LAVA_TESTCASE_ID must be nonempty.
There was a problem hiding this comment.
updated
1cde542 to
1fc271d
Compare
| - ./run.sh --arch "${ARCH}" --bin-dir "${BIN_DIR}" --domain-mode "${DOMAIN_MODE}" --domain "${DOMAIN}" --domain-name "${DOMAIN_NAME}" --pd-mode "${PD_MODE}" --repeat "${REPEAT}" --timeout "${TIMEOUT}" --healthcheck-timeout "${HEALTHCHECK_TIMEOUT}" $UNSIGNED_PD_PARAM || true | ||
| - $REPO_PATH/Runner/utils/send-to-lava.sh fastrpc_test.res || true | ||
| - ./run.sh --arch "${ARCH}" --bin-dir "${BIN_DIR}" --domain-mode "${DOMAIN_MODE}" --domain "${DOMAIN}" --domain-name "${DOMAIN_NAME}" --pd-mode "${PD_MODE}" --repeat "${REPEAT}" --timeout "${TIMEOUT}" --healthcheck-timeout "${HEALTHCHECK_TIMEOUT}" --res-suffix "${RES_SUFFIX}" --lava-testcase-id "${LAVA_TESTCASE_ID}" $UNSIGNED_PD_PARAM || true | ||
| - $REPO_PATH/Runner/utils/send-to-lava.sh fastrpc_test${RES_SUFFIX:+_${RES_SUFFIX}}.res || true |
There was a problem hiding this comment.
If fastrpc_test.res contains an earlier PASS, running with an invalid --lava-testcase-id exits before test_result_init removes that file. The preceding step ignores the nonzero exit and this step publishes the old PASS. Gate send-to-lava.sh on successful completion of this invocation instead of using an unconditional publisher. test_result_finish already returns zero for current FAIL and SKIP results, so those can still be published.
There was a problem hiding this comment.
updated
Accept --res-suffix and --lava-testcase-id so one invocation does not overwrite the result, evidence or reported name of another. Both default to the current behaviour, and the suffix may be empty. Without this, a plan that runs the test once per DSP domain reports every run as fastrpc_test and a consumer keyed on that name keeps only the last. Reject an invalid testcase id or suffix instead of sanitizing it, and name the evidence directory and the stdout capture after the suffix so separate invocations keep separate artifacts. Publish only when the runner wrote its own result, otherwise a rejected invocation would republish the previous run's result. Signed-off-by: Anil Yadav <anilyada@qti.qualcomm.com>
1fc271d to
f6168bb
Compare
| test_result_finish "FAIL" "$TESTNAME FAIL - cannot create log directory below: $LOG_BASE" | ||
| fi | ||
|
|
||
| log_info "Evidence directory: $test_path/$LOG_ROOT" |
There was a problem hiding this comment.
test_create_run_directory() returns an absolute path, so prefixing it with $test_path/ prints a duplicated path that does not exist. Log $LOG_ROOT directly so users can locate the saved evidence.
Accept
--res-suffixand--lava-testcase-idso one invocation does not overwrite the result file of another and so the reported testcase id can name what was tested. Both default to the current behaviour.A plan that runs this test once per DSP domain otherwise reports every run as
fastrpc_test, and a consumer keyed on the testcase name keeps only the result written last.Passed job: https://lava.infra.foundries.io/scheduler/job/519341
Signed-off-by: Anil Yadav anilyada@qti.qualcomm.com