Commit cfc64ddf authored by vaclav's avatar vaclav
Browse files

revert unintentional changes in scripts

parent bc344f84
Loading
Loading
Loading
Loading
Loading
+350 −0
Original line number Diff line number Diff line
@@ -698,6 +698,286 @@ evs-pytest-on-merge-request:
  script:
    - *print-common-info
    - *merge-request-comparison-setup-codec
    
    # some helper variables - "|| true" to prevent failures from grep not finding anything
    - non_be_flag=$(echo $CI_MERGE_REQUEST_TITLE | grep -c --ignore-case "\[evs[ -]*non[ -]*be\]") || true
    - ref_using_main=$(echo $CI_MERGE_REQUEST_TITLE | grep -c --ignore-case "\[ref[ -]*using[ -]*main\]") || true

    ### If ref_using_main is not set, checkoug the source branch to use scripts and input from there
    - if [ $ref_using_main == 0 ]; then git checkout $source_branch_commit_sha; fi

    ### prepare pytest
    # create references
    - python3 -m pytest $TESTS_DIR_CODEC_BE_ON_MR/test_param_file.py -v --update_ref 1 -m create_ref --param_file scripts/config/self_test_evs.prm

    ### Run test using branch scripts and input
    - if [ $ref_using_main == 1 ]; then git checkout $source_branch_commit_sha; fi

    ### run pytest for EVS cases
    - exit_code=0
    - python3 -m pytest $TESTS_DIR_CODEC_BE_ON_MR/test_param_file.py -v --param_file scripts/config/self_test_evs.prm --html=report.html --self-contained-html --junit-xml=report-junit-evs.xml || exit_code=$?
    - zero_errors=$(cat report-junit-evs.xml | grep -c 'errors="0"') || true

    - *merge-request-comparison-check

  allow_failure:
    exit_codes:
      - 123
  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-evs.xml
      - report.html
    expose_as: "pytest evs results"
    reports:
      junit:
        - report-junit-evs.xml

voip-be-on-merge-request:
  extends:
    - .test-job-linux-needs-testv-dir
    - .rules-merge-request
  stage: compare # Or should it be test? Comparison is done within one git revision
  needs: ["build-codec-linux-make", codec-smoke-test]
  timeout: "10 minutes"
  script:
    - *print-common-info
    - bash ci/ivas_voip_be_test.sh

clang-format-check:
  extends:
    - .test-job-linux
    - .rules-merge-request
  variables:
    ARTIFACT_BASE_NAME: "mr-$CI_MERGE_REQUEST_IID--sha-$CI_COMMIT_SHORT_SHA--formatting-fix"
  stage: validate
  needs: []
  timeout: "5 minutes"
  script:
    # Set up variables. This can't be done in the "variables" section because variables are not expanded properly there
    - PATCH_FILE_NAME="$ARTIFACT_BASE_NAME".patch
    - >
      INSTRUCTIONS_GITLAB="To fix formatting issues:\n
      - download the diff patch available as artifact of this job\n
      - unzip the artifact and place the patch file in the root directory of your local IVAS repo\n
      - run: git apply $PATCH_FILE_NAME\n
      - commit new changes"
    - >
      INSTRUCTIONS_README="To fix formatting issues:\n
      - place the patch file in the root directory of your local IVAS repo\n
      - run: git apply $PATCH_FILE_NAME\n
      - commit new changes"
    
    - scripts/check-format.sh -af -p 8 || format_problems=$?
    - if [ $format_problems == 0 ] ; then exit 0; fi

    - mkdir tmp-formatting-fix
    - git diff > "tmp-formatting-fix/$PATCH_FILE_NAME"

    # Print instructions to job output
    - echo -e "$INSTRUCTIONS_GITLAB"

    # Include readme in the artifact, in case someone misses the job printout (e.g. getting the artifact via MR interface)
    - echo -e "$INSTRUCTIONS_README" > "tmp-formatting-fix/readme.txt"

    - exit $format_problems
  artifacts:
    expire_in: 1 day
    paths:
      - tmp-formatting-fix/
    when: on_failure
    name: "$ARTIFACT_BASE_NAME"
    expose_as: 'formatting patch'

# check for crashes if first received frame on decoder side is an SID
check-first-frame-is-sid:
  extends:
    - .test-job-linux-needs-testv-dir
    - .rules-merge-request
  tags:
    - ivas-linux
  stage: test
  # needs: ["build-codec-linux-cmake"]
  script:
    - *print-common-info
    - *update-ltv-repo
    - *check-for-testvectors
    - cmake .
    - make -j

    # TODO: for some MASA modes, we currently do not have testvectors that actually trigger DTX
    # SBA is run separately to use shorter part of file
    - modes=$(scripts/runIvasCodec.py -l | grep dtx | grep -v MASA | grep -v SBA)
    - scripts/runIvasCodec.py -p scripts/config/ci_linux_sidstart_test.json -m $modes -s --bs_length 500 -U 0:20 || exit_code_no_sba=$?
    - modes=$(scripts/runIvasCodec.py -l | grep dtx | grep SBA)
    - scripts/runIvasCodec.py -p scripts/config/ci_linux_sidstart_test.json -m $modes -s --bs_length 500 -U 70:80 || exit_code_sba=$?
    - if [ $exit_code_no_sba != 0 || $exit_code_sba != 0]; then exit 1; fi
  artifacts:
    paths:
      - out/logs
    when: on_failure
    name: "$CI_JOB_NAME--$CI_MERGE_REQUEST_IID--sha-$CI_COMMIT_SHORT_SHA--sidstart"
    expose_as: "logs-sidstart"
    expire_in: "5 days"

