Loading .gitlab-ci.yml +43 −8 Original line number Diff line number Diff line Loading @@ -131,6 +131,19 @@ stages: # automatically disable #DEBUGGING macro in options.h using /**/-comment - sed -i.bak -e "s/^[[:space:]]*\(#define[[:space:]]*DEBUGGING\)/\/\*\1\*\//g" lib_com/options.h # From float CI .mr-fetch-target-branch: &mr-fetch-target-branch # first delete local target branch to avoid conflicts when branch is cached and there are merge conflicts during fetching # depending on chaching, the branch may not be there, so prevent failure of this command -> should maybe be done smarter later - git branch -D $CI_MERGE_REQUEST_TARGET_BRANCH_NAME || true # needed when depth is lower than the number of commits in the branch - git fetch origin $CI_MERGE_REQUEST_TARGET_BRANCH_NAME:$CI_MERGE_REQUEST_TARGET_BRANCH_NAME # From float CI .mr-get-target-commit: &mr-get-target-commit # compare to last target branch commit before pipeline was created - target_commit=$(git log $CI_MERGE_REQUEST_TARGET_BRANCH_NAME -1 --oneline --before=${CI_PIPELINE_CREATED_AT} --format=%H) # From float CI .merge-request-comparison-setup-codec: &merge-request-comparison-setup-codec ### build test binaries, initial clean for paranoia reasons - *disable-debugging-macro Loading @@ -141,6 +154,28 @@ stages: - mv IVAS_rend IVAS_rend_test - git restore . ### store the current commit hash - source_branch_commit_sha=$(git rev-parse HEAD) ### checkout version to compare against - *mr-fetch-target-branch - *mr-get-target-commit - git checkout $target_commit - echo "Building reference codec at commit $target_commit" ### build reference binaries - *disable-debugging-macro - make -j - mv IVAS_cod IVAS_cod_ref - mv IVAS_dec IVAS_dec_ref - mv IVAS_rend IVAS_rend_ref - git restore . # rename test binaries back - mv IVAS_cod_test IVAS_cod - mv IVAS_dec_test IVAS_dec - mv IVAS_rend_test IVAS_rend .merge-request-comparison-check: &merge-request-comparison-check - echo "--------------- Running merge-request-comparison-check anchor ---------------" - if [ $zero_errors != 1 ]; then echo "Run errors encountered!"; exit $EXIT_CODE_FAIL; fi Loading Loading @@ -1348,17 +1383,17 @@ renderer-pytest-on-merge-request: # write to temporary file as workaround for failures observed with piping echo - echo $CI_MERGE_REQUEST_TITLE > tmp.txt - non_be_flag=$(grep -c --ignore-case "\[rend\(erer\)*[ -]*non[ -]*be\]" tmp.txt) || true - ref_using_main=$(grep -c --ignore-case "\[ref[ -]*using[ -]*main\]" tmp.txt) || true - ref_using_target=$(grep -c --ignore-case "\[ref[ -]*using[ -]*target\]" tmp.txt) || true ### If ref_using_main is not set, checkout the source branch to use scripts and input from there - if [ $ref_using_main == 0 ]; then git checkout $source_branch_commit_sha; fi ### If ref_using_target is not set, checkout the source branch to use scripts and input from there - if [ $ref_using_target == 0 ]; then git checkout $source_branch_commit_sha; fi - exit_code=0 - testcase_timeout=60 - python3 -m pytest -q --log-level ERROR -n auto -rA --html=report.html --self-contained-html --junit-xml=report-junit.xml tests/renderer/test_renderer.py --create_ref --testcase_timeout=$testcase_timeout || exit_code=$? ### Run test using branch scripts and input - if [ $ref_using_main == 1 ]; then git checkout $source_branch_commit_sha; fi - if [ $ref_using_target == 1 ]; then git checkout $source_branch_commit_sha; fi # run test - python3 -m pytest -q --log-level ERROR -n auto -rA --html=report.html --self-contained-html --junit-xml=report-junit.xml tests/renderer/test_renderer.py --create_cut --testcase_timeout=$testcase_timeout || exit_code=$? Loading Loading @@ -1388,17 +1423,17 @@ ivas-pytest-on-merge-request: # write to temporary file as workaround for failures observed with piping echo - echo $CI_MERGE_REQUEST_TITLE > tmp.txt - non_be_flag=$(grep -c --ignore-case "\[non[ -]*be\]" tmp.txt) || true - ref_using_main=$(grep -c --ignore-case "\[ref[ -]*using[ -]*main\]" tmp.txt) || true - ref_using_target=$(grep -c --ignore-case "\[ref[ -]*using[ -]*main\]" tmp.txt) || true ### If ref_using_main is not set, checkout the source branch to use scripts and input from there - if [ $ref_using_main == 0 ]; then git checkout $source_branch_commit_sha; fi ### If ref_using_target is not set, checkout the source branch to use scripts and input from there - if [ $ref_using_target == 0 ]; then git checkout $source_branch_commit_sha; fi ### prepare pytest # create references - python3 -m pytest $TESTS_DIR_CODEC_BE_ON_MR -v --update_ref 1 ### Run test using branch scripts and input - if [ $ref_using_main == 1 ]; then git checkout $source_branch_commit_sha; fi - if [ $ref_using_target == 1 ]; then git checkout $source_branch_commit_sha; fi ### run pytest - exit_code=0 Loading Loading
.gitlab-ci.yml +43 −8 Original line number Diff line number Diff line Loading @@ -131,6 +131,19 @@ stages: # automatically disable #DEBUGGING macro in options.h using /**/-comment - sed -i.bak -e "s/^[[:space:]]*\(#define[[:space:]]*DEBUGGING\)/\/\*\1\*\//g" lib_com/options.h # From float CI .mr-fetch-target-branch: &mr-fetch-target-branch # first delete local target branch to avoid conflicts when branch is cached and there are merge conflicts during fetching # depending on chaching, the branch may not be there, so prevent failure of this command -> should maybe be done smarter later - git branch -D $CI_MERGE_REQUEST_TARGET_BRANCH_NAME || true # needed when depth is lower than the number of commits in the branch - git fetch origin $CI_MERGE_REQUEST_TARGET_BRANCH_NAME:$CI_MERGE_REQUEST_TARGET_BRANCH_NAME # From float CI .mr-get-target-commit: &mr-get-target-commit # compare to last target branch commit before pipeline was created - target_commit=$(git log $CI_MERGE_REQUEST_TARGET_BRANCH_NAME -1 --oneline --before=${CI_PIPELINE_CREATED_AT} --format=%H) # From float CI .merge-request-comparison-setup-codec: &merge-request-comparison-setup-codec ### build test binaries, initial clean for paranoia reasons - *disable-debugging-macro Loading @@ -141,6 +154,28 @@ stages: - mv IVAS_rend IVAS_rend_test - git restore . ### store the current commit hash - source_branch_commit_sha=$(git rev-parse HEAD) ### checkout version to compare against - *mr-fetch-target-branch - *mr-get-target-commit - git checkout $target_commit - echo "Building reference codec at commit $target_commit" ### build reference binaries - *disable-debugging-macro - make -j - mv IVAS_cod IVAS_cod_ref - mv IVAS_dec IVAS_dec_ref - mv IVAS_rend IVAS_rend_ref - git restore . # rename test binaries back - mv IVAS_cod_test IVAS_cod - mv IVAS_dec_test IVAS_dec - mv IVAS_rend_test IVAS_rend .merge-request-comparison-check: &merge-request-comparison-check - echo "--------------- Running merge-request-comparison-check anchor ---------------" - if [ $zero_errors != 1 ]; then echo "Run errors encountered!"; exit $EXIT_CODE_FAIL; fi Loading Loading @@ -1348,17 +1383,17 @@ renderer-pytest-on-merge-request: # write to temporary file as workaround for failures observed with piping echo - echo $CI_MERGE_REQUEST_TITLE > tmp.txt - non_be_flag=$(grep -c --ignore-case "\[rend\(erer\)*[ -]*non[ -]*be\]" tmp.txt) || true - ref_using_main=$(grep -c --ignore-case "\[ref[ -]*using[ -]*main\]" tmp.txt) || true - ref_using_target=$(grep -c --ignore-case "\[ref[ -]*using[ -]*target\]" tmp.txt) || true ### If ref_using_main is not set, checkout the source branch to use scripts and input from there - if [ $ref_using_main == 0 ]; then git checkout $source_branch_commit_sha; fi ### If ref_using_target is not set, checkout the source branch to use scripts and input from there - if [ $ref_using_target == 0 ]; then git checkout $source_branch_commit_sha; fi - exit_code=0 - testcase_timeout=60 - python3 -m pytest -q --log-level ERROR -n auto -rA --html=report.html --self-contained-html --junit-xml=report-junit.xml tests/renderer/test_renderer.py --create_ref --testcase_timeout=$testcase_timeout || exit_code=$? ### Run test using branch scripts and input - if [ $ref_using_main == 1 ]; then git checkout $source_branch_commit_sha; fi - if [ $ref_using_target == 1 ]; then git checkout $source_branch_commit_sha; fi # run test - python3 -m pytest -q --log-level ERROR -n auto -rA --html=report.html --self-contained-html --junit-xml=report-junit.xml tests/renderer/test_renderer.py --create_cut --testcase_timeout=$testcase_timeout || exit_code=$? Loading Loading @@ -1388,17 +1423,17 @@ ivas-pytest-on-merge-request: # write to temporary file as workaround for failures observed with piping echo - echo $CI_MERGE_REQUEST_TITLE > tmp.txt - non_be_flag=$(grep -c --ignore-case "\[non[ -]*be\]" tmp.txt) || true - ref_using_main=$(grep -c --ignore-case "\[ref[ -]*using[ -]*main\]" tmp.txt) || true - ref_using_target=$(grep -c --ignore-case "\[ref[ -]*using[ -]*main\]" tmp.txt) || true ### If ref_using_main is not set, checkout the source branch to use scripts and input from there - if [ $ref_using_main == 0 ]; then git checkout $source_branch_commit_sha; fi ### If ref_using_target is not set, checkout the source branch to use scripts and input from there - if [ $ref_using_target == 0 ]; then git checkout $source_branch_commit_sha; fi ### prepare pytest # create references - python3 -m pytest $TESTS_DIR_CODEC_BE_ON_MR -v --update_ref 1 ### Run test using branch scripts and input - if [ $ref_using_main == 1 ]; then git checkout $source_branch_commit_sha; fi - if [ $ref_using_target == 1 ]; then git checkout $source_branch_commit_sha; fi ### run pytest - exit_code=0 Loading