Skip to content

Commit 3951302

Browse files
committed
send-to-lava: add support for publishing log files
For each test, send-to-lava will look into a results directory for files named ${test}.log. If that file is found, then its contents will be pushed to lava as the log snippet corresponding to that test. The result directory can be passed as the second command line argument. If omitted, the same directory as the results file will be used. Signed-off-by: Antonio Terceiro <antonio.terceiro@linaro.org>
1 parent a131279 commit 3951302

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

automated/utils/send-to-lava.sh

+16
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,20 @@
11
#!/bin/sh
22

33
RESULT_FILE="$1"
4+
RESULT_DIR="$2"
5+
if [ -z "${RESULT_DIR}" ]; then
6+
RESULT_DIR="$(dirname "${RESULT_FILE}")"
7+
fi
8+
9+
show_output() {
10+
test_name="$1"
11+
test_output="${RESULT_DIR}/${test_name}.log"
12+
if [ -r "$test_output" ]; then
13+
echo "<LAVA_SIGNAL_STARTTC $test_name>"
14+
cat "$test_output"
15+
echo "<LAVA_SIGNAL_ENDTC $test_name>"
16+
fi
17+
}
418

519
command -v lava-test-case > /dev/null 2>&1
620
lava_test_case="$?"
@@ -13,6 +27,7 @@ if [ -f "${RESULT_FILE}" ]; then
1327
test="${line%% *}"
1428
result="${line##* }"
1529

30+
show_output "${test}"
1631
if [ "${lava_test_case}" -eq 0 ]; then
1732
lava-test-case "${test}" --result "${result}"
1833
else
@@ -24,6 +39,7 @@ if [ -f "${RESULT_FILE}" ]; then
2439
measurement="$(echo "${line}" | awk '{print $3}')"
2540
units="$(echo "${line}" | awk '{print $4}')"
2641

42+
show_output "${test}"
2743
if [ "${lava_test_case}" -eq 0 ]; then
2844
if [ -n "${units}" ]; then
2945
lava-test-case "${test}" --result "${result}" --measurement "${measurement}" --units "${units}"

0 commit comments

Comments
 (0)