selection-test-processing:
  extends:
    - .test-job-linux-needs-testv-dir
    - .rules-merge-request
  tags:
    - processing-scripts-linux
  stage: test
  needs: ["build-codec-linux-make"]
  script:
    # get processing script code
    - git clone https://forge.3gpp.org/rep/ivas-codec-pc/ivas-processing-scripts.git --single-branch -b main

    - mkdir -p ivas-processing-scripts/tests/data/testv
    - cp -r scripts/testv/* ivas-processing-scripts/tests/data/testv/

    # copy binaries into local bin dir, those should take precendence over PATH
    - cp $PROCESSING_SCRIPTS_BIN_DIR/* ivas-processing-scripts/ivas_processing_scripts/bin/
    # for testing with native binaries
    - rm ivas-processing-scripts/ivas_processing_scripts/bin/IVAS*.exe
    - rm ivas-processing-scripts/ivas_processing_scripts/bin/EVS*.exe

    # build codec and put into bin dir
    - make -j
    - cp ./IVAS_* ivas-processing-scripts/ivas_processing_scripts/bin/

    # patch the use_windows_codec_binaries key (weird folding is needed so colons are accepted)
    - >
      sed -i "s/use_windows_codec_binaries: true/use_windows_codec_binaries: false/" ivas-processing-scripts/experiments/selection/*/config/*.yml

    # run experiments test
    - cd ivas-processing-scripts
    - python3 -m pytest tests/test_experiments.py::test_generate_test_items -n auto | tee log.txt
  artifacts:
    paths:
      - ivas-processing-scripts/experiments/selection/*/proc_output/*.log
      - log.txt
    when: on_failure
    expire_in: 1 week

lc3plus-ensure-no-code-changes:
  extends:
    - .test-job-linux
    - .rules-merge-request
  stage: validate
  needs: []
  timeout: "5 minutes"
  script:
    # Replace code commited to repo with code downloaded from ETSI
    - ./scripts/lc3plus_lib_setup/get_lc3plus.sh

    # Ensure git reports no changes
    - modified_files=$(git status -s)
    - if [[ $modified_files ]]; then printf 'LC3plus codebase was modified!\n\n'"$modified_files"'\n\n'; exit $EXIT_CODE_FAIL; fi


# ---------------------------------------------------------------
# Test jobs for main branch
# ---------------------------------------------------------------

# check bitexactness to EVS windows binaries
be-2-evs-windows:
  extends:
    - .rules-main-push
  tags:
    - ivas-windows
  stage: test
  needs: ["build-codec-windows-msbuild"]
  timeout: "20 minutes" # To be revisited
  script:
    - *print-common-info-windows

    - $winoutdata = $null
    - MSBuild.exe .\Workspace_msvc\Workspace_msvc.sln /property:Configuration=Release | tee -variable winoutdata
    - $winoutdata | Out-File $BUILD_OUTPUT -Encoding Utf8

    # copy over to never change the testvector dir
    - cp -r $EVS_BE_WIN_TEST_DIR ./evs_be_win_test
    - cp IVAS_cod.exe ./evs_be_win_test/bin/IVAS_cod.exe
    - cp IVAS_dec.exe ./evs_be_win_test/bin/IVAS_dec.exe

    - cd evs_be_win_test
    - python ../ci/run_evs_be_win_test.py

# check bitexactness to EVS
be-2-evs-linux:
  extends:
    - .test-job-linux
    - .rules-main-push
  tags:
    - be-2-evs-temp
  stage: test
  needs: ["build-codec-linux-cmake"]
  timeout: "20 minutes" # To be revisited
  script:
    - *print-common-info

    - mkdir build
    - cd build
    - cmake ..
    - make -j
    - cd ..

    # copy over to never change the testvector dir
    - cp -r $EVS_BE_TEST_DIR ./evs_be_test
    - cp build/IVAS_cod ./evs_be_test/bin/EVS_cod
    - cp build/IVAS_dec ./evs_be_test/bin/EVS_dec

    - cd evs_be_test
    - python3 ../ci/run_evs_be_test.py

codec-comparison-on-main-push:
  extends:
    - .test-job-linux
    - .rules-main-push
  stage: compare
  needs: ["build-codec-linux-cmake"]
  timeout: "30 minutes" # To be revisited
  script:
    - *print-common-info
    - latest_commit=$(git rev-parse HEAD) # Latest commit
    - *get-previous-merge-commit-sha # Stored in previous_merge_commit shell variable now
    - echo "Comparing changes from $previous_merge_commit to $latest_commit"
    - git --no-pager diff --stat $previous_merge_commit..$latest_commit

    # Rest is more or less placeholder adapted from MR self test. This should be replaced with more complex tests.

    ### build test binaries, initial clean for paranoia reasons
    - make clean
    - mkdir build
    - cd build
    - cmake ..
    - make -j
    - mv IVAS_cod ../IVAS_cod_test
    - mv IVAS_dec ../IVAS_dec_test
    - cd ..
    - rm -rf build/*

    ### compare to the previous merge commit in the main branch
    - git fetch origin main
    - git checkout $previous_merge_commit

    ### build reference binaries
    - cd build
    - cmake ..
    - make -j
    - mv IVAS_cod ../IVAS_cod_ref
    - mv IVAS_dec ../IVAS_dec_ref
    - cd ..

    # 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
    - ref_using_main=$(echo $CI_COMMIT_MESSAGE | grep -c --ignore-case "\[ref[ -]*using[ -]*main\]") || true

    ### re-checkout the latest commit in the main branch, if ref_using_main is not set
    - if [ $ref_using_main == 0 ]; then git checkout $latest_commit;fi

    ### prepare pytest
    # create short test vectors
    - python3 tests/create_short_testvectors.py
@@ -838,6 +1118,76 @@ sanitizer-test-masa:
  extends: .sanitizer-test-schedule-A
  rules:
    - if: $SANITIZER_SCHEDULE_A
      when: delayed
      start_in: 21 hours
  timeout: 3 hours
  script:
    - *update-ltv-repo
    - python3 ci/run_scheduled_sanitizer_test.py MASA $OUT_FORMATS_CHANNEL_BASED $OUT_FORMATS_SCENE_BASED $OUT_FORMATS_BINAURAL EXT --tests $SANITIZER_TESTS

### --- sanitizer schedule B ---

.sanitizer-test-schedule-B:
  extends:
    - .sanitizer-test-template
  timeout: 4 hours

sanitizer-test-mc-5_1:
  extends: .sanitizer-test-schedule-B
  rules:
    - if: $SANITIZER_SCHEDULE_B
  script:
    - *update-ltv-repo
    - python3 ci/run_scheduled_sanitizer_test.py 5_1 $OUT_FORMATS_CHANNEL_BASED $OUT_FORMATS_SCENE_BASED $OUT_FORMATS_BINAURAL --tests $SANITIZER_TESTS

sanitizer-test-mc-5_1_2:
  extends: .sanitizer-test-schedule-B
  rules:
    - if: $SANITIZER_SCHEDULE_B
      when: delayed
      start_in: 4 hours
  script:
    - *update-ltv-repo
    - python3 ci/run_scheduled_sanitizer_test.py 5_1_2 $OUT_FORMATS_CHANNEL_BASED $OUT_FORMATS_SCENE_BASED $OUT_FORMATS_BINAURAL --tests $SANITIZER_TESTS

sanitizer-test-mc-5_1_4:
  extends: .sanitizer-test-schedule-B
  rules:
    - if: $SANITIZER_SCHEDULE_B
      when: delayed
      start_in: 8 hours
  script:
    - *update-ltv-repo
    - python3 ci/run_scheduled_sanitizer_test.py 5_1_4 $OUT_FORMATS_CHANNEL_BASED $OUT_FORMATS_SCENE_BASED $OUT_FORMATS_BINAURAL --tests $SANITIZER_TESTS

sanitizer-test-mc-7_1:
  extends: .sanitizer-test-schedule-B
  rules:
    - if: $SANITIZER_SCHEDULE_B
      when: delayed
      start_in: 12 hours
  script:
    - *update-ltv-repo
    - python3 ci/run_scheduled_sanitizer_test.py 7_1 $OUT_FORMATS_CHANNEL_BASED $OUT_FORMATS_SCENE_BASED $OUT_FORMATS_BINAURAL --tests $SANITIZER_TESTS

sanitizer-test-mc-7_1_4:
  extends: .sanitizer-test-schedule-B
  rules:
    - if: $SANITIZER_SCHEDULE_B
      when: delayed
      start_in: 16 hours
  script:
    - *update-ltv-repo
    - python3 ci/run_scheduled_sanitizer_test.py 7_1_4 $OUT_FORMATS_CHANNEL_BASED $OUT_FORMATS_SCENE_BASED $OUT_FORMATS_BINAURAL --tests $SANITIZER_TESTS

### --- sanitizer schedule C ---

.sanitizer-test-schedule-C:
  extends:
    - .sanitizer-test-template
  timeout: 6 hours

sanitizer-test-sba:
  extends: .sanitizer-test-schedule-C
  rules:
    - if: $SANITIZER_SCHEDULE_C
+21 −388

File changed.

Preview size limit exceeded, changes collapsed.

+1 −1

File changed.

Contains only whitespace changes.