Commit 40eb9a56 authored by norvell's avatar norvell
Browse files

Merging .gitlab-ci.yml

parents b3fbb38a 1565255e
Loading
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -46,6 +46,8 @@ scripts/ref/
scripts/test/
scripts/out/
scripts/self_test_summary.txt
tests/dut
tests/ref

# Python files that pop up when running scripts
__pycache__/
+83 −107
Original line number Diff line number Diff line
@@ -6,6 +6,8 @@ variables:
  OUT_FORMATS_CHANNEL_BASED: "stereo mono 5_1 5_1_2 5_1_4 7_1 7_1_4"
  OUT_FORMATS_SCENE_BASED: "FOA HOA2 HOA3"
  OUT_FORMATS_BINAURAL: "BINAURAL BINAURAL_ROOM"
  EXIT_CODE_NON_BE: 123
  EXIT_CODE_FAIL: 1


# This sets when pipelines are created. Jobs have more specific rules to restrict them.
@@ -23,6 +25,7 @@ stages:
  - build
  - test
  - compare
  - validate

# ---------------------------------------------------------------
# Generic script anchors
@@ -142,6 +145,25 @@ stages:
      - 123


# ---------------------------------------------------------------
# Validation jobs
# ---------------------------------------------------------------

check-if-branch-is-up-to-date-with-main:
  extends:
    - .rules-merge-request
  stage: validate
  needs: []
  tags:
    - ivas-linux
  script:
    - echo $CI_COMMIT_SHA
    - echo $CI_MERGE_REQUEST_TARGET_BRANCH_NAME
    - commits_behind_count=$(git rev-list --count $CI_COMMIT_SHA..origin/$CI_MERGE_REQUEST_TARGET_BRANCH_NAME)
    - echo $commits_behind_count
    - if [ $commits_behind_count -eq 0 ]; then exit 0; else exit 1; fi;


# ---------------------------------------------------------------
# Build jobs
# ---------------------------------------------------------------
@@ -289,8 +311,8 @@ asan-on-merge-request-linux:
    expose_as: 'Asan selftest results'


# compare bit exactness between target and source branch -- IVAS self_test cases
self-test-ivas-on-merge-request:
# compare bit exactness between target and source branch
pytest-on-merge-request-ivas:
  extends: 
    - .test-job-linux
    - .rules-merge-request
@@ -301,63 +323,29 @@ self-test-ivas-on-merge-request:
    - *print-common-info
    - *merge_request_comparison_setup

    ### run selftest
    - ls -altr scripts/testv
    - python3 ./scripts/self_test.py --encref IVAS_cod_ref --decref IVAS_dec_ref --enctest IVAS_cod_test --dectest IVAS_dec_test | tee test_output.txt
    
    ### analyse test output

    # some helper variables - "|| true" to prevent failures from grep not finding anything
    - non_be_flag=$(echo $CI_MERGE_REQUEST_TITLE | grep -c --ignore-case "\[non[ -]*be\]") || true
    - run_errors=$(cat test_output.txt test_output_evs.txt | grep -c "test conditions had run errors") || true
    - bitexact=$(cat test_output.txt | grep -c "All [0-9]* tests are bitexact") || true
    - EXIT_CODE_NON_BE=123
    - EXIT_CODE_FAIL=1

    # check for crashes during the test, if any happened, fail the test
    - if [ $run_errors != 0 ] ; then echo "Run errors in self_test.py"; exit $EXIT_CODE_FAIL; fi

    # check for non bitexact output and store exit code to also always run the SBA pytest
    - if [ $bitexact == 0 ] && [ $non_be_flag == 0 ] ; then echo "Non-bitexact cases without non-BE tag encountered"; exit $EXIT_CODE_FAIL; fi
    - if [ $bitexact == 0 ] && [ $non_be_flag != 0 ]; then echo "Non-bitexact cases with non-BE tag encountered"; exit $EXIT_CODE_NON_BE; fi
    - exit 0
    
  allow_failure:
    exit_codes:
      - 123
  artifacts:
    name: "mr-$CI_MERGE_REQUEST_IID--sha-$CI_COMMIT_SHORT_SHA--stage-$CI_JOB_STAGE--results"
    when: always
    paths:
      - test_output.txt
      - scripts/test/logs/
      - scripts/ref/logs/
    expose_as: 'Self test IVAS results'

# compare bit exactness between target and source branch -- SBA self_test cases
self-test-sba-on-merge-request:
  extends: 
    - .test-job-linux
    - .rules-merge-request
  stage: compare
  needs: [ "build-codec-linux-cmake", "codec-smoke-test" ]
  timeout: "10 minutes"
  script:
    - *print-common-info
    - *merge_request_comparison_setup

    ### run SBA pytest
    - EXIT_CODE_NON_BE=123
    - EXIT_CODE_FAIL=1
    - expected_nonbe_1=0
    - fail_1=0

    ### prepare pytest
    # create short test vectors
    - python3 tests/create_short_testvectors.py
    # rename test binaries back
    - mv IVAS_cod_test IVAS_cod
    - mv IVAS_dec_test IVAS_dec
    # create references
    - python3 -m pytest tests -v --update_ref 1 -m create_ref
    - python3 -m pytest tests -v --update_ref 1 -m create_ref_part2

    ### run pytest
    - exit_code=0
    - python3 ./scripts/ivas_pytests/self_test_b.py --encref IVAS_cod_ref --decref IVAS_dec_ref --encdut IVAS_cod_test --decdut IVAS_dec_test || exit_code=$?
    - python3 -m pytest tests -v --junit-xml=report-junit.xml || exit_code=$?
    - zero_errors=$(cat report-junit.xml | grep -c 'errors="0"') || true
    - non_be_flag=$(echo $CI_MERGE_REQUEST_TITLE | grep -c --ignore-case "\[non[ -]*be\]") || true
    
    - if [ $zero_errors != 1 ]; then echo "Run errors in SBA pytest"; exit $EXIT_CODE_FAIL; fi

    - if [ $zero_errors != 1 ]; then echo "Run errors in pytest"; exit $EXIT_CODE_FAIL; fi
    - if [ $exit_code -eq 1 ] && [ $non_be_flag == 0 ]; then echo "pytest run had failures without non-BE tag encountered"; exit $EXIT_CODE_FAIL; fi
    - if [ $exit_code -eq 1 ] && [ $non_be_flag == 1 ]; then echo "pytest run had failures with non-BE tag encountered"; exit $EXIT_CODE_NON_BE; fi
    - if [ $exit_code -eq 1 ] && [ $non_be_flag != 0 ]; then echo "pytest run had failures with non-BE tag encountered"; exit $EXIT_CODE_NON_BE; fi

    - exit 0

@@ -369,13 +357,12 @@ self-test-sba-on-merge-request:
    when: always
    paths:
      - report-junit.xml
    expose_as: 'SBA test results'
    expose_as: 'pytest ivas results'
    reports:
      junit: report-junit.xml

      junit:
        - report-junit.xml

# compare bit exactness between target and source branch -- EVS self_test cases
self-test-evs-on-merge-request:
pytest-on-merge-request-evs:
  extends: 
    - .test-job-linux
    - .rules-merge-request
@@ -386,25 +373,24 @@ self-test-evs-on-merge-request:
    - *print-common-info
    - *merge_request_comparison_setup

    ### run selftest
    - ls -altr scripts/testv
    - python3 ./scripts/self_test.py --encref IVAS_cod_ref --decref IVAS_dec_ref --enctest IVAS_cod_test --dectest IVAS_dec_test scripts/config/self_test_evs.prm | tee test_output_evs.txt
    ### analyse test output

    # some helper variables - "|| true" to prevent failures from grep not finding anything
    - evs_non_be_flag=$(echo $CI_MERGE_REQUEST_TITLE | grep -c --ignore-case "\[evs[ -]*non[ -]*be\]") || true
    - run_errors=$(cat test_output_evs.txt | grep -c "test conditions had run errors") || true
    - bitexact_evs=$(cat test_output_evs.txt | grep -c "All [0-9]* tests are bitexact") || true
    - EXIT_CODE_NON_BE=123
    - EXIT_CODE_FAIL=1

    # check for crashes during the test, if any happened, fail the test
    - if [ $run_errors != 0 ] ; then echo "Run errors in self_test_evs.py"; exit $EXIT_CODE_FAIL; fi
    ### prepare pytest
    # rename test binaries back
    - mv IVAS_cod_test IVAS_cod
    - mv IVAS_dec_test IVAS_dec
    # create references
    - python3 -m pytest tests/test_param_file.py -v --update_ref 1 -m create_ref --param_file scripts/config/self_test_evs.prm

    # check for non bitexact EVS output
    - if [ $bitexact_evs == 0 ] && [ $evs_non_be_flag == 0 ] ; then echo "Non-bitexact EVS cases without EVS-non-BE tag encountered"; exit $EXIT_CODE_FAIL; fi
    - if [ $bitexact_evs == 0 ] && [ $evs_non_be_flag != 0 ] ; then echo "Non-bitexact EVS cases with EVS-non-BE tag encountered"; exit $EXIT_CODE_NON_BE; fi
    ### run pytest for EVS cases
    - exit_code=0
    - python3 -m pytest tests/test_param_file.py -v --param_file scripts/config/self_test_evs.prm --junit-xml=report-junit-evs.xml || exit_code=$?
    - zero_errors=$(cat report-junit-evs.xml | grep -c 'errors="0"') || true

    - if [ $zero_errors != 1 ]; then echo "Run errors in pytest for EVS"; exit $EXIT_CODE_FAIL; fi
    - if [ $exit_code -eq 1 ] && [ $evs_non_be_flag == 0 ]; then echo "Non-bitexact EVS cases without EVS-non-BE tag encountered"; exit $EXIT_CODE_FAIL; fi
    - if [ $exit_code -eq 1 ] && [ $evs_non_be_flag != 0 ]; then echo "Non-bitexact EVS cases with EVS-non-BE tag encountered"; exit $EXIT_CODE_NON_BE; fi
    - exit 0

  allow_failure:
@@ -414,10 +400,11 @@ self-test-evs-on-merge-request:
    name: "mr-$CI_MERGE_REQUEST_IID--sha-$CI_COMMIT_SHORT_SHA--stage-$CI_JOB_STAGE--results"
    when: always
    paths:
      - test_output_evs.txt
      - scripts/test/logs/
      - scripts/ref/logs/
    expose_as: 'Self test EVS results'
      - report-junit-evs.xml
    expose_as: 'pytest evs results'
    reports:
      junit:
        - report-junit-evs.xml


# ---------------------------------------------------------------
@@ -494,37 +481,26 @@ codec-comparison-on-main-push:
    ### re-checkout the latest commit in the main branch
    - git checkout $latest_commit

    ### run selftest
    - ls -altr scripts/testv
    - python3 ./scripts/self_test.py --encref IVAS_cod_ref --decref IVAS_dec_ref --enctest IVAS_cod_test --dectest IVAS_dec_test | tee test_output.txt
    # helper variable - "|| true" to prevent failures from grep not finding anything
    - non_be_flag=$(echo $CI_COMMIT_MESSAGE | grep -c --ignore-case "\[non[ -]*be\]") || true

    ### analyse test output
    ### prepare pytest
    # create short test vectors
    - python3 tests/create_short_testvectors.py
    # rename test binaries back
    - mv IVAS_cod_test IVAS_cod
    - mv IVAS_dec_test IVAS_dec
    # create references
    - python3 -m pytest tests -v --update_ref 1 -m create_ref
    - python3 -m pytest tests -v --update_ref 1 -m create_ref_part2

    # some helper variables - "|| true" to prevent failures from grep not finding anything
    - non_be_flag=$(echo $CI_MERGE_REQUEST_TITLE | grep -c --ignore-case "\[non[ -]*be\]") || true
    - run_errors=$(cat test_output.txt | grep -c "test conditions had run errors") || true
    - bitexact=$(cat test_output.txt | grep -c "All [0-9]* tests are bitexact") || true
    - EXIT_CODE_NON_BE=123
    - EXIT_CODE_FAIL=1

    - selftest_exit_code=0

    # check for crashes during the test, if any happened, fail the test
    - if [ $run_errors != 0 ] ; then echo "Run errors in self_test.py"; exit $EXIT_CODE_FAIL; fi

    # check for non bitexact output and store exit code to also always run the SBA pytest
    - if [ $bitexact == 0 ] && [ $non_be_flag == 0 ] ; then echo "Non-bitexact cases without non-BE tag encountered"; selftest_exit_code=$EXIT_CODE_FAIL; fi
    - if [ $bitexact == 0 ] && [ $non_be_flag != 0 ]; then echo "Non-bitexact cases with non-BE tag encountered"; selftest_exit_code=$EXIT_CODE_NON_BE; fi

    ### run SBA pytest
    ### run pytest
    - exit_code=0
    - python3 ./scripts/ivas_pytests/self_test_b.py --encref IVAS_cod_ref --decref IVAS_dec_ref --encdut IVAS_cod_test --decdut IVAS_dec_test || exit_code=$?
    - python3 -m pytest tests -v --junit-xml=report-junit.xml || exit_code=$?
    - if [ $exit_code -eq 1 ] && [ $non_be_flag == 0 ]; then echo "pytest run had failures and non-BE flag not present"; exit $EXIT_CODE_FAIL; fi
    - zero_errors=$(cat report-junit.xml | grep -c 'errors="0"') || true
    - if [ $exit_code -eq 1 ] && [ $zero_errors == 1 ]; then echo "pytest run had failures, but no errors and non-BE flag present"; exit $EXIT_CODE_NON_BE; fi
    - if [ $exit_code -ne 0 ]; then echo "pytest run had errors"; exit $EXIT_CODE_FAIL; fi;
    # return exit code from selftest if everything went well with the pytest run
    - exit $selftest_exit_code
  allow_failure:
    exit_codes:
      - 123
