diff options
author | Chase Qi <chase.qi@linaro.org> | 2017-05-25 22:24:52 +0800 |
---|---|---|
committer | Milosz Wasilewski <milosz.wasilewski@linaro.org> | 2017-05-26 08:03:32 +0000 |
commit | f2f38cb15c5aa9f2b2e6b8b1942aa42155e56d96 (patch) | |
tree | 8e01ef36b14a3c6cf7180c2bb77f52d76b48b1d3 | |
parent | 3bff06b2ffa93372164cddcc0708f720a9eef4ae (diff) |
automated: utils: use lava-test-case for result saving in LAVA
In LAVA, use lava-test-case for result saving makes the upload helper
script more reliable.
For local run, saving file upload 'fail/skip' result to 'result.txt'
isn't necessary as it is always skipped. And some test cases may
don't use 'result.txt' at all, in these cases, we will need to handle
file creating in the upload helper script which increases complicity.
Change-Id: Ie9ed79b66bab6abc861c2a3da7a3c6fd21b19c88
Signed-off-by: Chase Qi <chase.qi@linaro.org>
-rwxr-xr-x | automated/utils/upload-to-artifactorial.sh | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/automated/utils/upload-to-artifactorial.sh b/automated/utils/upload-to-artifactorial.sh index 72e77bb..1cb7fcb 100755 --- a/automated/utils/upload-to-artifactorial.sh +++ b/automated/utils/upload-to-artifactorial.sh @@ -3,7 +3,6 @@ ATTACHMENT="" ARTIFACTORIAL_URL="" ARTIFACTORIAL_TOKEN="" -RESULT_FILE="$(pwd)/output/result.txt" usage() { echo "Usage: $0 [-a <attachment>] [-u <artifactorial_url>] [-t <artifactorial_token>]" 1>&2 @@ -20,7 +19,8 @@ while getopts ":a:u:t:" opt; do done if [ -z "${ARTIFACTORIAL_URL}" ]; then - echo "test-attachment skip" | tee -a "${RESULT_FILE}" + echo "test-attachment skip" + which lava-test-case && lava-test-case "test-attachment" --result "skip" exit 0 fi @@ -35,7 +35,8 @@ if which lava-test-reference; then if [ -z "${ARTIFACTORIAL_TOKEN}" ]; then echo "WARNING: ARTIFACTORIAL_TOKEN is empty! File uploading skipped." - echo "test-attachment skip" | tee -a "${RESULT_FILE}" + echo "test-attachment skip" + which lava-test-case && lava-test-case "test-attachment" --result "skip" exit 0 else return=$(curl -F "path=@${ATTACHMENT}" -F "token=${ARTIFACTORIAL_TOKEN}" "${ARTIFACTORIAL_URL}") @@ -44,8 +45,10 @@ if which lava-test-reference; then if echo "${return}" | grep "$(basename "${ATTACHMENT}")"; then lava-test-reference "test-attachment" --result "pass" --reference "https://archive.validation.linaro.org/artifacts/${return}" else - echo "test-attachment fail" | tee -a "${RESULT_FILE}" + echo "test-attachment fail" + which lava-test-case && lava-test-case "test-attachment" --result "fail" fi else - echo "test-attachment skip" | tee -a "${RESULT_FILE}" + echo "test-attachment skip" + which lava-test-case && lava-test-case "test-attachment" --result "skip" fi |