Skip to content

Commit a5257dc

Browse files
committed
ci: apply idf-ci pytest plugin
Removed - target markers. Now must use target as parametrization in esp-idf - host test markers. Now will be automatically added with linux target and qemu marker
1 parent f33469d commit a5257dc

File tree

39 files changed

+443
-2417
lines changed

39 files changed

+443
-2417
lines changed

.gitlab/ci/build.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
variables:
3535
IDF_TOOLCHAIN: clang
3636
TEST_BUILD_OPTS_EXTRA: ""
37-
PYTEST_IGNORE_COLLECT_IMPORT_ERROR: "1"
3837
script:
3938
# CI specific options start from "--parallel-count xxx". could ignore when running locally
4039
- run_cmd idf-build-apps build
@@ -292,8 +291,6 @@ generate_build_child_pipeline:
292291
- non_test_related_apps.txt
293292
expire_in: 1 week
294293
when: always
295-
variables:
296-
PYTEST_IGNORE_COLLECT_IMPORT_ERROR: "1"
297294
script:
298295
- run_cmd python tools/ci/dynamic_pipelines/scripts/generate_build_child_pipeline.py
299296

.gitlab/ci/common.yml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ variables:
145145
export IDF_PIP_WHEELS_URL=""
146146
fi
147147

148+
# install.sh
148149
if [[ "${CI_JOB_STAGE}" != "target_test" ]]; then
149150
section_start "running_install_sh" "Running install.sh"
150151
if [[ "${CI_JOB_STAGE}" == "build_doc" ]]; then
@@ -154,8 +155,9 @@ variables:
154155
fi
155156
section_end "running_install_sh"
156157
else
157-
section_start "install_python_env" "Install Python environment"
158+
section_start "install_python_env" "Install Python environment, skip required tools check"
158159
run_cmd python tools/idf_tools.py install-python-env --features ci,test-specific
160+
export IDF_SKIP_TOOLS_CHECK=1
159161
section_end "install_python_env"
160162
fi
161163

@@ -170,11 +172,6 @@ variables:
170172
$IDF_PATH/tools/idf_tools.py --non-interactive install esp-clang
171173
fi
172174

173-
if [[ "${CI_JOB_STAGE}" == "target_test" ]]; then
174-
section_start "IDF_SKIP_TOOLS_CHECK" "Skip required tools check"
175-
export IDF_SKIP_TOOLS_CHECK=1
176-
section_end "IDF_SKIP_TOOLS_CHECK"
177-
fi
178175
section_start "source_export" "Source export.sh"
179176
source ./export.sh
180177
section_end "source_export"

.gitlab/ci/host-test.yml

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,6 @@ test_pytest_macos:
353353
junit: XUNIT_RESULT.xml
354354
variables:
355355
PYENV_VERSION: "3.9"
356-
PYTEST_IGNORE_COLLECT_IMPORT_ERROR: "1"
357356
# Workaround for a bug in Parallels executor where CI_PROJECT_DIR is not an absolute path,
358357
# but a relative path to the build directory (builds/espressif/esp-idf instead of ~/builds/espressif/esp-idf.
359358
# GitLab sets the project dir to this template `<builds_dir>/<namespace>/<project_name>`
@@ -364,30 +363,15 @@ test_pytest_macos:
364363
--build-system cmake
365364
--target linux
366365
--only-test-related
367-
-m \"host_test and macos\"
366+
-m macos
368367
--modified-files ${MR_MODIFIED_FILES}
369368
- python tools/ci/get_known_failure_cases_file.py
370369
- run_cmd pytest
371370
--target linux
372-
-m \"host_test and macos\"
371+
-m macos
373372
--junitxml=XUNIT_RESULT.xml
374373
--ignore-result-files ${KNOWN_FAILURE_CASES_FILE_NAME}
375374

376-
test_idf_pytest_plugin:
377-
extends:
378-
- .host_test_template
379-
- .rules:patterns:idf-pytest-plugin
380-
variables:
381-
SUBMODULES_TO_FETCH: "none"
382-
artifacts:
383-
reports:
384-
junit: XUNIT_RESULT.xml
385-
script:
386-
- cd ${IDF_PATH}/tools/ci/dynamic_pipelines/tests/test_report_generator
387-
- python -m unittest test_report_generator.py
388-
- cd ${IDF_PATH}/tools/ci/idf_pytest
389-
- pytest --junitxml=${CI_PROJECT_DIR}/XUNIT_RESULT.xml
390-
391375
test_idf_build_apps_load_soc_caps:
392376
extends: .host_test_template
393377
script:

.gitlab/ci/pre_check.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,6 @@ check_test_scripts_build_test_rules:
116116
extends:
117117
- .pre_check_template
118118
- .before_script:build
119-
variables:
120-
PYTEST_IGNORE_COLLECT_IMPORT_ERROR: "1"
121119
script:
122120
# requires basic pytest dependencies
123121
- python tools/ci/check_build_test_rules.py check-test-scripts examples/ tools/test_apps components

.gitlab/ci/rules.yml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -162,10 +162,6 @@
162162
- "components/bt/esp_ble_mesh/lib/lib"
163163
- ".gitmodules"
164164

165-
.patterns-idf-pytest-plugin: &patterns-idf-pytest-plugin
166-
- "tools/ci/idf_pytest/**/*"
167-
- "tools/ci/dynamic_pipelines/tests/**/*"
168-
169165
##############
170166
# if anchors #
171167
##############
@@ -265,12 +261,6 @@
265261
# - <<: *if-dev-push
266262
# changes: *patterns-sonarqube-files
267263

