diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 7ba0eecec437e9de5149b763ad5b7ccd9a15be45..9ee8356f346e0d622d0dbd0d3a2838150b6386bb 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 d65677b49890151cf77eb719b33c216ce0be8f13..8ff091cf190ffa28ad632c12969e4d49b4c1fddb 100755 --- a/ci/ivas_voip_be_test.sh +++ b/ci/ivas_voip_be_test.sh @@ -28,23 +28,51 @@ # 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 + +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') 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" -# 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 $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 # 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 @@ -52,6 +80,11 @@ if grep -iq failed voip_be_test_output.txt ; then 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 diff --git a/ci/smoke_test.sh b/ci/smoke_test.sh index 0963055acdbcfa4e34502a6ad28ffb0466fa138f..b710beab4eba4c58c807ee73cccadfcbba618323 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