diff --git a/taskcluster/tc-asserts.sh b/taskcluster/tc-asserts.sh index a56a4c49..38d9a288 100755 --- a/taskcluster/tc-asserts.sh +++ b/taskcluster/tc-asserts.sh @@ -42,10 +42,14 @@ assert_correct_inference() else echo "!! Non matching output !!" echo "got: <${phrase}>" - echo "xxd:"; echo "${phrase}" | xxd + if [ -x "$(command -v xxd)" ]; then + echo "xxd:"; echo "${phrase}" | xxd + fi echo "-------------------" echo "expected: <${expected}>" - echo "xxd:"; echo "${expected}" | xxd + if [ -x "$(command -v xxd)" ]; then + echo "xxd:"; echo "${expected}" | xxd + fi return 1 fi; } @@ -89,10 +93,14 @@ assert_working_inference() *) echo "!! Non matching output !!" echo "got: <${phrase}>" - echo "xxd:"; echo "${phrase}" | xxd + if [ -x "$(command -v xxd)" ]; then + echo "xxd:"; echo "${phrase}" | xxd + fi echo "-------------------" echo "expected: <${expected}>" - echo "xxd:"; echo "${expected}" | xxd + if [ -x "$(command -v xxd)" ]; then + echo "xxd:"; echo "${expected}" | xxd + fi return 1 ;; esac @@ -125,10 +133,14 @@ assert_shows_something() *) echo "!! Non matching output !!" echo "got: <${stderr}>" - echo "xxd:"; echo "${stderr}" | xxd + if [ -x "$(command -v xxd)" ]; then + echo "xxd:"; echo "${stderr}" | xxd + fi echo "-------------------" echo "expected: <${expected}>" - echo "xxd:"; echo "${expected}" | xxd + if [ -x "$(command -v xxd)" ]; then + echo "xxd:"; echo "${expected}" | xxd + fi return 1 ;; esac @@ -150,10 +162,14 @@ assert_not_present() *${not_expected}*) echo "!! Not expected was present !!" echo "got: <${stderr}>" - echo "xxd:"; echo "${stderr}" | xxd + if [ -x "$(command -v xxd)" ]; then + echo "xxd:"; echo "${stderr}" | xxd + fi echo "-------------------" echo "not_expected: <${not_expected}>" - echo "xxd:"; echo "${not_expected}" | xxd + if [ -x "$(command -v xxd)" ]; then + echo "xxd:"; echo "${not_expected}" | xxd + fi return 1 ;; @@ -543,3 +559,20 @@ run_js_streaming_prod_inference_tests() set -e assert_correct_ldc93s1_prodmodel "${phrase_pbmodel_withlm}" "$status" "${_bitrate}" } + +run_js_streaming_prodtflite_inference_tests() +{ + local _bitrate=$1 + set +e + phrase_pbmodel_withlm=$(deepspeech --model ${TASKCLUSTER_TMP_DIR}/${model_name_mmap} --scorer ${TASKCLUSTER_TMP_DIR}/kenlm.scorer --audio ${TASKCLUSTER_TMP_DIR}/${ldc93s1_sample_filename} --stream 2>${TASKCLUSTER_TMP_DIR}/stderr | tail -n 1) + status=$? + set -e + assert_correct_ldc93s1_prodtflitemodel "${phrase_pbmodel_withlm}" "$status" "${_bitrate}" + + local _bitrate=$1 + set +e + phrase_pbmodel_withlm=$(deepspeech --model ${TASKCLUSTER_TMP_DIR}/${model_name_mmap} --scorer ${TASKCLUSTER_TMP_DIR}/kenlm.scorer --audio ${TASKCLUSTER_TMP_DIR}/${ldc93s1_sample_filename} --stream --extended 2>${TASKCLUSTER_TMP_DIR}/stderr | tail -n 1) + status=$? + set -e + assert_correct_ldc93s1_prodtflitemodel "${phrase_pbmodel_withlm}" "$status" "${_bitrate}" +} diff --git a/taskcluster/tc-node_tflite-tests-prod.sh b/taskcluster/tc-node_tflite-tests-prod.sh index 0e5f4e9a..f1cf01d9 100644 --- a/taskcluster/tc-node_tflite-tests-prod.sh +++ b/taskcluster/tc-node_tflite-tests-prod.sh @@ -36,3 +36,5 @@ npm install --prefix ${NODE_ROOT} --cache ${NODE_CACHE} ${deepspeech_npm_url} check_runtime_nodejs run_prodtflite_inference_tests "${bitrate}" + +run_js_streaming_prodtflite_inference_tests "${bitrate}" diff --git a/taskcluster/tc-node_tflite-tests.sh b/taskcluster/tc-node_tflite-tests.sh index 45907c11..525d881f 100644 --- a/taskcluster/tc-node_tflite-tests.sh +++ b/taskcluster/tc-node_tflite-tests.sh @@ -34,3 +34,5 @@ npm install --prefix ${NODE_ROOT} --cache ${NODE_CACHE} ${deepspeech_npm_url} check_runtime_nodejs run_all_inference_tests + +run_js_streaming_inference_tests