Commit 99e7cdad authored by Tapani Pihlajakuja's avatar Tapani Pihlajakuja
Browse files

Merge remote-tracking branch 'origin/main' into ci/add-stacktrace-to-all-ubsan

parents d156c725 10da78db
Loading
Loading
Loading
Loading

.gitlab-ci-custom.yml

0 → 100644
+4 −0
Original line number Diff line number Diff line
include:
  - project: $CUSTOM_CI_PROJECT
    ref: $CUSTOM_CI_REF
    file: $CUSTOM_CI_FILE
+32 −3
Original line number Diff line number Diff line
@@ -147,6 +147,15 @@ workflow:
    - if: $CI_PIPELINE_SOURCE == 'push'
      when: never

.rules-pytest-to-ref-pre:
  rules:
    - if: $CI_PIPELINE_SOURCE == 'web'
    - if: $CI_PIPELINE_SOURCE == 'schedule'
    - if: $CI_PIPELINE_SOURCE == 'push'
      when: never
    - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
      when: never

.rules-pytest-to-ref-short:
  rules:
    - if: $PYTEST_MLD_SHORT # Set by scheduled pipeline
@@ -240,9 +249,10 @@ workflow:
    - if [ ! -d "$TESTV_DIR" ]; then mkdir -p $TESTV_DIR; fi
    - cp -r scripts/testv/* $TESTV_DIR/

# This anchor is the basis for manual and scheduled tests comparing to float ref (ivas-float-update)
.ivas-pytest-anchor: &ivas-pytest-anchor
  stage: test
  needs: ["build-codec-linux-make"]
  needs: ["build-codec-linux-make", "pytest-to-ref-pre"]
  timeout: "480 minutes"
  variables:
    # keep "mld" in artifact name for backwards compatibility reasons
@@ -267,6 +277,8 @@ workflow:
    - else
    -    testcase_timeout=$TESTCASE_TIMEOUT_STV
    - fi
    - FLOAT_REF_COMMIT=$(cat "$FLOAT_REF_COMMIT_FILE")
    - echo "FLOAT_REF_COMMIT=$FLOAT_REF_COMMIT"

    - python3 ci/remove_unsupported_testcases.py $PRM_FILES
    - if [ $LEVEL_SCALING != "1.0" ]; then
@@ -913,6 +925,23 @@ clang-format-check:
    name: "$ARTIFACT_BASE_NAME"
    expose_as: "formatting patch"


# This job runs in manual jobs and scheduled jobs that compares to the float reference.
# It fetches the latest commit of ivas-float-update and stores in FLOAT_COMMIT_REF
pytest-to-ref-pre:
  extends:
    - .job-linux
    - .rules-pytest-to-ref-pre
  stage: prevalidate
  script:
    - git fetch origin ivas-float-update
    - FLOAT_REF_COMMIT="$(git rev-parse "origin/ivas-float-update")"
    - echo "$FLOAT_REF_COMMIT" > $FLOAT_REF_COMMIT_FILE
  artifacts:
    paths:
      - $FLOAT_REF_COMMIT_FILE
    reports:
      dotenv: commits.env
# ---------------------------------------------------------------
# Build jobs
# ---------------------------------------------------------------
@@ -1000,6 +1029,7 @@ build-codec-sanitizers-linux:
  script:
    - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/print-common-info.sh
    - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/basop/update-scripts-repo.sh
    - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/activate-Werror-linux.sh
    - bash ci/build_codec_sanitizers_linux.sh

build-codec-linux-debugging-make:
@@ -1738,8 +1768,7 @@ renderer-usan:
  stage: test
  needs: ["build-codec-sanitizers-linux"]
  extends:
    # TODO: also run on ivas-float-update once bugs are fixed
    - .rules-merge-request-to-main-no-draft
    - .rules-merge-request-no-draft
    - .test-job-linux
  artifacts:
    name: "mr-$CI_MERGE_REQUEST_IID--sha-$CI_COMMIT_SHORT_SHA--job-$CI_JOB_NAME--results"
+76 −0
Original line number Diff line number Diff line
#!/usr/bin/env bash
set -euo pipefail

usage() {
  cat <<'EOF'
Usage: coverage_cli.sh --obj-dir DIR --output-file FILE --output-dir DIR --title STRING

Generates lcov coverage, removes "apps" and "lib_util" from coverage, normalizes paths,
and produces an HTML report with a title.

Required arguments:
  --obj-dir       Directory containing object files (.gcno/.gcda)
  --output-file   Path to lcov tracefile (.info)
  --output-dir    Directory to write HTML report
  --title         Title suffix for HTML report
EOF
}

obj_dir=""
output_file=""
output_dir=""
title=""

# Parse arguments
while [[ $# -gt 0 ]]; do
  case "$1" in
  --obj-dir)
    obj_dir="${2:-}"
    shift 2
    ;;
  --output-file)
    output_file="${2:-}"
    shift 2
    ;;
  --output-dir)
    output_dir="${2:-}"
    shift 2
    ;;
  --title)
    title="${2:-}"
    shift 2
    ;;
  -h | --help)
    usage
    exit 0
    ;;
  *)
    echo "Unknown option: $1" >&2
    usage
    exit 1
    ;;
  esac
done

# Validate required args
if [[ -z "$obj_dir" || -z "$output_file" || -z "$output_dir" || -z "$title" ]]; then
  echo "Error: missing required arguments." >&2
  usage
  exit 1
fi

# Capture coverage
lcov -c -d "$obj_dir" -o "$output_file"

# Remove apps, lib_debug and lib_util files from coverage
lcov -r "$output_file" "*apps*" -o "$output_file"
lcov -r "$output_file" "*lib_util*" -o "$output_file"
lcov -r "$output_file" "*lib_debug*" -o "$output_file"

commit_sha="$(git rev-parse HEAD)"

# Replace absolute path with '.' to ease merging of .info files (assumes GNU sed)
sed -i "s|$(pwd)|.|g" "$output_file"

# Generate HTML report
genhtml "$output_file" -o "$output_dir" -t "$title @ $commit_sha"
+22 −0
Original line number Diff line number Diff line
#! /bin/bash

set -euxo pipefail

if [ $# -ne 1 ]; then
  echo "Usage: $0 <branchname>"
  exit 1
fi

branchname=$1
clone_dir="ivas-basop"

cd "${CI_PROJECT_DIR}"

git clone -b $branchname https://forge.3gpp.org/rep/sa4/audio/ivas-basop.git --single-branch --depth 1 $clone_dir

make -C $clone_dir -j

cp $clone_dir/IVAS_cod ./
cp $clone_dir/IVAS_dec ./
cp $clone_dir/IVAS_rend ./
cp $clone_dir/ISAR_post_rend ./