Commit 2c056a4f authored by Sandesh Venkatesh's avatar Sandesh Venkatesh
Browse files

Merge branch 'ci/add-short-sanitizer-tests' into 'main'

Add short sanitizer tests to run on schedule

See merge request !147
parents 3471d7c7 3b5e2cbe
Loading
Loading
Loading
Loading
Loading
+66 −5
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@ variables:
      - 'pytest-mld'
      - 'pytest-mld-long'
      - 'evs-26444'
      - 'sanitizer-stv'


default:
@@ -50,6 +51,9 @@ workflow:
    - if: $CI_PIPELINE_SOURCE == 'web' && $MANUAL_PIPELINE_TYPE == 'evs-26444'
      variables:
        IVAS_PIPELINE_NAME: 'EVS 26.444 test: $CI_COMMIT_BRANCH'
    - if: $CI_PIPELINE_SOURCE == 'web' && $MANUAL_PIPELINE_TYPE == 'sanitizer-stv'
      variables:
        IVAS_PIPELINE_NAME: 'Short testvectors sanitizers'
    - if: $CI_PIPELINE_SOURCE == 'schedule' # Scheduled in any branch
      variables:
        IVAS_PIPELINE_NAME: 'Scheduled pipeline: $CI_COMMIT_BRANCH'        
@@ -73,9 +77,8 @@ stages:
    echo "Commit time was $CI_COMMIT_TIMESTAMP"
    date | xargs echo "System time is"

.mld-test-setup-codec: &mld-test-setup-codec 
.setup-codec: &setup-codec
  - current_commit_sha=$(git rev-parse HEAD)

  ### build reference binaries
  - git checkout $REFERENCE_TAG
  - make clean
@@ -88,6 +91,10 @@ stages:
  - make clean
  - make -j


.mld-test-setup-codec: &mld-test-setup-codec
  - *setup-codec

  ### prepare pytest
  # create short test vectors
  - python3 tests/create_short_testvectors.py
@@ -222,6 +229,39 @@ stages:
      junit:
        - report-junit.xml
          

.ivas-pytest-sanitizers-anchor: &ivas-pytest-sanitizers-anchor
  stage: test
  needs: ["build-codec-linux-make"]
  timeout: "90 minutes"
  rules:
    - if: $CI_PIPELINE_SOURCE == 'push'
      when: never
    - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
      when: never
    - if: $CI_PIPELINE_SOURCE == 'schedule' && $IVAS_PYTEST_MSAN
    - if: $CI_PIPELINE_SOURCE == 'web' && $MANUAL_PIPELINE_TYPE == "sanitizer-stv"
  script:
    - *print-common-info
    - *update-scripts-repo
    - *remove-unsupported-testcases
    - *setup-codec
    - make clean
    - make -j CLANG=$CLANG_NUM
    - if [[ $CLANG_NUM == 3 ]]; then export UBSAN_OPTIONS="suppressions=scripts/ubsan.supp,report_error_type=1"; fi
    - testcase_timeout=300
    - python3 -m pytest $SHORT_TEST_SUITE -v --tb=no --update_ref 1 -m create_ref --html=report.html --self-contained-html --junit-xml=report-junit.xml --testcase_timeout $testcase_timeout --ref_encoder_path ./IVAS_cod_ref --ref_decoder_path ./IVAS_dec
  artifacts:
    name: "ivas-pytest-dec-msan--sha-$CI_COMMIT_SHORT_SHA--results"
    when: always
    expire_in: "2 weeks"
    paths:
      - report-junit.xml
      - report.html
    reports:
      junit:
        - report-junit.xml

# ---------------------------------------------------------------
# Build jobs
# ---------------------------------------------------------------
@@ -327,6 +367,27 @@ ivas-pytest-mld-dec-lev+10:
    - LEVEL_SCALING=3.162
  <<: *ivas-pytest-mld-anchor

ivas-pytest-dec-msan:
  extends:
    - .test-job-linux
  before_script:
    - CLANG_NUM=1
  <<: *ivas-pytest-sanitizers-anchor

ivas-pytest-dec-asan:
  extends:
    - .test-job-linux
  before_script:
    - CLANG_NUM=2
  <<: *ivas-pytest-sanitizers-anchor

ivas-pytest-dec-usan:
  extends:
    - .test-job-linux
  before_script:
    - CLANG_NUM=3
  <<: *ivas-pytest-sanitizers-anchor

# ---------------------------------------------------------------
# Long test jobs 
# ---------------------------------------------------------------