Commit a554b187 authored by Jan Kiene's avatar Jan Kiene
Browse files

Merge branch 'tjp-long-self-test-for-basop' into 'main'

Long self test implementation against BASOP main.

See merge request !32
parents ceff7d98 9865d457
Loading
Loading
Loading
Loading
+98 −0
Original line number Diff line number Diff line
@@ -76,6 +76,9 @@ workflow:
    - if: $CI_PIPELINE_SOURCE == 'web' && $MANUAL_PIPELINE_TYPE == 'peaq-enc-passthrough'
      variables:
        IVAS_PIPELINE_NAME: 'PEAQ encoder pass-through test: $CI_COMMIT_BRANCH'
    - if: $CI_PIPELINE_SOURCE == 'web' && $MANUAL_PIPELINE_TYPE == 'test-long-self-test'
      variables:
        IVAS_PIPELINE_NAME: 'Test long self-test against main pipeline: $CI_COMMIT_BRANCH'
    - if: $CI_PIPELINE_SOURCE == 'schedule' # Scheduled in any branch
      variables:
        IVAS_PIPELINE_NAME: 'Scheduled pipeline: $CI_COMMIT_BRANCH'        
@@ -2138,6 +2141,101 @@ ivas-pytest-compare_ref-long-fx-fx-lev+10:
    - SPLIT_COMPARISON="true"
  <<: *ivas-pytest-anchor

# Manual long self-test (not including tests_sba.py) against BASOP main
test-long-self-test:
  extends:
    - .job-linux
  stage: compare
  timeout: "360 minutes"
  rules:
    - if: $CI_PIPELINE_SOURCE == 'web' && $MANUAL_PIPELINE_TYPE == 'test-long-self-test'
  allow_failure:
    exit_codes:
      - 123
  parallel:
    matrix:
      - LEVEL: 
          - 0dB
          - minus10dB
          - plus10dB
  script:
    - set -euxo pipefail
    - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/print-common-info.sh
    - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/basop/update-scripts-repo.sh
    - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/update-ltv-repo.sh
    - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/copy-ltv-files-to-testv-dir.sh
    - testcase_timeout=$TESTCASE_TIMEOUT_LTV

    - case $LEVEL in 
        "0dB")
          LEVEL_SCALING=1.0
        ;;
        "minus10dB")
          LEVEL_SCALING=0.3162
        ;;
        "plus10dB")
          LEVEL_SCALING=3.162
        ;;
      esac

    - python3 ci/remove_unsupported_testcases.py $PRM_FILES
    - if [ $LEVEL_SCALING != "1.0" ]; then
    -   bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/basop/apply-testv-scaling.sh
    - fi

    - INV_LEVEL_SCALING=$(awk "BEGIN {print 1.0 / $LEVEL_SCALING}")
    - comp_args="--mld --ssnr --odg --scalefac $INV_LEVEL_SCALING"

    ### store the current commit hash
    - source_branch_commit_sha=$(git rev-parse HEAD)

    ### switch to main
    - git checkout main
    - git pull origin main
    - echo "Building reference codec at commit $(git rev-parse HEAD)"

    ### build main (ref) binaries
    - make clean
    - make -j
    - mv ./IVAS_cod ./IVAS_cod_ref
    - mv ./IVAS_dec ./IVAS_dec_ref

    ### Switch back to branch and rename binaries back
    - git checkout $source_branch_commit_sha
    - echo "Building test codec at commit $source_branch_commit_sha"

    ### build branch binaries
    - make clean
    - make -j


    ### prepare pytest

    # create references
    - exit_code_ref=0
    - python3 -m pytest tests/codec_be_on_mr_nonselection/test_param_file.py -v --update_ref 1 --param_file scripts/config/self_test_ltv.prm --use_ltv --testcase_timeout=$testcase_timeout || exit_code_ref=$?

    ### run pytest self-test using long test vectors
    - exit_code=0
    - python3 -m pytest tests/codec_be_on_mr_nonselection/test_param_file.py -v --param_file scripts/config/self_test_ltv.prm --use_ltv --html=report-ltv.html --self-contained-html --junit-xml=report-junit-ltv.xml $comp_args --testcase_timeout=$testcase_timeout || exit_code=$?
    - zero_errors=$(cat report-junit-ltv.xml | grep -c 'errors="0"') || true

    - if [ $zero_errors != 1 ]; then echo "Run errors encountered!"; exit $EXIT_CODE_FAIL; fi
    - if [ $exit_code -ne 0 ]; then echo "Non-bitexact cases encountered!"; exit $EXIT_CODE_NON_BE; fi
    - exit 0


  artifacts:
    name: "$CI_JOB_NAME--sha-$CI_COMMIT_SHORT_SHA--results"
    when: always
    expire_in: 4 mos
    paths:
      - report-junit-ltv.xml
      - report-ltv.html
    expose_as: "test-long-self-test results"
    reports:
      junit:
        - report-junit-ltv.xml

ivas-smoke-test-saturation:
  extends: