Commit 01d9063e authored by Jan Kiene's avatar Jan Kiene
Browse files

port codec-*san jobs

parent 01e19c69
Loading
Loading
Loading
Loading
Loading
+99 −0
Original line number Diff line number Diff line
@@ -266,6 +266,34 @@ stages:
  - (Get-Content -Path "CMakeLists.txt") -replace '# \(add_compile_options\("\/WX"\)\)', '$1' | Set-Content -Path "CMakeLists.txt"
  - Get-ChildItem -Path "Workspace_msvc" -Filter "*.vcxproj" | ForEach-Object { (Get-Content -Path $_.FullName) -replace '<TreatWarningAsError>false', '<TreatWarningAsError>true' | Set-Content -Path $_.FullName }

# From float repo
# to be reused in MR and LTV-scheduled sanitizer test jobs
# set CLANG_NUM, SELFTEST_SANITY_TIMEOUT and SELF_TEST_PRM_FILE in before_script section
.sanitizer-selftest-anchor: &sanitizer-selftest-anchor
  script:
    - *print-common-info
    - *copy-ltv-files-to-testv-dir
    - make clean
    - make -j CLANG=$CLANG_NUM
    - testcase_timeout=$SELFTEST_SANITY_TIMEOUT
    - export UBSAN_OPTIONS=suppressions=scripts/ubsan.supp,report_error_type=1

    - exit_code20=0
    - exit_code10=0
    - exit_code5=0

    - if [ $CLANG_NUM -eq 1 ]; then sanitizer_type="MemorySanitizer"; elif [ $CLANG_NUM -eq 2 ]; then sanitizer_type="AddressSanitizer"; elif [ $CLANG_NUM -eq 3 ]; then sanitizer_type="UndefinedBehaviorSanitizer"; else echo "Wrong CLANG_NUM $CLANG_NUM given!"; exit 1; fi

    # run encoder and decoder with 20ms renderer framesize first, use reference creation mode
    - python3 -m pytest tests/codec_be_on_mr_nonselection $USE_LTV --param_file $SELF_TEST_PRM_FILE -v --update_ref 1 --html=report-20ms.html --self-contained-html --junit-xml=report-junit-20ms.xml --testcase_timeout=$testcase_timeout --ref_encoder_path ./IVAS_cod --ref_decoder_path ./IVAS_dec || exit_code20=$?
    # for 10ms and 5ms renderer framesize, we only need to run the decoder part as renderer framesize is a decoder-only option
    # set tolerance very high do ignore any BE differences due to the different renderer framesizes, those can appear due to the limiter being active
    # we are only interested in runtime errors from the sanitizers and ignore the diffs
    - python3 -m pytest tests/codec_be_on_mr_nonselection $USE_LTV --param_file $SELF_TEST_PRM_FILE -v --html=report-5ms.html --self-contained-html --junit-xml=report-junit-5ms.xml --dut_fr 5 --decoder_only --abs_tol 100000 || exit_code5=$?
    - python3 -m pytest tests/codec_be_on_mr_nonselection $USE_LTV --param_file $SELF_TEST_PRM_FILE -v --html=report-10ms.html --self-contained-html --junit-xml=report-junit-10ms.xml --dut_fr 10 --decoder_only --abs_tol 100000 || exit_code10=$?

    - if [ $exit_code20 -ne 0 ] || [ $exit_code10 -ne 0 ] || [ $exit_code5 -ne 0 ]; then exit 1; fi

.rules-pytest-to-ref-short:
  rules:
    - if: $CI_PIPELINE_SOURCE == 'web' && $MANUAL_PIPELINE_TYPE == "pytest-compare"
@@ -364,6 +392,13 @@ stages:
    - if: $CI_PIPELINE_SOURCE == 'push'
      when: never

.rules-merge-request-to-float-pc:
  extends: .rules-basis
  rules:
    - if: $CI_PIPELINE_SOURCE == 'merge_request_event' && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "float-pc"
    - if: $CI_PIPELINE_SOURCE == 'push'
      when: never

# templates to define stages and platforms
.test-job-linux:
  tags:
@@ -392,6 +427,29 @@ stages:
    - if [ ! -d "$TESTV_DIR" ]; then mkdir -p $TESTV_DIR; fi
    - cp -r scripts/testv/* $TESTV_DIR/

.sanitizer-selftest-on-mr:
  stage: test
  extends:
    - .test-job-linux-needs-testv-dir
    - .rules-merge-request-to-float-pc
  artifacts:
    name: "mr-$CI_MERGE_REQUEST_IID--sha-$CI_COMMIT_SHORT_SHA--stage-$CI_JOB_STAGE--results"
    expire_in: 1 week
    when: always
    paths:
      - report-junit-20ms.xml
      - report-junit-10ms.xml
      - report-junit-5ms.xml
      - report-20ms.html
      - report-10ms.html
      - report-5ms.html
    expose_as: "Sanitizer selftest results"
    reports:
      junit:
        - report-junit-20ms.xml
        - report-junit-10ms.xml
        - report-junit-5ms.xml

.ivas-pytest-anchor: &ivas-pytest-anchor
  stage: test
  needs: ["build-codec-linux-make"]
@@ -1375,6 +1433,47 @@ voip-be-on-merge-request:
      - smoke_test_output_hrtf.txt
    expose_as: "Smoke test results"

# from float repo
# NOTE: timeout was adjusted to work for float only
# code selftest testvectors with memory-sanitizer binaries
codec-msan:
  extends:
    - .sanitizer-selftest-on-mr
  tags:
    - ivas-linux
  before_script:
    - CLANG_NUM=1
    - SELFTEST_SANITY_TIMEOUT=180
    - SELF_TEST_PRM_FILE="scripts/config/self_test.prm"
    - USE_LTV=""
  <<: *sanitizer-selftest-anchor

# code selftest testvectors with address-sanitizer binaries
codec-asan:
  extends:
    - .sanitizer-selftest-on-mr
  tags:
    - ivas-linux
  before_script:
    - CLANG_NUM=2
    - SELFTEST_SANITY_TIMEOUT=180
    - SELF_TEST_PRM_FILE="scripts/config/self_test.prm"
    - USE_LTV=""
  <<: *sanitizer-selftest-anchor

# code selftest testvectors with undefined-behaviour-sanitizer binaries
codec-usan:
  extends:
    - .sanitizer-selftest-on-mr
  tags:
    - ivas-linux
  before_script:
    - CLANG_NUM=3
    - SELFTEST_SANITY_TIMEOUT=180
    - SELF_TEST_PRM_FILE="scripts/config/self_test.prm"
    - USE_LTV=""
  <<: *sanitizer-selftest-anchor

# compare renderer bitexactness between target and source branch
renderer-pytest-on-merge-request:
  extends: