Skip to content

Commit

Permalink
ci: generate coverage info for nuttx jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
sobuch committed Nov 4, 2024
1 parent 1c778dd commit fe8105c
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 41 deletions.
2 changes: 1 addition & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -331,8 +331,8 @@ create_coverage_reports:
for each_folder in $folder_list ;
do
lcov --gcov-tool ${PWD}/${each_folder}/esp_cov_files/gcov --capture --directory ${each_folder}/esp_cov_files --output-file ${each_folder}/${each_folder}.info;
cp ${each_folder}/*.info cov_infos;
done
- cp `find . -wholename "./build_test_app*/*.info" -size +0` cov_infos
- ls -la cov_infos/
# Creating a html report of coverage files.
- genhtml --ignore-errors source cov_infos/*.info -o lcov_html_report/
Expand Down
3 changes: 2 additions & 1 deletion .gitlab/ci/test-sanitizers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
- !reference [.submodules_mirror_update, script]
- !reference [.export_toolchain, script]
- export ASAN_OPTIONS=detect_invalid_pointer_pairs=2:print_stacktrace=1:strict_string_checks=1:halt_on_error=0:allocator_may_return_null=1
- . $PWD/${TEST_RUN_DIR}/gen_ut_app/gcov_data/gcov_env.sh
- !reference [.run_tests_linux, script]

.tests_sanitizers_master_template:
Expand Down Expand Up @@ -444,7 +445,7 @@ test_sanitizers_nuttx_esp32:
- mkdir -p $TEST_RUN_DIR/$NUTTX_APP_NAME
- !reference [.copy_nuttx_files, script]
- export ASAN_OPTIONS=detect_invalid_pointer_pairs=2:print_stacktrace=1:strict_string_checks=1:halt_on_error=0:allocator_may_return_null=1
- !reference [.run_tests_nuttx, script]
- !reference [.run_tests_linux, script]

###########
# MISC #
Expand Down
39 changes: 13 additions & 26 deletions .gitlab/ci/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
script:
- !reference [.submodules_mirror_update, script]
- !reference [.export_toolchain, script]
- . $PWD/${TEST_RUN_DIR}/gen_ut_app/gcov_data/gcov_env.sh
- !reference [.run_tests_linux, script]
after_script:
# Below lines gets esp related file paths from tools/format-esp.sh
Expand Down Expand Up @@ -701,35 +702,21 @@ tests_on_linux:

# nuttx build environment is nuttx/build-env-v5.1
.test_nuttx_template:
extends: .tests_armhf_template
image: $CI_DOCKER_REGISTRY/target-test-env-v5.1:1
stage: test_nuttx
allow_failure: true
inherit:
default:
- interruptible
# Dont retry
tags:
- $CHIP
- jtag
artifacts:
paths:
- $TEST_RUN_DIR/debug_backend_tests.log
reports:
junit:
- $TEST_RUN_DIR/results/*
when: always
expire_in: 1 week
before_script:
- pip install unittest-xml-reporting --no-deps
- pip install pygdbmi==0.9.0.2
variables:
RUNNER_SCRIPT_TIMEOUT: 5m
PLATFORM_NAME: "linux-armhf-test"
ESP_TOOLCHAIN: "${ESP_V5_1X_TOOLCHAIN_VER}"
ESP_GDB_TOOLCHAIN: "${ESP_V5_1X_XTENSA_GDB_TOOLCHAIN}"
TOOLCHAIN_PREFIX: "xtensa-${CHIP}"
CHIP_TEST_TOOLCHAIN: "xtensa-${CHIP}"
TEST_RUN_DIR: "nuttx_test"
TOOLCHAIN_PREFIX: "xtensa-${CHIP_NAME}"
CHIP_TEST_TOOLCHAIN: "xtensa-${CHIP_NAME}"
TEST_RUN_DIR: "build_test_app_${CHIP_NAME}_nuttx_test"
NUTTX_APP_NAME: "nuttx_openocd"
OOCD_CMDS: "set ESP_RTOS nuttx,set ESP_ONLYCPU 1"
TEST_RUN_EXTRA_OPTS: "-i other -b ${TEST_BOARD} -p test_nuttx -e *.*Encrypted"
Expand All @@ -738,40 +725,40 @@ tests_on_linux:
- job: build_nuttx_app
artifacts: false
- project: idf/apache/esp-nuttx-apps
job: build_openocd_${CHIP}
job: build_openocd_${CHIP_NAME}
ref: master
script:
- !reference [.export_toolchain, script]
- mkdir -p $TEST_RUN_DIR/$NUTTX_APP_NAME
- !reference [.copy_nuttx_files, script]
- !reference [.run_tests_nuttx, script]
- !reference [.run_tests_linux, script]

test_nuttx_esp32:
extends:
- .test_nuttx_template
variables:
CHIP: esp32
CHIP_NAME: esp32
TEST_BOARD: "esp32-wrover-kit-3.3v"

test_nuttx_esp32s2:
extends:
- .test_nuttx_template
variables:
CHIP: esp32s2
CHIP_NAME: esp32s2
TEST_BOARD: "esp32s2-devkitj"

test_nuttx_esp32s3:
extends:
- .test_nuttx_template
variables:
CHIP: esp32s3
CHIP_NAME: esp32s3
TEST_BOARD: "esp32s3-ftdi"

test_nuttx_esp32c3:
extends:
- .test_nuttx_template
variables:
CHIP: esp32c3
CHIP_NAME: esp32c3
TEST_BOARD: "esp32c3-ftdi"
TOOLCHAIN_PREFIX: "riscv32-esp"
ESP_GDB_TOOLCHAIN: "${ESP_V5_1X_RISCV_GDB_TOOLCHAIN}"
Expand All @@ -784,7 +771,7 @@ test_nuttx_esp32c6:
- esp32c6
- usb_serial_jtag
variables:
CHIP: esp32c6
CHIP_NAME: esp32c6
TEST_BOARD: "esp32c6-builtin"
TOOLCHAIN_PREFIX: "riscv32-esp"
ESP_GDB_TOOLCHAIN: "${ESP_V5_1X_RISCV_GDB_TOOLCHAIN}"
Expand All @@ -797,7 +784,7 @@ test_nuttx_esp32h2:
- esp32h2
- usb_serial_jtag
variables:
CHIP: esp32h2
CHIP_NAME: esp32h2
TEST_BOARD: "esp32h2-builtin"
TOOLCHAIN_PREFIX: "riscv32-esp"
ESP_GDB_TOOLCHAIN: "${ESP_V5_1X_RISCV_GDB_TOOLCHAIN}"
Expand Down
13 changes: 0 additions & 13 deletions .gitlab/ci/util.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
tar -C ${TEST_RUN_DIR} -x -m -f ${DIST_ART_DIR}/${ARCHIVE_NAME}
export DIST_DIR=${PWD}/${TEST_RUN_DIR}/${DIST_INSTALLED_DIR}
export PYTHONPATH=$PWD/${TEST_RUN_DIR}:$PWD/testing/esp/py_debug_backend
. $PWD/${TEST_RUN_DIR}/gen_ut_app/gcov_data/gcov_env.sh
echo "CHIP_TEST_TOOLCHAIN: ${CHIP_TEST_TOOLCHAIN}"
testing/esp/run_tests.py -o $DIST_DIR/bin/openocd -s $DIST_DIR/share/openocd/scripts -a $PWD/$TEST_RUN_DIR -t ${CHIP_TEST_TOOLCHAIN}-elf- -d 4 -l $PWD/$TEST_RUN_DIR/debug_backend_tests.log -tr x -to $PWD/$TEST_RUN_DIR/results $TEST_RUN_EXTRA_OPTS -c "${OOCD_CMDS}"

Expand All @@ -46,15 +45,3 @@
.copy_nuttx_files:
script:
- *copy_nuttx_files_snippet


.run_tests_nuttx_snippet: &run_tests_nuttx_snippet |
ARCHIVE_NAME=$(cat ${DIST_ART_DIR}/dist_name_${PLATFORM_NAME})
tar -C ${TEST_RUN_DIR} -x -f ${DIST_ART_DIR}/${ARCHIVE_NAME}
export DIST_DIR=${PWD}/${TEST_RUN_DIR}/${DIST_INSTALLED_DIR}
export PYTHONPATH=$PWD/${TEST_RUN_DIR}:$PWD/testing/esp/py_debug_backend
testing/esp/run_tests.py -o $DIST_DIR/bin/openocd -s $DIST_DIR/share/openocd/scripts -a $PWD/$TEST_RUN_DIR -t ${CHIP_TEST_TOOLCHAIN}-elf- -d 4 -l $PWD/$TEST_RUN_DIR/debug_backend_tests.log -tr x -to $PWD/$TEST_RUN_DIR/results $TEST_RUN_EXTRA_OPTS -c "${OOCD_CMDS}"

.run_tests_nuttx:
script:
- *run_tests_nuttx_snippet

0 comments on commit fe8105c

Please sign in to comment.