@@ -532,9 +508,6 @@ codec-comparison-on-main-push:
    name: "main-push--sha-$CI_COMMIT_SHORT_SHA--stage-$CI_JOB_STAGE--results"
    when: always
    paths:
      - test_output.txt
      - scripts/test/logs/
      - scripts/ref/logs/
      - report-junit.xml
    expose_as: 'Results of comparison to previous merge commit'
    reports:
@@ -555,6 +528,8 @@ codec-comparison-on-main-push:
    when: always
    paths:
      - ep_015.g192
      # second wildcard is necessary to get encoder and no-PLC run logs
      - "CLANG*/logs*"

sanitizer-test-mono:
  extends: .sanitizer-test-template
@@ -703,9 +678,10 @@ coverage-test-on-main-scheduled:
  script:
    - *print-common-info
    - make GCOV=1 -j
    - ./scripts/self_test.py --create -t 1
    - ./scripts/self_test.py --create -t 1 scripts/config/self_test_evs.prm
    - ./scripts/ivas_pytests/self_test_b.py --create_only --numprocesses 1 --encref IVAS_cod --decref IVAS_dec --encdut IVAS_cod --decdut IVAS_dec
    - python3 tests/create_short_testvectors.py
    - python3 -m pytest tests -v -n 0 --update_ref 1 -m create_ref --ref_encoder_path ./IVAS_cod --ref_decoder_path ./IVAS_dec
    - python3 -m pytest tests -v -n 0 --update_ref 1 -m create_ref_part2 --ref_encoder_path ./IVAS_cod --ref_decoder_path ./IVAS_dec
    - 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
    - lcov -c -d obj -o coverage.info
    - genhtml coverage.info -o coverage
  artifacts:
+1 −0
Original line number Diff line number Diff line
@@ -267,6 +267,7 @@
    <ClCompile Include="..\lib_dec\ivas_allrad_dec.c" />
    <ClCompile Include="..\lib_dec\ivas_binauralRenderer.c" />
    <ClCompile Include="..\lib_dec\ivas_binaural_reverb.c" />
    <ClCompile Include="..\lib_dec\ivas_corecoder_dec_reconfig.c" />
    <ClCompile Include="..\lib_dec\ivas_core_dec.c" />
    <ClCompile Include="..\lib_dec\ivas_cpe_dec.c" />
    <ClCompile Include="..\lib_dec\ivas_crend.c" />
+3 −0
Original line number Diff line number Diff line
@@ -581,6 +581,9 @@
    <ClCompile Include="..\lib_dec\ivas_spar_md_dec.c">
      <Filter>dec_ivas_c</Filter>
    </ClCompile>
    <ClCompile Include="..\lib_dec\ivas_corecoder_dec_reconfig.c">
      <Filter>dec_ivas_c</Filter>
    </ClCompile>
  </ItemGroup>
  <ItemGroup>
    <ClInclude Include="..\lib_dec\jbm_jb4_inputbuffer.h">
+1 −0
Original line number Diff line number Diff line
@@ -206,6 +206,7 @@
  </ItemDefinitionGroup>
  <ItemGroup>
    <ClCompile Include="..\lib_enc\ivas_agc_enc.c" />
    <ClCompile Include="..\lib_enc\ivas_corecoder_enc_reconfig.c" />
    <ClCompile Include="..\lib_enc\ivas_core_pre_proc.c" />
    <ClCompile Include="..\lib_enc\ivas_core_pre_proc_front.c" />
    <ClCompile Include="..\lib_enc\ivas_enc_cov_handler.c" />
Loading