From 3f0977c10b11270c23ec2893597e28b6ed71acb2 Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Wed, 4 Jan 2023 15:52:24 +0100 Subject: [PATCH 1/4] Modified ivas_voip_be_test.sh to fit coverage job and added it there. Remove tabs in smoke_test.sh --- .gitlab-ci.yml | 1 + ci/ivas_voip_be_test.sh | 49 ++++++++++++++++++++++++++++++++++++----- ci/smoke_test.sh | 16 +++++++------- 3 files changed, 52 insertions(+), 14 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 7ba0eecec4..9ee8356f34 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -935,6 +935,7 @@ coverage-test-on-main-scheduled: - python3 -m pytest tests/test_param_file.py -v -n 0 --update_ref 1 -m create_ref --param_file scripts/config/self_test_evs.prm --ref_encoder_path ./IVAS_cod --ref_decoder_path ./IVAS_dec - bash ci/smoke_test.sh coverage - python3 -m pytest -q -n auto tests/renderer/test_renderer_be_comparison.py + - bash ci/ivas_voip_be_test.sh coverage - lcov -c -d obj -o coverage.info - genhtml coverage.info -o coverage artifacts: diff --git a/ci/ivas_voip_be_test.sh b/ci/ivas_voip_be_test.sh index d65677b498..f031ef427e 100755 --- a/ci/ivas_voip_be_test.sh +++ b/ci/ivas_voip_be_test.sh @@ -28,6 +28,41 @@ # accordance with the laws of the Federal Republic of Germany excluding its conflict of law rules and # the United Nations Convention on Contracts on the International Sales of Goods. +function usage { + echo + echo "Usage:" + echo " ivas_voip_be_test.sh [MODE]" + echo + echo " MODE - test (default) or coverage" + exit +} + +if [ ! -d "lib_com" ]; then + echo "not in root directory! - please run in IVAS root" + exit 1 +fi + +if [ -z "$1" ] || [ "$1" == "test" ]; then + WORKERS="" + BUILD=1 + COVERAGE=0 +elif [ "$1" == "coverage" ]; then + WORKERS="-t 1" + BUILD=0 + COVERAGE=1 +else + usage +fi + + +cfg=./scripts/config/ci_linux.json +dly_profile=./scripts/dly_error_profiles/dly_error_profile_10.dat + +if [ $BUILD -eq 1 ];then + make clean + make all -j +fi + # Configuration modes=('SBA_b128_wb_cbr' 'MC_7_1_b96_fb_cbr' 'ISM2_b48_fb_cbr') output_formats=('STEREO' 'FOA' '7_1' 'HOA3') @@ -38,13 +73,15 @@ network_profile_path="scripts/dly_error_profiles/dly_error_profile_0.dat" output_dir_default="out" output_dir_voip="out_voip" -# Build IVAS -make clean -make all -j 8 - # Run the same modes in VoIP and non-VoIP mode with a neutral delay profile -./scripts/runIvasCodec.py -p ./scripts/config/ci_linux.json -U $limit_input_to_x_seconds -m "${modes[@]}" --oc "${output_formats[@]}" -o $output_dir_default | tee voip_be_test_output.txt -./scripts/runIvasCodec.py -p ./scripts/config/ci_linux.json -U $limit_input_to_x_seconds -m "${modes[@]}" --oc "${output_formats[@]}" -o $output_dir_voip -J "$network_profile_path" | tee -a voip_be_test_output.txt +./scripts/runIvasCodec.py -p ./scripts/config/ci_linux.json $WORKERS -U $limit_input_to_x_seconds -m "${modes[@]}" --oc "${output_formats[@]}" -o $output_dir_default | tee voip_be_test_output.txt +./scripts/runIvasCodec.py -p ./scripts/config/ci_linux.json $WORKERS -U $limit_input_to_x_seconds -m "${modes[@]}" --oc "${output_formats[@]}" -o $output_dir_voip -J "$network_profile_path" | tee -a voip_be_test_output.txt + +if [ $COVERAGE -eq 1 ];then + # Coverage analysis requires only running the codec and may exit before the comparison part + exit(0) +fi + # Check if Python scripts above failed. They return status 0 even when running a mode fails, so we have to parse log file if grep -iq failed voip_be_test_output.txt ; then diff --git a/ci/smoke_test.sh b/ci/smoke_test.sh index 0963055acd..b710beab4e 100755 --- a/ci/smoke_test.sh +++ b/ci/smoke_test.sh @@ -32,8 +32,8 @@ function usage { echo echo "Usage:" echo " smoke_test.sh [MODE]" - echo - echo " MODE - test (default) or coverage" + echo + echo " MODE - test (default) or coverage" exit } @@ -44,12 +44,12 @@ fi if [ -z "$1" ] || [ "$1" == "test" ]; then WORKERS="" - BUILD=1 + BUILD=1 elif [ "$1" == "coverage" ]; then - WORKERS="-t 1" - BUILD=0 + WORKERS="-t 1" + BUILD=0 else - usage + usage fi @@ -57,8 +57,8 @@ cfg=./scripts/config/ci_linux.json dly_profile=./scripts/dly_error_profiles/dly_error_profile_10.dat if [ $BUILD -eq 1 ];then - make clean - make all -j 8 + make clean + make all -j fi ./scripts/runIvasCodec.py -p $cfg -U 1 $WORKERS | tee smoke_test_output.txt -- GitLab From 724857cd705fa911dff2f0b02dd179a871390d80 Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Wed, 4 Jan 2023 16:04:40 +0100 Subject: [PATCH 2/4] Bug fix in ci/ivas_voip_be_test.sh for exit argument --- ci/ivas_voip_be_test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/ivas_voip_be_test.sh b/ci/ivas_voip_be_test.sh index f031ef427e..6f9d92f8a6 100755 --- a/ci/ivas_voip_be_test.sh +++ b/ci/ivas_voip_be_test.sh @@ -79,7 +79,7 @@ output_dir_voip="out_voip" if [ $COVERAGE -eq 1 ];then # Coverage analysis requires only running the codec and may exit before the comparison part - exit(0) + exit 0 fi -- GitLab From 5aabba742c98e1350644993324fb08fdc775b9a9 Mon Sep 17 00:00:00 2001 From: Kacper Sagnowski Date: Mon, 9 Jan 2023 11:08:45 +0100 Subject: [PATCH 3/4] Fix unused variables --- ci/ivas_voip_be_test.sh | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/ci/ivas_voip_be_test.sh b/ci/ivas_voip_be_test.sh index 6f9d92f8a6..7964ce1ceb 100755 --- a/ci/ivas_voip_be_test.sh +++ b/ci/ivas_voip_be_test.sh @@ -54,10 +54,6 @@ else usage fi - -cfg=./scripts/config/ci_linux.json -dly_profile=./scripts/dly_error_profiles/dly_error_profile_10.dat - if [ $BUILD -eq 1 ];then make clean make all -j @@ -68,21 +64,21 @@ modes=('SBA_b128_wb_cbr' 'MC_7_1_b96_fb_cbr' 'ISM2_b48_fb_cbr') output_formats=('STEREO' 'FOA' '7_1' 'HOA3') limit_input_to_x_seconds=30 -network_profile_path="scripts/dly_error_profiles/dly_error_profile_0.dat" +cfg=./scripts/config/ci_linux.json +dly_profile=./scripts/dly_error_profiles/dly_error_profile_0.dat output_dir_default="out" output_dir_voip="out_voip" # Run the same modes in VoIP and non-VoIP mode with a neutral delay profile -./scripts/runIvasCodec.py -p ./scripts/config/ci_linux.json $WORKERS -U $limit_input_to_x_seconds -m "${modes[@]}" --oc "${output_formats[@]}" -o $output_dir_default | tee voip_be_test_output.txt -./scripts/runIvasCodec.py -p ./scripts/config/ci_linux.json $WORKERS -U $limit_input_to_x_seconds -m "${modes[@]}" --oc "${output_formats[@]}" -o $output_dir_voip -J "$network_profile_path" | tee -a voip_be_test_output.txt +./scripts/runIvasCodec.py -p $cfg $WORKERS -U $limit_input_to_x_seconds -m "${modes[@]}" --oc "${output_formats[@]}" -o $output_dir_default | tee voip_be_test_output.txt +./scripts/runIvasCodec.py -p $cfg $WORKERS -U $limit_input_to_x_seconds -m "${modes[@]}" --oc "${output_formats[@]}" -o $output_dir_voip -J "$dly_profile" | tee -a voip_be_test_output.txt if [ $COVERAGE -eq 1 ];then # Coverage analysis requires only running the codec and may exit before the comparison part exit 0 fi - # Check if Python scripts above failed. They return status 0 even when running a mode fails, so we have to parse log file if grep -iq failed voip_be_test_output.txt ; then echo "Run errors in runIvasCodec.py" -- GitLab From 33ec3b906c93589a3417b74b4a2048f7a7bb858e Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Mon, 9 Jan 2023 15:05:22 +0100 Subject: [PATCH 4/4] Move early exit statement in ivas_voip_be_test.sh after run errors check --- ci/ivas_voip_be_test.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ci/ivas_voip_be_test.sh b/ci/ivas_voip_be_test.sh index 7964ce1ceb..8ff091cf19 100755 --- a/ci/ivas_voip_be_test.sh +++ b/ci/ivas_voip_be_test.sh @@ -74,17 +74,17 @@ output_dir_voip="out_voip" ./scripts/runIvasCodec.py -p $cfg $WORKERS -U $limit_input_to_x_seconds -m "${modes[@]}" --oc "${output_formats[@]}" -o $output_dir_default | tee voip_be_test_output.txt ./scripts/runIvasCodec.py -p $cfg $WORKERS -U $limit_input_to_x_seconds -m "${modes[@]}" --oc "${output_formats[@]}" -o $output_dir_voip -J "$dly_profile" | tee -a voip_be_test_output.txt -if [ $COVERAGE -eq 1 ];then - # Coverage analysis requires only running the codec and may exit before the comparison part - exit 0 -fi - # Check if Python scripts above failed. They return status 0 even when running a mode fails, so we have to parse log file if grep -iq failed voip_be_test_output.txt ; then echo "Run errors in runIvasCodec.py" exit 1 fi +if [ $COVERAGE -eq 1 ];then + # Coverage analysis requires only running the codec and may exit before the comparison part + exit 0 +fi + # Set up Python path python_audio_module_path=$(pwd)/scripts export PYTHONPATH=$python_audio_module_path:$PYTHONPATH -- GitLab