268-
.rules:patterns:idf-pytest-plugin:
269-
rules:
270-
- <<: *if-protected-check
271-
- <<: *if-dev-push
272-
changes: *patterns-idf-pytest-plugin
273-
274264
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
275265
# DO NOT place comments or maintain any code from this line
276266
#

.idf_build_apps.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ ignore_warning_files = [
2020
]
2121

2222
build_dir = "build_@t_@w"
23-
build_log_filename = "build.log"
23+
build_log_filename = "build_log.txt"
2424
size_json_filename = "size.json"
2525

2626
verbose = 1 # INFO
@@ -31,7 +31,7 @@ collect_size_info_filename = "size_info_${CI_JOB_NAME_SLUG}.txt" # TODO remove
3131
junitxml = "build_summary_${CI_JOB_NAME_SLUG}.xml"
3232

3333
# manifest
34-
# check_manifest_rules = true # FIXME
34+
check_manifest_rules = true
3535
manifest_rootpath = "$IDF_PATH"
3636
manifest_filepatterns = [
3737
'**/.build-test-rules.yml',

.pre-commit-config.yaml

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -10,26 +10,6 @@ repos:
1010
- id: ruff-format
1111
- id: ruff
1212
args: [ "--fix" ]
13-
- repo: local
14-
hooks:
15-
- id: pytest-linter
16-
name: Pytest Linter Check
17-
entry: tools/ci/check_test_files.py
18-
language: python
19-
files: 'pytest_.*\.py$'
20-
require_serial: true
21-
additional_dependencies:
22-
- pytest-embedded-idf[serial]~=1.16
23-
- pytest-embedded-jtag~=1.16
24-
- pytest-embedded-qemu~=1.16
25-
- pytest-ignore-test-results~=0.3
26-
- pytest-rerunfailures
27-
- pytest-timeout
28-
- idf-build-apps~=2.11
29-
- python-gitlab
30-
- minio
31-
- click
32-
- esp-idf-monitor
3313
- repo: https://github.com/pre-commit/pre-commit-hooks
3414
rev: v4.5.0
3515
hooks:
@@ -178,15 +158,6 @@ repos:
178158
files: 'tools/ci/sort_yaml\.py$'
179159
additional_dependencies:
180160
- ruamel.yaml
181-
- id: check-build-test-rules-path-exists
182-
name: check path in .build-test-rules.yml exists
183-
entry: tools/ci/check_build_test_rules.py check-exist
184-
language: python
185-
additional_dependencies:
186-
- PyYAML == 5.3.1
187-
always_run: true
188-
pass_filenames: false
189-
require_serial: true
190161
- id: cleanup-ignore-lists
191162
name: Remove non-existing patterns from ignore lists
192163
entry: tools/ci/cleanup_ignore_lists.py

components/esp_mm/test_apps/mm/pytest_mmap.py

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import pytest
44
from pytest_embedded import Dut
55
from pytest_embedded_idf.utils import idf_parametrize
6+
67
# normal mmu tests
78

89

@@ -20,14 +21,6 @@ def test_mmap(dut: Dut) -> None:
2021

2122

2223
# mmu tests with psram enabled
23-
PSRAM_RELEASE_CONFIGS = [
24-
pytest.param('psram_release_esp32', marks=[pytest.mark.esp32]),
25-
pytest.param('psram_release_esp32s2', marks=[pytest.mark.esp32s2]),
26-
pytest.param('psram_release_esp32s3', marks=[pytest.mark.esp32s3]),
27-
pytest.param('psram_release_esp32p4', marks=[pytest.mark.esp32p4]),
28-
]
29-
30-
3124
@pytest.mark.generic
3225
@idf_parametrize(
3326
'config,target',
@@ -44,12 +37,6 @@ def test_mmap_psram(dut: Dut) -> None:
4437

4538

4639
# mmu tests with xip_psram
47-
XIP_CONFIGS = [
48-
pytest.param('xip_psram_esp32s2', marks=[pytest.mark.esp32s2]),
49-
pytest.param('xip_psram_esp32s3', marks=[pytest.mark.esp32s3]),
50-
]
51-
52-
5340
@pytest.mark.generic
5441
@idf_parametrize(
5542
'config,target', [('xip_psram_esp32s2', 'esp32s2'), ('xip_psram_esp32s3', 'esp32s3')], indirect=['config', 'target']

components/esp_system/test_apps/console/pytest_esp_system_console_tests.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,6 @@ def not_expect(dut: Dut, output_regex: str) -> None:
1515
raise RuntimeError(f'Found not_expect output {output_regex}')
1616

1717

18-
JTAG_SERIAL_MARKS = [
19-
pytest.mark.esp32s3,
20-
pytest.mark.esp32c2,
21-
pytest.mark.esp32c3,
22-
pytest.mark.esp32c5,
23-
pytest.mark.esp32c6,
24-
pytest.mark.esp32c61,
25-
pytest.mark.esp32h2,
26-
]
27-
28-
2918
@pytest.mark.generic
3019
@idf_parametrize('config', ['console_none'], indirect=['config'])
3120
@idf_parametrize('target', ['supported_targets'], indirect=['target'])

components/esp_wifi/test_apps/wifi_function/pytest_wifi_function.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import pytest
44
from pytest_embedded import Dut
55
from pytest_embedded_idf.utils import idf_parametrize
6-
# @pytest.mark.esp32c2 # esp32c2 are using xtal_26mhz
76

87

98
@pytest.mark.generic

0 commit comments

Comments
 (0)