CI: Updates esp-modbus CI to use dynamic pipelines

This commit is contained in:
Euripedes Rocha
2026-04-16 12:01:26 +02:00
committed by Alex Lisitsyn
parent ae50bb772b
commit a7a33ce503
21 changed files with 358 additions and 422 deletions
+21
View File
@@ -0,0 +1,21 @@
## EXAMPLES Folder
examples/tcp/mb_tcp_master:
disable:
- if: ((CONFIG_NAME == "wifi" or CONFIG_NAME == "default") and SOC_WIFI_SUPPORTED != 1)
examples/tcp/mb_tcp_slave:
disable:
- if: ((CONFIG_NAME == "wifi" or CONFIG_NAME == "default") and SOC_WIFI_SUPPORTED != 1)
## TEST APPS Folder
test_apps/physical_tests:
disable:
- if: (CONFIG_NAME == "wifi" and SOC_WIFI_SUPPORTED != 1)
test_apps/tcp_instances_tests/mb_tcp_master_instances:
disable:
- if: (CONFIG_NAME == "wifi" and SOC_WIFI_SUPPORTED != 1)
test_apps/tcp_instances_tests/mb_tcp_slave_instances:
disable:
- if: (CONFIG_NAME == "wifi" and SOC_WIFI_SUPPORTED != 1)
+3 -59
View File
@@ -9,73 +9,17 @@ workflow:
stages:
- pre_check
- build
- target_test
- test
- deploy
variables:
# System environment
ESP_DOCS_ENV_IMAGE: "$CI_DOCKER_REGISTRY/esp-idf-doc-env-v5.3:1-1"
ESP_DOCS_PATH: "$CI_PROJECT_DIR"
TEST_DIR: "$CI_PROJECT_DIR"
# GitLab-CI environment
GET_SOURCES_ATTEMPTS: "10"
ARTIFACT_DOWNLOAD_ATTEMPTS: "10"
GIT_SUBMODULE_STRATEGY: none
# Define a matrix for IDF versions and their corresponding targets
.options_list:
# versions:
# IDF_VER: ["latest", "v5.5", "v5.3"]
analyzers:
ANALYZER_TYPE: [gcc, clang]
markers:
TEST_MARKER:
- "tcp"
- "serial"
# - "generic" // Disabling during the CI refactor on tests
# - "tcp_p4"
# - "serial_p4"
# Shared script helpers (referenced from included files via !reference)
.setup_idf_tools_script:
script:
- tools/idf_tools.py --non-interactive install && eval "$(tools/idf_tools.py --non-interactive export)" || exit 1
.add_gh_key_remote_script:
script:
- |
command -v ssh-agent >/dev/null || exit 1
eval $(ssh-agent -s)
printf '%s\n' "${GH_PUSH_KEY}" | tr -d '\r' | ssh-add - > /dev/null
mkdir -p ~/.ssh && chmod 700 ~/.ssh
[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config || ssh-keyscan -t rsa github.com >> ~/.ssh/known_hosts
git remote remove github || true
git remote add github ${GH_PUSH_REPO}
.check_idf_ver_script:
script:
- |
export IDF_PATH=$(find /opt -type d -name "*idf*" \
\( -exec test -f '{}/tools/idf.py' \; -and -exec test -f '{}/tools/idf_tools.py' \; \
\) -print -quit)
if [ -z "${IDF_PATH}" ];then
echo "IDF version is not found."
else
cd ${IDF_PATH}
export IDF_DESCRIBE=$(git describe)
export IDF_VERSION=${IDF_DESCRIBE%-*}
echo "$IDF_VERSION" >> $TEST_DIR/idf_version_info.txt
echo "ESP-IDF: $IDF_VERSION"
fi
after_script:
# Just for cleaning space, no other causes
- git clean -ffdx
include:
- local: ".gitlab/ci/pre-check.yml"
- local: ".gitlab/ci/ci-build.yml"
- local: ".gitlab/ci/build_test_pipeline.yml"
- local: ".gitlab/ci/docs.yml"
- local: ".gitlab/ci/test.yml"
- local: ".gitlab/ci/deploy.yml"
- local: ".gitlab/ci/prebuild_report.yml"
+32
View File
@@ -0,0 +1,32 @@
# Component-based build/test pipeline for esp-modbus
include:
- component: $CI_SERVER_FQDN/ci/actions/idf-dynamic-pipeline/ci-component@main
inputs:
build-job-image: "espressif/idf:latest"
test-job-image: "$CI_DOCKER_REGISTRY/target-test-env-v6.1:1"
build-job-tags: ["build"]
job-suffix: ":idf-latest"
- component: $CI_SERVER_FQDN/ci/actions/idf-dynamic-pipeline/ci-component@main
inputs:
build-job-image: "espressif/idf:release-v6.0"
test-job-image: "$CI_DOCKER_REGISTRY/target-test-env-v6.0:2"
build-job-tags: ["build"]
job-suffix: ":idf-v6.0"
- component: $CI_SERVER_FQDN/ci/actions/idf-dynamic-pipeline/ci-component@main
inputs:
build-job-image: "espressif/idf:release-v5.5"
test-job-image: "$CI_DOCKER_REGISTRY/target-test-env-v5.5:2"
build-job-tags: ["build"]
job-suffix: ":idf-v5.5"
- component: $CI_SERVER_FQDN/ci/actions/idf-dynamic-pipeline/ci-component@main
inputs:
build-job-image: "espressif/idf:release-v5.4"
test-job-image: "$CI_DOCKER_REGISTRY/target-test-env-v5.4:2"
build-job-tags: ["build"]
job-suffix: ":idf-v5.4"
- component: $CI_SERVER_FQDN/ci/actions/idf-dynamic-pipeline/ci-component@main
inputs:
build-job-image: "espressif/idf:release-v5.3"
test-job-image: "$CI_DOCKER_REGISTRY/target-test-env-v5.3:1"
build-job-tags: ["build"]
job-suffix: ":idf-v5.3"
-110
View File
@@ -1,110 +0,0 @@
.build_template:
stage: build
tags:
- build
variables:
SIZE_INFO_LOCATION: "${TEST_DIR}/size_info.txt"
IDF_CCACHE_ENABLE: "1"
after_script:
- test "$CI_CCACHE_STATS" == 1 && test -n "$(which ccache)" && ccache --show-stats || true
dependencies: []
.build_cur_folder_script:
script:
- |
echo "Build job ${CI_JOB_NAME}, folder: ${PWD##*/}, targets: ${TEST_TARGETS}"
python -m idf_build_apps build -v -p . \
--recursive \
--target all \
--default-build-targets ${TEST_TARGETS} \
--config "sdkconfig.ci.*=" \
--build-dir "build_@t_@w" \
--build-log build_log.txt \
--check-warnings \
--ignore-warning-file ${TEST_DIR}/tools/ignore_build_warnings.txt \
--collect-size-info $SIZE_INFO_LOCATION \
--manifest-rootpath . \
--manifest-file .build-test-rules.yml \
--parallel-count ${CI_NODE_TOTAL:-1} \
--parallel-index ${CI_NODE_INDEX:-1}
echo "delete build folders:" $(find . -type d -regex '^\./.*build_esp32[a-or-z]+[0-9]+[_a-z]*' -print -exec rm -rf {} +)
ls -lh > test_dir_${PWD##*/}.txt
.before_script_build_jobs:
before_script:
- !reference [.check_idf_ver_script, script]
- !reference [.setup_idf_tools_script, script]
#- COMPOTE_VER_START=$(compote version)
#- pip install idf-component-manager --upgrade # to avoid the issue with component manager v2.4.3
- pip install "idf_build_apps" --upgrade
- COMPOTE_VER=$(compote version)
- echo "Component manager version ${COMPOTE_VER}"
- PIP_VERS=$(python -m pip freeze)
- echo "PIP component versions ${PIP_VERS}"
# Allows to debug jobs overriding the ESP_MODBUS_CONFIG_KEY to ESP_MODBUS_CONFIG_VALUE
# in all registered application configs that match the pattern ESP_MODBUS_CONFIG_PATTERN
- echo "Setup job with parameters ${ESP_MODBUS_CONFIG_KEY}, ${ESP_MODBUS_CONFIG_VALUE}, ${ESP_MODBUS_CONFIG_PATTERN}"
- ${TEST_DIR}/tools/setup_config_key.sh "${ESP_MODBUS_CONFIG_KEY}" "${ESP_MODBUS_CONFIG_VALUE}" "${ESP_MODBUS_CONFIG_PATTERN}"
# This template gets expanded multiple times, once for every IDF version.
# IDF version is specified by setting the espressif/idf image tag.
#
# TEST_TARGETS sets the list of IDF_TARGET values to build the test for.
# It should contain only the targets with optimized assembly implementations.
#
.build_pytest_template:
stage: build
extends:
- .build_template
- .before_script_build_jobs
needs:
- job: check_pre_commit
artifacts: false
optional: true
script:
- cd ${TEST_DIR}/test_apps
- !reference [.build_cur_folder_script, script]
- cd ${TEST_DIR}/examples
- export TEST_TARGETS="esp32" # override to build only on esp32 target to decrease build time
- !reference [.build_cur_folder_script, script]
variables:
TEST_TARGETS: "esp32"
dependencies: []
artifacts:
name: artifacts_${CI_JOB_NAME}
paths:
- "**/build*/size.json"
- "**/build*/build.log"
- "**/build*/build_log.txt"
- "**/build*/*.bin"
- "**/build*/*.elf"
- "**/build*/*.map"
- "**/build*/flasher_args.json"
- "**/build*/flash_project_args"
- "**/build*/config/sdkconfig.json"
- "**/build*/bootloader/*.bin"
- "**/build*/partition_table/*.bin"
- "**/idf_version_info.txt"
- "**/test_dir*.txt"
- "**/warnings.txt"
- $SIZE_INFO_LOCATION
when: always
expire_in: 3 weeks
build_idf_latest:
extends: .build_pytest_template
image: espressif/idf:latest
variables:
TEST_TARGETS: "esp32 esp32s2 esp32s3 esp32c2 esp32c3 esp32c5 esp32c6 esp32h2 esp32p4"
build_idf_v5.5:
extends: .build_pytest_template
image: espressif/idf:release-v5.5
variables:
TEST_TARGETS: "esp32 esp32s2 esp32s3 esp32c2 esp32c3 esp32c6 esp32h2 esp32p4"
build_idf_v5.3:
extends: .build_pytest_template
image: espressif/idf:release-v5.3
variables:
TEST_TARGETS: "esp32 esp32s2 esp32s3 esp32c2 esp32c3 esp32c6 esp32h2 esp32p4"
-50
View File
@@ -1,53 +1,3 @@
.deploy_docs_template:
stage: deploy
image: $ESP_DOCS_ENV_IMAGE
tags:
- deploy_docs
needs:
- build_docs
script:
- source ${CI_PROJECT_DIR}/docs/utils.sh
- add_doc_server_ssh_keys $DOCS_DEPLOY_PRIVATEKEY $DOCS_DEPLOY_SERVER $DOCS_DEPLOY_SERVER_USER
- export GIT_VER=$(git describe --always)
- export GIT_TAGS=$(git fetch --tags; git tag -l;)
- echo "Deploy ${PWD##*/}, ${DOCS_BUILD_DIR}, Ref name; ${CI_COMMIT_REF_NAME}"
- echo "Version; ${GIT_VER}, tags; ${GIT_TAGS}"
- pip install -r ${CI_PROJECT_DIR}/docs/requirements.txt
- deploy-docs
deploy_docs_preview:
extends:
- .deploy_docs_template
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
changes:
- "docs/**/*"
variables:
TYPE: "preview"
DOCS_BUILD_DIR: "${CI_PROJECT_DIR}/docs/_build/"
DOCS_DEPLOY_PRIVATEKEY: "$DOCS_PREVIEW_PRIVATEKEY"
DOCS_DEPLOY_SERVER: "$DOCS_PREVIEW_SERVER"
DOCS_DEPLOY_SERVER_USER: "$DOCS_PREVIEW_SERVER_USER"
DOCS_DEPLOY_PATH: "$DOCS_PREVIEW_PATH"
DOCS_DEPLOY_URL_BASE: "$DOCS_PREVIEW_URL_BASE"
deploy_docs_production:
extends:
- .deploy_docs_template
rules:
- if: $CI_COMMIT_BRANCH == "main"
changes:
- "docs/**/*"
- when: never # Do not run on any other branch or without changes
variables:
TYPE: "production"
DOCS_BUILD_DIR: "${CI_PROJECT_DIR}/docs/_build/"
DOCS_DEPLOY_PRIVATEKEY: "$DOCS_PROD_DEPLOY_KEY"
DOCS_DEPLOY_SERVER: "$DOCS_PROD_SERVER"
DOCS_DEPLOY_SERVER_USER: "$DOCS_PROD_SERVER_USER"
DOCS_DEPLOY_PATH: "$DOCS_PROD_PATH"
DOCS_DEPLOY_URL_BASE: "https://docs.espressif.com/projects/esp-modbus"
upload_to_component_manager:
stage: deploy
image: python:3.10-alpine
+50 -1
View File
@@ -9,8 +9,57 @@ build_docs:
- docs/_build/*/*/*.txt
- docs/_build/*/*/html/*
expire_in: 4 days
after_script: []
script:
- cd docs
- pip install -r requirements.txt
- ./generate_docs
.deploy_docs_template:
stage: deploy
image: $ESP_DOCS_ENV_IMAGE
tags:
- deploy_docs
needs:
- build_docs
script:
- source ${CI_PROJECT_DIR}/docs/utils.sh
- add_doc_server_ssh_keys $DOCS_DEPLOY_PRIVATEKEY $DOCS_DEPLOY_SERVER $DOCS_DEPLOY_SERVER_USER
- export GIT_VER=$(git describe --always)
- export GIT_TAGS=$(git fetch --tags; git tag -l;)
- echo "Deploy ${PWD##*/}, ${DOCS_BUILD_DIR}, Ref name; ${CI_COMMIT_REF_NAME}"
- echo "Version; ${GIT_VER}, tags; ${GIT_TAGS}"
- pip install -r ${CI_PROJECT_DIR}/docs/requirements.txt
- deploy-docs
deploy_docs_preview:
extends:
- .deploy_docs_template
rules:
- if: $CI_COMMIT_BRANCH == "main"
when: never
- changes:
- "docs/**/*"
variables:
TYPE: "preview"
DOCS_BUILD_DIR: "${CI_PROJECT_DIR}/docs/_build/"
DOCS_DEPLOY_PRIVATEKEY: "$DOCS_PREVIEW_PRIVATEKEY"
DOCS_DEPLOY_SERVER: "$DOCS_PREVIEW_SERVER"
DOCS_DEPLOY_SERVER_USER: "$DOCS_PREVIEW_SERVER_USER"
DOCS_DEPLOY_PATH: "$DOCS_PREVIEW_PATH"
DOCS_DEPLOY_URL_BASE: "$DOCS_PREVIEW_URL_BASE"
deploy_docs_production:
extends:
- .deploy_docs_template
rules:
- if: $CI_COMMIT_BRANCH == "main"
changes:
- "docs/**/*"
variables:
TYPE: "production"
DOCS_BUILD_DIR: "${CI_PROJECT_DIR}/docs/_build/"
DOCS_DEPLOY_PRIVATEKEY: "$DOCS_PROD_DEPLOY_KEY"
DOCS_DEPLOY_SERVER: "$DOCS_PROD_SERVER"
DOCS_DEPLOY_SERVER_USER: "$DOCS_PROD_SERVER_USER"
DOCS_DEPLOY_PATH: "$DOCS_PROD_PATH"
DOCS_DEPLOY_URL_BASE: "https://docs.espressif.com/projects/esp-modbus"
+13
View File
@@ -0,0 +1,13 @@
generate_prebuild_report:
stage: build
image: espressif/idf:latest
tags: [build]
artifacts:
paths:
- prebuild_report.html
expire_in: 1 week
when: always
script:
- pip install -U idf-ci
- idf-ci build collect --format html -o prebuild_report.html
- echo "Report generated at ${CI_PROJECT_URL}/-/jobs/${CI_JOB_ID}/artifacts/file/prebuild_report.html"
-89
View File
@@ -1,89 +0,0 @@
.target_test_template:
stage: target_test
timeout: 1 hour
variables:
GIT_DEPTH: 1
SUBMODULES_TO_FETCH: "none"
cache:
# Usually do not need submodule-cache in target_test
- key: pip-cache
paths:
- .cache/pip
policy: pull
.before_script_pytest_jobs:
before_script:
- pip install -r ${TEST_DIR}/tools/test_requirements.txt
.test_cur_folder_script:
script:
- |
export IDF_VER=$(cat ${TEST_DIR}/idf_version_info.txt)
echo "Start test job: ${CI_JOB_NAME}, version: ${IDF_VER%-*}, folder: ${PWD##*/}"
echo "Check built artifacts:" $(find . -type d -regex '^\./.*build_esp32[a-z]*[0-9]*[_a-z]*' -print)
python -m pytest --junit-xml=${TEST_DIR}/${PWD##*/}/results_${IDF_VER%-*}_${PWD##*/}.xml -m multi_dut_modbus_${TEST_MARKER}
ls -lh > test_dir_${PWD##*/}.txt
.test_template:
image: "$CI_DOCKER_REGISTRY/target-test-env-v5.3:1"
stage: target_test
extends:
- .before_script_pytest_jobs
tags:
- multi_dut_modbus_${TEST_MARKER}
script:
- cd ${TEST_DIR}/test_apps/
- !reference [.test_cur_folder_script, script]
- cd ${TEST_DIR}/examples/
- !reference [.test_cur_folder_script, script]
artifacts:
name: artifacts_${CI_JOB_NAME}
paths:
- "${TEST_DIR}/**/*.log"
- "${TEST_DIR}/**/*.xml"
- "${TEST_DIR}/**/results_*.xml"
- "${TEST_DIR}/**/pytest_embedded_log/"
- "${TEST_DIR}/**/test_dir*.txt"
- "${TEST_DIR}/**/idf_version_info.txt"
- "${TEST_DIR}/**/log.html" # robot framework related files
- "${TEST_DIR}/**/report.html"
- "${TEST_DIR}/**/*.pcap"
- "${TEST_DIR}/**/*.png"
when: always
expire_in: 1 week
target_test_latest:
stage: target_test
image: "$CI_DOCKER_REGISTRY/target-test-env-v6.0:2"
extends: .test_template
parallel:
matrix:
- !reference [.options_list, markers]
needs:
- job: build_idf_latest
artifacts: true
after_script: []
target_test_v5.5:
stage: target_test
image: "$CI_DOCKER_REGISTRY/target-test-env-v5.5:2"
extends: .test_template
parallel:
matrix:
- !reference [.options_list, markers]
needs:
- job: build_idf_v5.5
artifacts: true
after_script: []
target_test_v5.3:
stage: target_test
image: "$CI_DOCKER_REGISTRY/target-test-env-v5.3:1"
extends: .test_template
parallel:
matrix:
- !reference [.options_list, markers]
needs:
- job: build_idf_v5.3
artifacts: true
after_script: []
+29
View File
@@ -0,0 +1,29 @@
# See https://docs.espressif.com/projects/idf-build-apps/en/latest/references/config_file.html
config_rules = [
"sdkconfig.ci.wifi=wifi",
"sdkconfig.ci.ethernet=ethernet",
"sdkconfig.ci.tcp=tcp",
"sdkconfig.ci.ascii=ascii",
"sdkconfig.ci.rtu=rtu",
"sdkconfig.ci.serial=serial",
"sdkconfig.ci.generic=generic",
"sdkconfig.defaults=default",
"=default",
]
sdkconfig_defaults = "sdkconfig.defaults"
recursive = true
check_warnings = true
keep_going = true
build_dir = "build_@t_@w"
build_log_filename = "build_log.txt"
size_json_filename = "size.json"
collect_app_info_filename = "app_info_@p.txt"
check_manifest_rules = true
manifest_filepatterns = ["**/.build-test-rules.yml"]
ignore_warning_files = ["tools/ignore_build_warnings.txt"]
+197
View File
@@ -0,0 +1,197 @@
# ESP-MODBUS idf-ci Configuration
preserve_non_test_related_apps = true
[gitlab.artifacts.native]
build_job_filepatterns = [
"**/build*/partition_table/*.bin",
"**/build*/bootloader/*.bin",
"**/build*/bootloader/*.map",
"**/build*/bootloader/*.elf",
"**/build*/config/sdkconfig.json",
"**/build*/*.map",
"**/build*/*.bin",
"**/build*/*.elf",
"**/build*/flasher_args.json",
"**/build*/flash_project_args",
"**/build_log.txt",
"**/size.json",
"**/idf_version_info.txt",
]
test_job_filepatterns = [
"**/*.log",
"**/*.xml",
"**/pytest_embedded_log/**",
"**/idf_version_info.txt",
"**/*_stats_*.png", # modbus_stats_graph related
"**/log.html", # robot framework related files
"**/report.html",
"**/*.pcap",
"**/XUNIT_RESULT_*.xml",
]
runs_per_job = 15
[gitlab.build_pipeline]
job_template_jinja = """
dynamic_sdkconfig_script_job:
stage: "{{ settings.gitlab.build_pipeline.job_stage }}"
tags: {{ settings.gitlab.build_pipeline.job_tags }}
image: "{{ settings.gitlab.build_pipeline.job_image }}"
script:
# Allows to debug jobs overriding the ESP_MODBUS_CONFIG_KEY to ESP_MODBUS_CONFIG_VALUE
# in all registered application configs that match the pattern ESP_MODBUS_CONFIG_PATTERN
- echo "Setup job with parameters ${ESP_MODBUS_CONFIG_KEY}, ${ESP_MODBUS_CONFIG_VALUE}, ${ESP_MODBUS_CONFIG_PATTERN}"
- ${CI_PROJECT_DIR}/tools/setup_config_key.sh "${ESP_MODBUS_CONFIG_KEY}" "${ESP_MODBUS_CONFIG_VALUE}" "${ESP_MODBUS_CONFIG_PATTERN}"
# Specific IDF version to be used in artifacts .zip name and .txt
check_idf_ver:
stage: "{{ settings.gitlab.build_pipeline.job_stage }}"
tags: {{ settings.gitlab.build_pipeline.job_tags }}
image: "{{ settings.gitlab.build_pipeline.job_image }}"
script:
- "export IDF_DESCRIBE=$(git -C ${IDF_PATH} describe)"
- "export IDF_VERSION=${IDF_DESCRIBE%-*}"
- "echo IDF_VERSION=$IDF_VERSION > idf_version.env"
- "echo ESP-IDF: $IDF_VERSION | tee idf_version_info.txt"
artifacts:
paths:
- idf_version_info.txt
reports:
dotenv: idf_version.env
{{ settings.gitlab.build_pipeline.job_template_name }}:
stage: "{{ settings.gitlab.build_pipeline.job_stage }}"
tags: {{ settings.gitlab.build_pipeline.job_tags }}
image: "{{ settings.gitlab.build_pipeline.job_image }}"
timeout: "2h"
artifacts:
name: "artifacts_build_${IDF_VERSION}"
paths:
{%- for path in settings.gitlab.artifacts.native.build_job_filepatterns %}
- "{{ path }}"
{%- endfor %}
expire_in: "1 week"
when: "always"
before_script:
- pip install -U idf-ci
script:
- idf-ci build run
--parallel-count ${CI_NODE_TOTAL:-1}
--parallel-index ${CI_NODE_INDEX:-1}
"""
# Overwriting build jobs to add IDF version .env in needs.
jobs_jinja = """
{%- if test_related_apps_count > 0 %}
build_test_related_apps:
extends: "{{ settings.gitlab.build_pipeline.job_template_name }}"
{%- if test_related_parallel_count > 1 %}
parallel: {{ test_related_parallel_count }}
{%- endif %}
needs:
- job: check_idf_ver
artifacts: true
- pipeline: "$PARENT_PIPELINE_ID"
job: "generate_build_child_pipeline{{ settings.gitlab.build_pipeline.parent_pipeline_job_suffix }}"
- pipeline: "$PARENT_PIPELINE_ID"
job: "pipeline_variables{{ settings.gitlab.build_pipeline.parent_pipeline_job_suffix }}"
variables:
IDF_CI_BUILD_ONLY_TEST_RELATED_APPS: "1"
{% endif %}
{%- if non_test_related_apps_count > 0 %}
build_non_test_related_apps:
extends: "{{ settings.gitlab.build_pipeline.job_template_name }}"
{%- if non_test_related_parallel_count > 1 %}
parallel: {{ non_test_related_parallel_count }}
{%- endif %}
needs:
- job: check_idf_ver
artifacts: true
- pipeline: "$PARENT_PIPELINE_ID"
job: "generate_build_child_pipeline{{ settings.gitlab.build_pipeline.parent_pipeline_job_suffix }}"
- pipeline: "$PARENT_PIPELINE_ID"
job: "pipeline_variables{{ settings.gitlab.build_pipeline.parent_pipeline_job_suffix }}"
variables:
IDF_CI_BUILD_ONLY_NON_TEST_RELATED_APPS: "1"
{% endif %}
"""
# Changing test pipeline trigger in build pipeline to propagate IDF_VERSION var
yaml_jinja = """
{{ settings.gitlab.build_pipeline.pre_yaml_jinja }}
workflow:
name: "{{ settings.gitlab.build_pipeline.workflow_name }}"
rules:
- when: "always"
{% if settings.gitlab.build_pipeline.job_template_jinja %}
{{ job_template }}
{%- endif %}
{{ jobs }}
{%- if test_related_apps_count > 0 %}
generate_test_child_pipeline:
extends: "{{ settings.gitlab.build_pipeline.job_template_name }}"
needs:
- "build_test_related_apps"
artifacts:
paths:
- "{{ settings.gitlab.test_pipeline.yaml_filename }}"
script:
- idf-ci
--config 'gitlab.test_pipeline.job_image="{{ settings.gitlab.test_pipeline.job_image }}"'
gitlab test-child-pipeline
test-child-pipeline:
stage: ".post"
needs:
- "generate_test_child_pipeline"
- job: "check_idf_ver"
artifacts: true
variables:
PARENT_PIPELINE_ID: "$CI_PIPELINE_ID"
IDF_VERSION: "$IDF_VERSION"
trigger:
include:
- artifact: "{{ settings.gitlab.test_pipeline.yaml_filename }}"
job: "generate_test_child_pipeline"
strategy: "depend"
{%- endif %}
"""
[gitlab.test_pipeline]
job_template_jinja = """
{{ settings.gitlab.test_pipeline.job_template_name }}:
stage: "{{ settings.gitlab.test_pipeline.job_stage }}"
image: "{{ settings.gitlab.test_pipeline.job_image }}"
timeout: "1h"
artifacts:
name: "artifacts_test_${IDF_VERSION}"
paths:
{%- for path in settings.gitlab.artifacts.native.test_job_filepatterns %}
- "{{ path }}"
{%- endfor %}
expire_in: "1 week"
when: "always"
reports:
junit: "**/XUNIT_RESULT_*.xml"
variables:
PYTEST_EXTRA_FLAGS: ""
needs:
- pipeline: "$PARENT_PIPELINE_ID"
job: "build_test_related_apps"
before_script:
- pip install -r ./tools/test_requirements.txt
- pip install -U 'idf-ci<1'
script:
- eval pytest $nodes
--parallel-count ${CI_NODE_TOTAL:-1}
--parallel-index ${CI_NODE_INDEX:-1}
--junitxml "XUNIT_RESULT_${CI_JOB_NAME_SLUG}_${IDF_VERSION}.xml"
${PYTEST_EXTRA_FLAGS}
"""
+1 -1
View File
@@ -80,4 +80,4 @@ repos:
rev: v1.1.1
hooks:
- id: check-copyright
args: ['--config', 'tools/ci/check_copyright_config.yaml']
args: ['--config', '.gitlab/ci/check_copyright_config.yaml']
+8 -4
View File
@@ -11,9 +11,6 @@ from enum import Enum
from statistics import mean
from typing import Any, Callable, Dict, Generator, Optional, Tuple, List, Union
from re import Match
import numpy as np
import matplotlib.pyplot as plt
from dataclasses import dataclass
import pexpect
@@ -559,6 +556,13 @@ class ModbusTestDut(IdfDut):
file_name: str,
) -> None:
"""The function plots graph from all success and fail parameters"""
# Lazy import to comply with idf-ci build job import rules
import numpy as np
import matplotlib.pyplot as plt
from pathlib import Path
saving_path_dir = Path(self.app.app_path).parent # Dir for graph to be saved
names: List[str] = []
width = 0.1
alpha = 0.5
@@ -611,7 +615,7 @@ class ModbusTestDut(IdfDut):
plt.legend()
plt.title("Modbus Test Statistics")
plt.ylabel("Parameters accessed")
plt.savefig(f"{file_name}.png")
plt.savefig(Path.joinpath(saving_path_dir, f"{file_name}.png"))
plt.show()
def get_item(self, data: Optional[List[Any]] = None, item: int = 0) -> bytes:
-25
View File
@@ -1,25 +0,0 @@
tcp/mb_tcp_master:
disable_test:
- if: IDF_TARGET != "esp32" or CONFIG_NAME == "dummy_config"
reason: only manual test is performed
disable:
- if: CONFIG_NAME == "wifi" and SOC_WIFI_SUPPORTED != 1
tcp/mb_tcp_slave:
disable_test:
- if: IDF_TARGET != "esp32" or CONFIG_NAME == "dummy_config"
reason: only manual test is performed
disable:
- if: CONFIG_NAME == "wifi" and SOC_WIFI_SUPPORTED != 1
serial/mb_serial_master:
disable_test:
- if: IDF_TARGET != "esp32" or CONFIG_NAME == "dummy_config"
reason: only manual test is performed
disable:
- if: CONFIG_NAME == "default" and SOC_WIFI_SUPPORTED != 1
serial/mb_serial_slave:
disable_test:
- if: IDF_TARGET != "esp32" or CONFIG_NAME == "dummy_config"
reason: only manual test is performed
@@ -22,3 +22,4 @@ CONFIG_EXAMPLE_WIFI_PASSWORD="${CI_WIFI_PASSW}"
CONFIG_LOG_DEFAULT_LEVEL_DEBUG=n
CONFIG_LOG_MAXIMUM_LEVEL_DEBUG=y
CONFIG_MB_CONSOLE_HELPER_ENABLED=y
CONFIG_PARTITION_TABLE_SINGLE_APP_LARGE=y # To avoid app partition size warning of Wifi
@@ -20,3 +20,4 @@ CONFIG_EXAMPLE_CONNECT_ETHERNET=n
CONFIG_EXAMPLE_CONNECT_WIFI=y
CONFIG_LOG_DEFAULT_LEVEL_DEBUG=n
CONFIG_LOG_MAXIMUM_LEVEL_DEBUG=y
CONFIG_PARTITION_TABLE_SINGLE_APP_LARGE=y # To avoid app partition size warning of Wifi
+2 -20
View File
@@ -18,29 +18,11 @@ filterwarnings =
ignore::DeprecationWarning:google.protobuf.*:
ignore::_pytest.warning_types.PytestExperimentalApiWarning
markers =
# target markers
esp32: support esp32 target
esp32s2: support esp32s2 target
esp32s3: support esp32s3 target
esp32c3: support esp32c3 target
esp32c2: support esp32c2 target
esp32p4: support esp32p4 target
esp32c5: support esp32c5 target
# special markers
temp_skip_ci: temp skip tests for specified targets only in ci
# env markers
generic: tests should be run on generic runners
# multi-dut markers
multi_dut_generic: tests should be run on generic runners, at least have two duts connected.
env_markers =
# multi-dut markers
multi_dut_modbus_generic: generic Modbus dut
multi_dut_modbus_tcp: Modbus TCP runners with two duts connected
multi_dut_modbus_rs485: Modbus RTU/ASCII runners with two duts connected
multi_dut_modbus_serial: Alias for Modbus RTU/ASCII runners with two duts connected
generic_multi_device: generic multi device runners
# log related
log_cli = True
-37
View File
@@ -1,37 +0,0 @@
physical_tests:
disable_test:
- if: IDF_TARGET != "esp32"
reason: only manual test is performed for other targets
disable:
- if: CONFIG_NAME != "serial"
# - if: CONFIG_NAME == "wifi" and SOC_WIFI_SUPPORTED != 1 and IDF_TARGET != "esp32"
tcp_instances_tests/mb_tcp_master_instances:
disable_test:
- if: IDF_TARGET != "esp32"
reason: only manual test is performed for other targets
disable:
- if: CONFIG_NAME == "wifi" and SOC_WIFI_SUPPORTED != 1 and IDF_TARGET != "esp32"
tcp_instances_tests/mb_tcp_slave_instances:
disable_test:
- if: IDF_TARGET != "esp32"
reason: only manual test is performed for other targets
disable:
- if: CONFIG_NAME == "wifi" and SOC_WIFI_SUPPORTED != 1 and IDF_TARGET != "esp32"
unit_tests:
disable_test:
- if: "1 == 1" # Disabling for the Ci build and test Refactor
# - if: IDF_TARGET != "esp32"
# reason: only manual test is performed for other targets
disable:
- if: "1 == 1" # Disabling for the Ci test Refactor
adapter_tests:
disable_test:
- if: "1 == 1" # Disabling for the Ci build and test Refactor
# - if: IDF_TARGET != "esp32"
# reason: only manual test is performed for other targets
disable:
- if: "1 == 1" # Disabling for the Ci build and test Refactor
-20
View File
@@ -1,23 +1,3 @@
Warning: Deprecated: Option '--flash_size' is deprecated. Use '--flash-size' instead.
Warning: Deprecated: Option '--flash_mode' is deprecated. Use '--flash-mode' instead.
Warning: Deprecated: Option '--flash_freq' is deprecated. Use '--flash-freq' instead.
Warning: Deprecated: Command 'sign_data' is deprecated. Use 'sign-data' instead.
Warning: Deprecated: Command 'extract_public_key' is deprecated. Use 'extract-public-key' instead.
warning: unknown kconfig symbol 'EXAMPLE_ETH_PHY_IP101' assigned to 'y' in .*
WARNING: The following Kconfig variables were used in "if" clauses, but not.*
library/error\.o
/.*error\S*\.o
.*error.*\.c\.obj
.*error.*\.c
.*error.*\.cpp\.obj
.*error.*\.cxx\.obj
.*error.*\.cc\.obj
-Werror
error\.d
/.*error\S*.d
reassigning to symbol
changes choice state
crosstool_version_check\.cmake
CryptographyDeprecationWarning
Warning: \d+/\d+ app partitions are too small for binary
CMake Deprecation Warning at main/lib/tinyxml2/CMakeLists\.txt:11 \(cmake_policy\)
-6
View File
@@ -1,9 +1,3 @@
pytest
pytest-rerunfailures>=12.0
pytest-embedded>=1.18.2
pytest-embedded-idf
pytest-embedded-serial>=1.18.2
pytest-embedded-serial-esp
robotframework
dataclasses
scapy>=2.6.1