From 36cad2a87d0b39881b3deea8658ed92289b9c75c Mon Sep 17 00:00:00 2001 From: Jan Kiene Date: Wed, 22 May 2024 15:24:10 +0200 Subject: [PATCH 01/26] add job for gitlab pages setup --- .gitlab-ci.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1fa026c4f..bc5f3c532 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -599,3 +599,18 @@ be-2-evs-26444: reports: junit: - report-junit.xml + +# job that sets up gitlab pages website +pages: + stage: deploy + tags: + - ivas-linux + rules: + - if: $UPDATE_PAGES + script: + - mkdir public + - echo "Hello BASOP world!" >> public/index.html + artifacts: + paths: + - public + expire_in: 1 day -- GitLab From f98867c34c0b8edcb9b34be9547f6869bb2d98a2 Mon Sep 17 00:00:00 2001 From: kiene Date: Wed, 22 May 2024 13:26:59 +0000 Subject: [PATCH 02/26] add missing stage in CI config --- .gitlab-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index bc5f3c532..a8381ea10 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -74,6 +74,7 @@ workflow: stages: + - deploy - build - test -- GitLab From f220b457dfb9b14435c2332318714c1b24e3b076 Mon Sep 17 00:00:00 2001 From: Jan Kiene Date: Wed, 22 May 2024 15:29:44 +0200 Subject: [PATCH 03/26] correct tag --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a8381ea10..af98e9964 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -605,7 +605,7 @@ be-2-evs-26444: pages: stage: deploy tags: - - ivas-linux + - ivas-basop-linux rules: - if: $UPDATE_PAGES script: -- GitLab From acb31f6c6ebc6935b569b1eda361a15eda52879f Mon Sep 17 00:00:00 2001 From: Jan Kiene Date: Wed, 22 May 2024 15:32:36 +0200 Subject: [PATCH 04/26] do not run build pipeline for pages update --- .gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index af98e9964..1cfcb97db 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -300,7 +300,7 @@ stages: # ensure that codec builds on linux build-codec-linux-make: rules: - - if: $CI_PIPELINE_SOURCE == 'web' + - if: $CI_PIPELINE_SOURCE == 'web' && "UPDATE_PAGES" == "" - if: $CI_PIPELINE_SOURCE == 'push' && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH - if: $CI_PIPELINE_SOURCE == 'merge_request_event' && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "main" # only have MR pipelines for MRs to main - if: $CI_PIPELINE_SOURCE == 'schedule' @@ -316,7 +316,7 @@ build-codec-linux-make: # ensure that codec builds on linux with instrumentation active build-codec-linux-instrumented-make: rules: - - if: $CI_PIPELINE_SOURCE == 'web' + - if: $CI_PIPELINE_SOURCE == 'web' && "UPDATE_PAGES" == "" - if: $CI_PIPELINE_SOURCE == 'push' && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH - if: $CI_PIPELINE_SOURCE == 'merge_request_event' && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "main" # only have MR pipelines for MRs to main - if: $CI_PIPELINE_SOURCE == 'schedule' -- GitLab From a394da0df6e92d87b45c8ef5d51aa4a126442e90 Mon Sep 17 00:00:00 2001 From: Jan Kiene Date: Wed, 22 May 2024 15:43:28 +0200 Subject: [PATCH 05/26] try pages job with getting the last ltv run id --- .gitlab-ci.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1cfcb97db..2762e62b2 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -576,7 +576,7 @@ be-2-evs-26444: timeout: "120 minutes" # To be revisited script: - *print-common-info - - *update-scripts-repo + - *update-scripts-repo - sed -i".bak" "s/\(#define EVS_FLOAT\)/\/\/\1/" lib_com/options.h - make -j @@ -603,14 +603,20 @@ be-2-evs-26444: # job that sets up gitlab pages website pages: + variables: + # TODO: only for testing, remove! + BASOP_CI_BRANCH_PC_REPO: "basop-ci/add-project-id-as-argument-for-get_id_of_last_job_occurence" stage: deploy tags: - ivas-basop-linux rules: - if: $UPDATE_PAGES script: + - *print-common-info + - *update-scripts-repo + - job_id=$(python3 ci/get_id_of_last_job_occurence.py $CI_COMMIT_REF_NAME ivas-pytest-mld-long-dec $CI_PROJECT_ID) - mkdir public - - echo "Hello BASOP world!" >> public/index.html + - echo "Hello BASOP world!\n\nLast long selftest run had id $job_id" >> public/index.html artifacts: paths: - public -- GitLab From ee181e0f0d070e3132f23477e58081b7b041f87a Mon Sep 17 00:00:00 2001 From: Jan Kiene Date: Wed, 22 May 2024 15:47:10 +0200 Subject: [PATCH 06/26] use correct variable --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2762e62b2..5cd4273c3 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -614,7 +614,7 @@ pages: script: - *print-common-info - *update-scripts-repo - - job_id=$(python3 ci/get_id_of_last_job_occurence.py $CI_COMMIT_REF_NAME ivas-pytest-mld-long-dec $CI_PROJECT_ID) + - job_id=$(python3 ci/get_id_of_last_job_occurence.py $CI_DEFAULT_BRANCH ivas-pytest-mld-long-dec $CI_PROJECT_ID) - mkdir public - echo "Hello BASOP world!\n\nLast long selftest run had id $job_id" >> public/index.html artifacts: -- GitLab From 0c045f8df27114905c624fd8b51313fd7e2fa091 Mon Sep 17 00:00:00 2001 From: Jan Kiene Date: Thu, 23 May 2024 11:09:57 +0200 Subject: [PATCH 07/26] run setup_pages.py script --- .gitlab-ci.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 5cd4273c3..01ea43106 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -614,9 +614,7 @@ pages: script: - *print-common-info - *update-scripts-repo - - job_id=$(python3 ci/get_id_of_last_job_occurence.py $CI_DEFAULT_BRANCH ivas-pytest-mld-long-dec $CI_PROJECT_ID) - - mkdir public - - echo "Hello BASOP world!\n\nLast long selftest run had id $job_id" >> public/index.html + - python3 ci/setup_pages.py artifacts: paths: - public -- GitLab From 20a19e96b72675fb42be9bddb272c47484330677 Mon Sep 17 00:00:00 2001 From: Jan Kiene Date: Fri, 24 May 2024 18:14:43 +0200 Subject: [PATCH 08/26] get id of last occurence in ltv job --- .gitlab-ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 01ea43106..cb8069abd 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -240,6 +240,8 @@ stages: - python3 scripts/parse_mld_xml.py report-junit.xml mld.csv + - if $UPDATE_PAGES; then python3 ci/get_id_of_last_job_occurence.py $CI_DEFAULT_BRANCH $CI_JOB_NAME $CI_PROJECT_ID; echo "Job ID: $CI_JOB_ID"; fi + - if [ $zero_errors != 1 ]; then echo "Run errors encountered!"; exit $EXIT_CODE_FAIL; fi - if [ $exit_code -eq 1 ]; then echo "Differences encountered"; exit $EXIT_CODE_NON_BE; fi - exit 0 -- GitLab From ac0db3911572683bd3d96f71197727c766324a2e Mon Sep 17 00:00:00 2001 From: kiene Date: Fri, 24 May 2024 16:17:01 +0000 Subject: [PATCH 09/26] Fix CI file --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index cb8069abd..1a6a36ec0 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -240,7 +240,7 @@ stages: - python3 scripts/parse_mld_xml.py report-junit.xml mld.csv - - if $UPDATE_PAGES; then python3 ci/get_id_of_last_job_occurence.py $CI_DEFAULT_BRANCH $CI_JOB_NAME $CI_PROJECT_ID; echo "Job ID: $CI_JOB_ID"; fi + - if [ $UPDATE_PAGES != "" ]; then python3 ci/get_id_of_last_job_occurence.py $CI_DEFAULT_BRANCH $CI_JOB_NAME $CI_PROJECT_ID; echo "Job ID - $CI_JOB_ID"; fi - if [ $zero_errors != 1 ]; then echo "Run errors encountered!"; exit $EXIT_CODE_FAIL; fi - if [ $exit_code -eq 1 ]; then echo "Differences encountered"; exit $EXIT_CODE_NON_BE; fi -- GitLab From efe6fabe03d2ca595dbfab0cff883e1f4542e88c Mon Sep 17 00:00:00 2001 From: Jan Kiene Date: Fri, 24 May 2024 18:20:00 +0200 Subject: [PATCH 10/26] stop test after first failure for faster checking --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1a6a36ec0..a563a404b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -235,7 +235,7 @@ stages: ### run pytest - exit_code=0 - - python3 -m pytest $TEST_SUITE -v --create_cut --html=report.html --self-contained-html --junit-xml=report-junit.xml --mld --dut_encoder_path $DUT_ENCODER_PATH --dut_decoder_path $DUT_DECODER_PATH -n auto --testcase_timeout $testcase_timeout || exit_code=$? + - python3 -m pytest $TEST_SUITE -v -x --create_cut --html=report.html --self-contained-html --junit-xml=report-junit.xml --mld --dut_encoder_path $DUT_ENCODER_PATH --dut_decoder_path $DUT_DECODER_PATH -n auto --testcase_timeout $testcase_timeout || exit_code=$? - zero_errors=$(cat report-junit.xml | grep -c 'errors="0"') || true - python3 scripts/parse_mld_xml.py report-junit.xml mld.csv -- GitLab From e71f59b178f71ce65b3a81fe0e1671707c44023f Mon Sep 17 00:00:00 2001 From: Jan Kiene Date: Fri, 24 May 2024 18:21:44 +0200 Subject: [PATCH 11/26] allow build jobs with UPDATE_PAGES --- .gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a563a404b..d7f836b8c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -302,7 +302,7 @@ stages: # ensure that codec builds on linux build-codec-linux-make: rules: - - if: $CI_PIPELINE_SOURCE == 'web' && "UPDATE_PAGES" == "" + - if: $CI_PIPELINE_SOURCE == 'web' - if: $CI_PIPELINE_SOURCE == 'push' && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH - if: $CI_PIPELINE_SOURCE == 'merge_request_event' && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "main" # only have MR pipelines for MRs to main - if: $CI_PIPELINE_SOURCE == 'schedule' @@ -318,7 +318,7 @@ build-codec-linux-make: # ensure that codec builds on linux with instrumentation active build-codec-linux-instrumented-make: rules: - - if: $CI_PIPELINE_SOURCE == 'web' && "UPDATE_PAGES" == "" + - if: $CI_PIPELINE_SOURCE == 'web' - if: $CI_PIPELINE_SOURCE == 'push' && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH - if: $CI_PIPELINE_SOURCE == 'merge_request_event' && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "main" # only have MR pipelines for MRs to main - if: $CI_PIPELINE_SOURCE == 'schedule' -- GitLab From f8b87bd4d3b06f359d69209a5d31f142f5ffa5d9 Mon Sep 17 00:00:00 2001 From: Jan Kiene Date: Mon, 27 May 2024 08:16:31 +0200 Subject: [PATCH 12/26] make try-out part use the new version of script --- .gitlab-ci.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d7f836b8c..b5968564e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -240,7 +240,9 @@ stages: - python3 scripts/parse_mld_xml.py report-junit.xml mld.csv - - if [ $UPDATE_PAGES != "" ]; then python3 ci/get_id_of_last_job_occurence.py $CI_DEFAULT_BRANCH $CI_JOB_NAME $CI_PROJECT_ID; echo "Job ID - $CI_JOB_ID"; fi + # TODO change back to this - need to get new version from branch so that the project id argument is there + #- if [ $UPDATE_PAGES != "" ]; then python3 ci/get_id_of_last_job_occurence.py $CI_DEFAULT_BRANCH $CI_JOB_NAME $CI_PROJECT_ID; echo "Job ID - $CI_JOB_ID"; fi + - if [ $UPDATE_PAGES != "" ]; then wget https://forge.3gpp.org/rep/ivas-codec-pc/ivas-codec/-/raw/3c1b6994912cbe6e3c5463b02a1a6c970f449b96/ci/get_id_of_last_job_occurence.py; python3 get_id_of_last_job_occurence.py $CI_DEFAULT_BRANCH $CI_JOB_NAME $CI_PROJECT_ID; echo "Job ID - $CI_JOB_ID"; fi - if [ $zero_errors != 1 ]; then echo "Run errors encountered!"; exit $EXIT_CODE_FAIL; fi - if [ $exit_code -eq 1 ]; then echo "Differences encountered"; exit $EXIT_CODE_NON_BE; fi -- GitLab From 6c4525403ee26397b047134aaf3ed88e3b77873a Mon Sep 17 00:00:00 2001 From: Jan Kiene Date: Mon, 27 May 2024 08:20:12 +0200 Subject: [PATCH 13/26] select only few tests for faster testing --- .gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b5968564e..f708445fd 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -235,14 +235,14 @@ stages: ### run pytest - exit_code=0 - - python3 -m pytest $TEST_SUITE -v -x --create_cut --html=report.html --self-contained-html --junit-xml=report-junit.xml --mld --dut_encoder_path $DUT_ENCODER_PATH --dut_decoder_path $DUT_DECODER_PATH -n auto --testcase_timeout $testcase_timeout || exit_code=$? + - python3 -m pytest $TEST_SUITE -v -k "stereo and MONO" --create_cut --html=report.html --self-contained-html --junit-xml=report-junit.xml --mld --dut_encoder_path $DUT_ENCODER_PATH --dut_decoder_path $DUT_DECODER_PATH -n auto --testcase_timeout $testcase_timeout || exit_code=$? - zero_errors=$(cat report-junit.xml | grep -c 'errors="0"') || true - python3 scripts/parse_mld_xml.py report-junit.xml mld.csv # TODO change back to this - need to get new version from branch so that the project id argument is there #- if [ $UPDATE_PAGES != "" ]; then python3 ci/get_id_of_last_job_occurence.py $CI_DEFAULT_BRANCH $CI_JOB_NAME $CI_PROJECT_ID; echo "Job ID - $CI_JOB_ID"; fi - - if [ $UPDATE_PAGES != "" ]; then wget https://forge.3gpp.org/rep/ivas-codec-pc/ivas-codec/-/raw/3c1b6994912cbe6e3c5463b02a1a6c970f449b96/ci/get_id_of_last_job_occurence.py; python3 get_id_of_last_job_occurence.py $CI_DEFAULT_BRANCH $CI_JOB_NAME $CI_PROJECT_ID; echo "Job ID - $CI_JOB_ID"; fi + - if [ $UPDATE_PAGES != "" ]; then wget https://forge.3gpp.org/rep/ivas-codec-pc/ivas-codec/-/raw/3c1b6994912cbe6e3c5463b02a1a6c970f449b96/ci/get_id_of_last_job_occurence.py; python3 get_id_of_last_job_occurence.py $CI_DEFAULT_BRANCH $CI_JOB_NAME $CI_PROJECT_ID; echo "Job ID from variables - $CI_JOB_ID"; fi - if [ $zero_errors != 1 ]; then echo "Run errors encountered!"; exit $EXIT_CODE_FAIL; fi - if [ $exit_code -eq 1 ]; then echo "Differences encountered"; exit $EXIT_CODE_NON_BE; fi -- GitLab From b80f0908b8c07a4b5dcfd49705a77f833a207fab Mon Sep 17 00:00:00 2001 From: Jan Kiene Date: Mon, 27 May 2024 08:25:44 +0200 Subject: [PATCH 14/26] also shorten ref creation --- .gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f708445fd..0962ab06d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -117,8 +117,8 @@ stages: - python3 tests/create_short_testvectors.py # create references - exit_code=0 - - python3 -m pytest $TEST_SUITE -v --update_ref 1 -m create_ref --create_ref -n auto || exit_code=$? - - python3 -m pytest $TEST_SUITE -v --update_ref 1 -m create_ref_part2 -n auto || exit_code=$? # Catch exit code to prevent halt in case this step produces zero tests + - python3 -m pytest $TEST_SUITE -v -k "stereo and MONO" --update_ref 1 -m create_ref --create_ref -n auto || exit_code=$? + - python3 -m pytest $TEST_SUITE -v -k "stereo and MONO" --update_ref 1 -m create_ref_part2 -n auto || exit_code=$? # Catch exit code to prevent halt in case this step produces zero tests .update-scripts-repo: &update-scripts-repo -- GitLab From 51062e075445b0f50c61aecc16cb1575a10ac160 Mon Sep 17 00:00:00 2001 From: Jan Kiene Date: Mon, 27 May 2024 08:34:30 +0200 Subject: [PATCH 15/26] move deplot stage last --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 0962ab06d..a9ee9f85a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -74,9 +74,9 @@ workflow: stages: - - deploy - build - test + - deploy # --------------------------------------------------------------- # Generic script anchors -- GitLab From a8e2fb3480e94157e795b8738f7fdca60a598a32 Mon Sep 17 00:00:00 2001 From: Jan Kiene Date: Mon, 27 May 2024 08:41:43 +0200 Subject: [PATCH 16/26] get mld file from prev job --- .gitlab-ci.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a9ee9f85a..360a40613 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -242,7 +242,11 @@ stages: # TODO change back to this - need to get new version from branch so that the project id argument is there #- if [ $UPDATE_PAGES != "" ]; then python3 ci/get_id_of_last_job_occurence.py $CI_DEFAULT_BRANCH $CI_JOB_NAME $CI_PROJECT_ID; echo "Job ID - $CI_JOB_ID"; fi - - if [ $UPDATE_PAGES != "" ]; then wget https://forge.3gpp.org/rep/ivas-codec-pc/ivas-codec/-/raw/3c1b6994912cbe6e3c5463b02a1a6c970f449b96/ci/get_id_of_last_job_occurence.py; python3 get_id_of_last_job_occurence.py $CI_DEFAULT_BRANCH $CI_JOB_NAME $CI_PROJECT_ID; echo "Job ID from variables - $CI_JOB_ID"; fi + - if [ $UPDATE_PAGES != "" ]; then wget https://forge.3gpp.org/rep/ivas-codec-pc/ivas-codec/-/raw/3c1b6994912cbe6e3c5463b02a1a6c970f449b96/ci/get_id_of_last_job_occurence.py; id_previous=$(python3 get_id_of_last_job_occurence.py $CI_DEFAULT_BRANCH $CI_JOB_NAME $CI_PROJECT_ID); echo "Job ID from variables - $CI_JOB_ID, Job ID from script: $id_previous"; fi + - curl --request GET "https://forge.3gpp.org/rep/api/v4/projects/$CI_PROJECT_ID/jobs/$id_previous/artifacts" --output artifacts.zip + - unzip artifacts.zip -d previous_artifacts + - head mld.csv + - head previous_artifacts/mld.csv - if [ $zero_errors != 1 ]; then echo "Run errors encountered!"; exit $EXIT_CODE_FAIL; fi - if [ $exit_code -eq 1 ]; then echo "Differences encountered"; exit $EXIT_CODE_NON_BE; fi -- GitLab From 0a457f8e84eaab39c9ab787432f4af4a2a959442 Mon Sep 17 00:00:00 2001 From: kiene Date: Mon, 27 May 2024 06:44:15 +0000 Subject: [PATCH 17/26] Fix .gitlab-ci.yml file --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 360a40613..129569b31 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -242,7 +242,7 @@ stages: # TODO change back to this - need to get new version from branch so that the project id argument is there #- if [ $UPDATE_PAGES != "" ]; then python3 ci/get_id_of_last_job_occurence.py $CI_DEFAULT_BRANCH $CI_JOB_NAME $CI_PROJECT_ID; echo "Job ID - $CI_JOB_ID"; fi - - if [ $UPDATE_PAGES != "" ]; then wget https://forge.3gpp.org/rep/ivas-codec-pc/ivas-codec/-/raw/3c1b6994912cbe6e3c5463b02a1a6c970f449b96/ci/get_id_of_last_job_occurence.py; id_previous=$(python3 get_id_of_last_job_occurence.py $CI_DEFAULT_BRANCH $CI_JOB_NAME $CI_PROJECT_ID); echo "Job ID from variables - $CI_JOB_ID, Job ID from script: $id_previous"; fi + - if [ $UPDATE_PAGES != "" ]; then wget https://forge.3gpp.org/rep/ivas-codec-pc/ivas-codec/-/raw/3c1b6994912cbe6e3c5463b02a1a6c970f449b96/ci/get_id_of_last_job_occurence.py; id_previous=$(python3 get_id_of_last_job_occurence.py $CI_DEFAULT_BRANCH $CI_JOB_NAME $CI_PROJECT_ID); echo "Job ID from variables - $CI_JOB_ID, Job ID from script - $id_previous"; fi - curl --request GET "https://forge.3gpp.org/rep/api/v4/projects/$CI_PROJECT_ID/jobs/$id_previous/artifacts" --output artifacts.zip - unzip artifacts.zip -d previous_artifacts - head mld.csv -- GitLab From 1f50bfb3d2434f1cc607ba5b3cdb1c8ad163c844 Mon Sep 17 00:00:00 2001 From: Jan Kiene Date: Mon, 27 May 2024 08:55:38 +0200 Subject: [PATCH 18/26] create html page in mld job --- .gitlab-ci.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 129569b31..ee1e55425 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -245,8 +245,9 @@ stages: - if [ $UPDATE_PAGES != "" ]; then wget https://forge.3gpp.org/rep/ivas-codec-pc/ivas-codec/-/raw/3c1b6994912cbe6e3c5463b02a1a6c970f449b96/ci/get_id_of_last_job_occurence.py; id_previous=$(python3 get_id_of_last_job_occurence.py $CI_DEFAULT_BRANCH $CI_JOB_NAME $CI_PROJECT_ID); echo "Job ID from variables - $CI_JOB_ID, Job ID from script - $id_previous"; fi - curl --request GET "https://forge.3gpp.org/rep/api/v4/projects/$CI_PROJECT_ID/jobs/$id_previous/artifacts" --output artifacts.zip - unzip artifacts.zip -d previous_artifacts - - head mld.csv - - head previous_artifacts/mld.csv + # This wildcard thingy relies on only one csv file being present per job + - file_previous="previous_artifacts/mld--ivas-pytest-mld-long-dec-$id_previous--sha-*.csv" + - python3 ci/basop-pages/create_report_pages.py index.html mld.csv $file_previous $CI_JOB_ID $id_previous $CI_JOB_NAME - if [ $zero_errors != 1 ]; then echo "Run errors encountered!"; exit $EXIT_CODE_FAIL; fi - if [ $exit_code -eq 1 ]; then echo "Differences encountered"; exit $EXIT_CODE_NON_BE; fi -- GitLab From 00a3d2cff8c899e00775b12a79833de0e7fc48ad Mon Sep 17 00:00:00 2001 From: Jan Kiene Date: Mon, 27 May 2024 12:06:41 +0200 Subject: [PATCH 19/26] debug printout + add html out to artifacts --- .gitlab-ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ee1e55425..d3a63f68b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -247,6 +247,7 @@ stages: - unzip artifacts.zip -d previous_artifacts # This wildcard thingy relies on only one csv file being present per job - file_previous="previous_artifacts/mld--ivas-pytest-mld-long-dec-$id_previous--sha-*.csv" + - ls ci - python3 ci/basop-pages/create_report_pages.py index.html mld.csv $file_previous $CI_JOB_ID $id_previous $CI_JOB_NAME - if [ $zero_errors != 1 ]; then echo "Run errors encountered!"; exit $EXIT_CODE_FAIL; fi @@ -264,6 +265,7 @@ stages: - report-junit.xml - report.html - mld.csv + - index.html expose_as: "pytest mld results" reports: junit: -- GitLab From d5e34420797df51906ac96c65078f54bb7b52757 Mon Sep 17 00:00:00 2001 From: Jan Kiene Date: Mon, 27 May 2024 12:15:33 +0200 Subject: [PATCH 20/26] temporarily get script from dev branch --- .gitlab-ci.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d3a63f68b..2a2c7a529 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -247,8 +247,9 @@ stages: - unzip artifacts.zip -d previous_artifacts # This wildcard thingy relies on only one csv file being present per job - file_previous="previous_artifacts/mld--ivas-pytest-mld-long-dec-$id_previous--sha-*.csv" - - ls ci - - python3 ci/basop-pages/create_report_pages.py index.html mld.csv $file_previous $CI_JOB_ID $id_previous $CI_JOB_NAME + # TODO: remove once that is merged to basop-ci-branch + - wget https://forge.3gpp.org/rep/ivas-codec-pc/ivas-codec/-/raw/basop-ci/add-project-id-as-argument-for-get_id_of_last_job_occurence/ci/basop-pages/create_report_pages.py + - python3 create_report_pages.py index.html mld.csv $file_previous $CI_JOB_ID $id_previous $CI_JOB_NAME - if [ $zero_errors != 1 ]; then echo "Run errors encountered!"; exit $EXIT_CODE_FAIL; fi - if [ $exit_code -eq 1 ]; then echo "Differences encountered"; exit $EXIT_CODE_NON_BE; fi -- GitLab From 811a51b43e42d0fdf8195881716de1063dcf5ceb Mon Sep 17 00:00:00 2001 From: Jan Kiene Date: Mon, 27 May 2024 12:56:41 +0200 Subject: [PATCH 21/26] add debug outpout --- .gitlab-ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2a2c7a529..f06a0c0f1 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -627,6 +627,8 @@ pages: - *print-common-info - *update-scripts-repo - python3 ci/setup_pages.py + - ls + - ls public artifacts: paths: - public -- GitLab From c0f3366e7d3b748302fe2cecce4dfb0fa0cc70d8 Mon Sep 17 00:00:00 2001 From: Jan Kiene Date: Mon, 27 May 2024 15:35:41 +0200 Subject: [PATCH 22/26] change name of artifact --- .gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f06a0c0f1..94398795a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -249,7 +249,7 @@ stages: - file_previous="previous_artifacts/mld--ivas-pytest-mld-long-dec-$id_previous--sha-*.csv" # TODO: remove once that is merged to basop-ci-branch - wget https://forge.3gpp.org/rep/ivas-codec-pc/ivas-codec/-/raw/basop-ci/add-project-id-as-argument-for-get_id_of_last_job_occurence/ci/basop-pages/create_report_pages.py - - python3 create_report_pages.py index.html mld.csv $file_previous $CI_JOB_ID $id_previous $CI_JOB_NAME + - python3 create_report_pages.py $CI_JOB_NAME-index.html mld.csv $file_previous $CI_JOB_ID $id_previous $CI_JOB_NAME - if [ $zero_errors != 1 ]; then echo "Run errors encountered!"; exit $EXIT_CODE_FAIL; fi - if [ $exit_code -eq 1 ]; then echo "Differences encountered"; exit $EXIT_CODE_NON_BE; fi @@ -266,7 +266,7 @@ stages: - report-junit.xml - report.html - mld.csv - - index.html + - $CI_JOB_NAME-index.html expose_as: "pytest mld results" reports: junit: -- GitLab From c1d885852b17347c05b9191f54885f214a936da0 Mon Sep 17 00:00:00 2001 From: Jan Kiene Date: Mon, 27 May 2024 15:42:54 +0200 Subject: [PATCH 23/26] remove temporary parts in CI file --- .gitlab-ci.yml | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 94398795a..d8fe48fcf 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -117,8 +117,8 @@ stages: - python3 tests/create_short_testvectors.py # create references - exit_code=0 - - python3 -m pytest $TEST_SUITE -v -k "stereo and MONO" --update_ref 1 -m create_ref --create_ref -n auto || exit_code=$? - - python3 -m pytest $TEST_SUITE -v -k "stereo and MONO" --update_ref 1 -m create_ref_part2 -n auto || exit_code=$? # Catch exit code to prevent halt in case this step produces zero tests + - python3 -m pytest $TEST_SUITE -v --update_ref 1 -m create_ref --create_ref -n auto || exit_code=$? + - python3 -m pytest $TEST_SUITE -v --update_ref 1 -m create_ref_part2 -n auto || exit_code=$? # Catch exit code to prevent halt in case this step produces zero tests .update-scripts-repo: &update-scripts-repo @@ -235,21 +235,20 @@ stages: ### run pytest - exit_code=0 - - python3 -m pytest $TEST_SUITE -v -k "stereo and MONO" --create_cut --html=report.html --self-contained-html --junit-xml=report-junit.xml --mld --dut_encoder_path $DUT_ENCODER_PATH --dut_decoder_path $DUT_DECODER_PATH -n auto --testcase_timeout $testcase_timeout || exit_code=$? + - python3 -m pytest $TEST_SUITE -v --create_cut --html=report.html --self-contained-html --junit-xml=report-junit.xml --mld --dut_encoder_path $DUT_ENCODER_PATH --dut_decoder_path $DUT_DECODER_PATH -n auto --testcase_timeout $testcase_timeout || exit_code=$? - zero_errors=$(cat report-junit.xml | grep -c 'errors="0"') || true - python3 scripts/parse_mld_xml.py report-junit.xml mld.csv - # TODO change back to this - need to get new version from branch so that the project id argument is there - #- if [ $UPDATE_PAGES != "" ]; then python3 ci/get_id_of_last_job_occurence.py $CI_DEFAULT_BRANCH $CI_JOB_NAME $CI_PROJECT_ID; echo "Job ID - $CI_JOB_ID"; fi - - if [ $UPDATE_PAGES != "" ]; then wget https://forge.3gpp.org/rep/ivas-codec-pc/ivas-codec/-/raw/3c1b6994912cbe6e3c5463b02a1a6c970f449b96/ci/get_id_of_last_job_occurence.py; id_previous=$(python3 get_id_of_last_job_occurence.py $CI_DEFAULT_BRANCH $CI_JOB_NAME $CI_PROJECT_ID); echo "Job ID from variables - $CI_JOB_ID, Job ID from script - $id_previous"; fi - - curl --request GET "https://forge.3gpp.org/rep/api/v4/projects/$CI_PROJECT_ID/jobs/$id_previous/artifacts" --output artifacts.zip - - unzip artifacts.zip -d previous_artifacts + - if [ $UPDATE_PAGES != "" ]; then + - id_previous=$(python3 get_id_of_last_job_occurence.py $CI_DEFAULT_BRANCH $CI_JOB_NAME $CI_PROJECT_ID) + - echo "Job ID from variables - $CI_JOB_ID, Job ID from script - $id_previous" + - curl --request GET "https://forge.3gpp.org/rep/api/v4/projects/$CI_PROJECT_ID/jobs/$id_previous/artifacts" --output artifacts.zip + - unzip artifacts.zip -d previous_artifacts # This wildcard thingy relies on only one csv file being present per job - - file_previous="previous_artifacts/mld--ivas-pytest-mld-long-dec-$id_previous--sha-*.csv" - # TODO: remove once that is merged to basop-ci-branch - - wget https://forge.3gpp.org/rep/ivas-codec-pc/ivas-codec/-/raw/basop-ci/add-project-id-as-argument-for-get_id_of_last_job_occurence/ci/basop-pages/create_report_pages.py - - python3 create_report_pages.py $CI_JOB_NAME-index.html mld.csv $file_previous $CI_JOB_ID $id_previous $CI_JOB_NAME + - file_previous="previous_artifacts/mld--ivas-pytest-mld-long-dec-$id_previous--sha-*.csv" + - python3 ci/basop-pages/create_report_pages.py $CI_JOB_NAME-index.html mld.csv $file_previous $CI_JOB_ID $id_previous $CI_JOB_NAME + - fi - if [ $zero_errors != 1 ]; then echo "Run errors encountered!"; exit $EXIT_CODE_FAIL; fi - if [ $exit_code -eq 1 ]; then echo "Differences encountered"; exit $EXIT_CODE_NON_BE; fi -- GitLab From a484c51927191535530ea79c4ba799b0300b3c0a Mon Sep 17 00:00:00 2001 From: Jan Kiene Date: Mon, 27 May 2024 16:12:50 +0200 Subject: [PATCH 24/26] adjust if and provide default html file for artifacts --- .gitlab-ci.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c4e2a186d..0c09ffe46 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -242,7 +242,7 @@ stages: - python3 scripts/parse_mld_xml.py report-junit.xml $MLD_ARTIFACT_NAME - - if [ $UPDATE_PAGES != "" ]; then + - if [ $USE_LTV -eq 1 ] && [ "$CI_COMMIT_BRANCH" == "$CI_DEFAULT_BRANCH" ]; then - id_previous=$(python3 get_id_of_last_job_occurence.py $CI_DEFAULT_BRANCH $CI_JOB_NAME $CI_PROJECT_ID) - echo "Job ID from variables - $CI_JOB_ID, Job ID from script - $id_previous" - curl --request GET "https://forge.3gpp.org/rep/api/v4/projects/$CI_PROJECT_ID/jobs/$id_previous/artifacts" --output artifacts.zip @@ -250,6 +250,9 @@ stages: # This wildcard thingy relies on only one csv file being present per job - file_previous="previous_artifacts/mld--ivas-pytest-mld-long-dec-$id_previous--sha-*.csv" - python3 ci/basop-pages/create_report_pages.py $CI_JOB_NAME-index.html $MLD_ARTIFACT_NAME $file_previous $CI_JOB_ID $id_previous $CI_JOB_NAME + - else + # create empty file for artifacts to avoid errors + - touch $CI_JOB_NAME-index.html - fi - if [ $zero_errors != 1 ]; then echo "Run errors encountered!"; exit $EXIT_CODE_FAIL; fi -- GitLab From 14b98fe48df61c1b956fb024d9a495b68ac4c3e5 Mon Sep 17 00:00:00 2001 From: Jan Kiene Date: Mon, 27 May 2024 16:13:37 +0200 Subject: [PATCH 25/26] remove temporary variable overwrite --- .gitlab-ci.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 0c09ffe46..db64eb93b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -619,9 +619,6 @@ be-2-evs-26444: # job that sets up gitlab pages website pages: - variables: - # TODO: only for testing, remove! - BASOP_CI_BRANCH_PC_REPO: "basop-ci/add-project-id-as-argument-for-get_id_of_last_job_occurence" stage: deploy tags: - ivas-basop-linux -- GitLab From 46984d172a16402435fab60e70588d15a76d1d48 Mon Sep 17 00:00:00 2001 From: Jan Kiene Date: Tue, 28 May 2024 09:12:42 +0200 Subject: [PATCH 26/26] add merged csv file to artifacts --- .gitlab-ci.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index db64eb93b..9bfbcb4ce 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -249,10 +249,11 @@ stages: - unzip artifacts.zip -d previous_artifacts # This wildcard thingy relies on only one csv file being present per job - file_previous="previous_artifacts/mld--ivas-pytest-mld-long-dec-$id_previous--sha-*.csv" - - python3 ci/basop-pages/create_report_pages.py $CI_JOB_NAME-index.html $MLD_ARTIFACT_NAME $file_previous $CI_JOB_ID $id_previous $CI_JOB_NAME + - python3 ci/basop-pages/create_report_pages.py $CI_JOB_NAME-index.html $CI_JOB_NAME--merged_csv--$CI_JOB_ID--$id_previous.csv $MLD_ARTIFACT_NAME $file_previous $CI_JOB_ID $id_previous $CI_JOB_NAME - else # create empty file for artifacts to avoid errors - touch $CI_JOB_NAME-index.html + - touch $CI_JOB_NAME--merged_csv--$CI_JOB_ID--$id_previous.csv - fi - if [ $zero_errors != 1 ]; then echo "Run errors encountered!"; exit $EXIT_CODE_FAIL; fi @@ -271,6 +272,7 @@ stages: - report.html - $CI_JOB_NAME-index.html - $MLD_ARTIFACT_NAME + - $CI_JOB_NAME-merged_csv--$CI_JOB_ID--$id_previous.csv expose_as: "pytest mld results" reports: junit: -- GitLab