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

overwrite cache b4 every pytest call

parent 6be56cb4
Loading
Loading
Loading
Loading
Loading
+11 −2
Original line number Diff line number Diff line
@@ -476,6 +476,12 @@ stages:
        - $XML_REPORT
        - $XML_REPORT

.overwrite-pytest-cache-with-artifact: &overwrite-pytest-cache-with-artifact
  - if [ -f $PYTEST_CACHE_ARTIFACT ] then
  -   rm -rf .pytest_cache || true
  -   unzip $PYTEST_CACHE_ARTIFACT
  - fi

.ivas-pytest-on-merge-request-anchor: &ivas-pytest-on-merge-request-anchor
  stage: test
  timeout: "300 minutes"
@@ -493,8 +499,7 @@ stages:
    - *print-common-info

    - if [ -s $FAILED_TESTCASES_LIST ]; then
    -   rm -rf .pytest_cache || true
    -   unzip $PYTEST_CACHE_ARTIFACT
    -   *overwrite-pytest-cache-with-artifact
    -   export PYTEST_ADDOPTS=--last-failed
    - else
    -   echo "All tested cases were bit-exact between $CI_MERGE_REQUEST_TARGET_BRANCH_NAME and $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME. No need to check for regressions."
@@ -524,6 +529,8 @@ stages:
    # this per default builds the branch and the reference and creates the reference outputs
    - *build-and-create-reference-outputs
    - exit_code=0
    # need to restore cache again
    - *overwrite-pytest-cache-with-artifact
    - python3 -m pytest --tb=no $TEST_SUITE -v --keep_files --create_cut --html=$HTML_REPORT_BRANCH --self-contained-html --junit-xml=$XML_REPORT_BRANCH --mld --ssnr --odg --ref_encoder_path $REF_ENCODER_PATH --ref_decoder_path $REF_DECODER_PATH --dut_encoder_path $DUT_ENCODER_PATH --dut_decoder_path $DUT_DECODER_PATH -n auto --testcase_timeout $testcase_timeout || exit_code=$?
    - zero_errors_branch=$(cat $XML_REPORT_BRANCH | grep -c 'errors="0"') || true
    - python3 scripts/parse_xml_report.py $XML_REPORT_BRANCH $CSV_BRANCH
@@ -541,6 +548,8 @@ stages:
    - git pull
    - make clean
    - make -j
    # need to restore cache again
    - *overwrite-pytest-cache-with-artifact
    - python3 -m pytest --tb=no $TEST_SUITE -v --keep_files --create_cut --html=$HTML_REPORT_MAIN --self-contained-html --junit-xml=$XML_REPORT_MAIN --mld --ssnr --odg --ref_encoder_path $REF_ENCODER_PATH --ref_decoder_path $REF_DECODER_PATH --dut_encoder_path $DUT_ENCODER_PATH --dut_decoder_path $DUT_DECODER_PATH -n auto --testcase_timeout $testcase_timeout || true
    - python3 scripts/parse_xml_report.py $XML_REPORT_MAIN $CSV_MAIN