From 813afc776908915a955ec3255ba1cc4bcb502505 Mon Sep 17 00:00:00 2001 From: Evgeny Torbin Date: Mon, 2 Mar 2026 16:36:53 +0100 Subject: [PATCH 1/3] ci: add check-tests-missing-config pre-commit hook --- .pre-commit-config.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 85cdb8a987..2c12edd410 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -227,3 +227,8 @@ repos: hooks: - id: check-kconfig-files - id: check-deprecated-kconfig-options + - repo: https://github.com/espressif/idf-ci + rev: v1.0.0b4 + hooks: + - id: check-tests-missing-config + files: 'pytest_.*\.py$|sdkconfig(\..*)?$' From d412f4b8581cda4a9b59ea53831ad8cad7374b9a Mon Sep 17 00:00:00 2001 From: Evgeny Torbin Date: Mon, 2 Mar 2026 16:40:26 +0100 Subject: [PATCH 2/3] ci: remove unused test cases --- .../memory_release/pytest_memory_release.py | 2 - .../sleep_retention/pytest_retention.py | 15 ----- .../flash_wl/pytest_fatfs_flash_wl.py | 15 +---- .../test_apps/sdcard/pytest_fatfs_sdcard.py | 29 +--------- .../test_apps/freertos/pytest_freertos.py | 3 - .../hal/test_apps/crypto/pytest_crypto.py | 56 +------------------ components/lwip/test_apps/pytest_lwip.py | 11 ---- .../nvs_host_test/pytest_nvs_host_linux.py | 11 ---- .../spiffs/test_apps/.build-test-rules.yml | 2 +- components/spiffs/test_apps/pytest_spiffs.py | 15 +---- .../vfs/test_apps/.build-test-rules.yml | 2 +- components/vfs/test_apps/pytest_vfs.py | 28 +--------- .../wifi_prov_mgr/pytest_wifi_prov_mgr.py | 9 +-- .../efuse/pytest_system_efuse_example.py | 19 +------ .../partitions_ota/pytest_partitions_ota.py | 18 +++--- .../pytest_wifi_getting_started.py | 32 +---------- .../pytest_ld_non_contiguous_memory.py | 1 - .../test_apps/security/.build-test-rules.yml | 2 +- .../signed_app_no_secure_boot/README.md | 4 +- .../pytest_signed_app_no_secure_boot.py | 11 +--- tools/test_apps/system/panic/pytest_panic.py | 33 ++--------- 21 files changed, 31 insertions(+), 287 deletions(-) delete mode 100644 components/esp_hw_support/test_apps/sleep_retention/pytest_retention.py delete mode 100644 components/lwip/test_apps/pytest_lwip.py delete mode 100644 components/nvs_flash/host_test/nvs_host_test/pytest_nvs_host_linux.py diff --git a/components/bt/test_apps/memory_release/pytest_memory_release.py b/components/bt/test_apps/memory_release/pytest_memory_release.py index d5d70fcd2b..68b023f6f6 100644 --- a/components/bt/test_apps/memory_release/pytest_memory_release.py +++ b/components/bt/test_apps/memory_release/pytest_memory_release.py @@ -8,8 +8,6 @@ from pytest_embedded_idf.utils import idf_parametrize @idf_parametrize( 'config,target,markers', [ - ('default', 'esp32', (pytest.mark.generic,)), - ('default', 'esp32c2', (pytest.mark.generic,)), ('iram', 'esp32c2', (pytest.mark.generic,)), ('psram', 'esp32', (pytest.mark.psram,)), ], diff --git a/components/esp_hw_support/test_apps/sleep_retention/pytest_retention.py b/components/esp_hw_support/test_apps/sleep_retention/pytest_retention.py deleted file mode 100644 index b515a68d39..0000000000 --- a/components/esp_hw_support/test_apps/sleep_retention/pytest_retention.py +++ /dev/null @@ -1,15 +0,0 @@ -# SPDX-FileCopyrightText: 2022-2025 Espressif Systems (Shanghai) CO LTD -# SPDX-License-Identifier: CC0-1.0 -import pytest -from pytest_embedded import Dut -from pytest_embedded_idf.utils import idf_parametrize - - -# SOC_PAU_SUPPORTED == 1 -retention_targets = ['esp32c6', 'esp32h2', 'esp32p4', 'esp32c5', 'esp32c61'] - - -@pytest.mark.generic -@idf_parametrize('target', ['esp32c61', 'esp32c5', 'esp32p4', 'esp32h2', 'esp32c6'], indirect=['target']) -def test_sleep_retention(dut: Dut) -> None: - dut.run_all_single_board_cases() diff --git a/components/fatfs/test_apps/flash_wl/pytest_fatfs_flash_wl.py b/components/fatfs/test_apps/flash_wl/pytest_fatfs_flash_wl.py index a9863635bf..0ffcc3a16c 100644 --- a/components/fatfs/test_apps/flash_wl/pytest_fatfs_flash_wl.py +++ b/components/fatfs/test_apps/flash_wl/pytest_fatfs_flash_wl.py @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: 2022-2025 Espressif Systems (Shanghai) CO LTD +# SPDX-FileCopyrightText: 2022-2026 Espressif Systems (Shanghai) CO LTD # SPDX-License-Identifier: CC0-1.0 import pytest from pytest_embedded import Dut @@ -19,16 +19,3 @@ from pytest_embedded_idf.utils import idf_parametrize @idf_parametrize('target', ['esp32', 'esp32c3'], indirect=['target']) def test_fatfs_flash_wl_generic(dut: Dut) -> None: dut.run_all_single_board_cases(timeout=240) - - -@pytest.mark.generic -@pytest.mark.psram -@pytest.mark.parametrize( - 'config', - [ - 'psram', - ], -) -@idf_parametrize('target', ['esp32'], indirect=['target']) -def test_fatfs_flash_wl_psram(dut: Dut) -> None: - dut.run_all_single_board_cases(timeout=180) diff --git a/components/fatfs/test_apps/sdcard/pytest_fatfs_sdcard.py b/components/fatfs/test_apps/sdcard/pytest_fatfs_sdcard.py index 1121bd222b..86291941f4 100644 --- a/components/fatfs/test_apps/sdcard/pytest_fatfs_sdcard.py +++ b/components/fatfs/test_apps/sdcard/pytest_fatfs_sdcard.py @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: 2022-2025 Espressif Systems (Shanghai) CO LTD +# SPDX-FileCopyrightText: 2022-2026 Espressif Systems (Shanghai) CO LTD # SPDX-License-Identifier: CC0-1.0 import pytest from pytest_embedded import Dut @@ -30,30 +30,3 @@ def test_fatfs_sdcard_generic_sdmmc(dut: Dut) -> None: @idf_parametrize('target', ['esp32', 'esp32c3'], indirect=['target']) def test_fatfs_sdcard_generic_sdspi(dut: Dut) -> None: dut.run_all_single_board_cases(group='sdspi', timeout=180) - - -@pytest.mark.sdcard_sdmode -@pytest.mark.psram -@pytest.mark.parametrize( - 'config', - [ - 'psram', - ], -) -@idf_parametrize('target', ['esp32'], indirect=['target']) -def test_fatfs_sdcard_psram_sdmmc(dut: Dut) -> None: - dut.run_all_single_board_cases(group='sdmmc', timeout=180) - - -@pytest.mark.temp_skip_ci(targets=['esp32'], reason='IDFCI-2058, temporary lack runner') -@pytest.mark.sdcard_spimode -@pytest.mark.psram -@pytest.mark.parametrize( - 'config', - [ - 'psram', - ], -) -@idf_parametrize('target', ['esp32'], indirect=['target']) -def test_fatfs_sdcard_psram_sdspi(dut: Dut) -> None: - dut.run_all_single_board_cases(group='sdspi', timeout=180) diff --git a/components/freertos/test_apps/freertos/pytest_freertos.py b/components/freertos/test_apps/freertos/pytest_freertos.py index ccf1d28224..7c38a2b0a5 100644 --- a/components/freertos/test_apps/freertos/pytest_freertos.py +++ b/components/freertos/test_apps/freertos/pytest_freertos.py @@ -13,9 +13,6 @@ from pytest_embedded_idf.utils import idf_parametrize ('freertos_options', 'supported_targets'), ('tickless_idle', 'supported_targets'), ('psram', 'esp32'), - ('psram', 'esp32c5'), - ('psram', 'esp32p4'), - ('psram', 'esp32s3'), ('single_core', 'esp32'), ('single_core', 'esp32p4'), ( diff --git a/components/hal/test_apps/crypto/pytest_crypto.py b/components/hal/test_apps/crypto/pytest_crypto.py index 0b8f3dab83..59861cf05c 100644 --- a/components/hal/test_apps/crypto/pytest_crypto.py +++ b/components/hal/test_apps/crypto/pytest_crypto.py @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: 2024-2025 Espressif Systems (Shanghai) CO LTD +# SPDX-FileCopyrightText: 2024-2026 Espressif Systems (Shanghai) CO LTD # SPDX-License-Identifier: CC0-1.0 import binascii import os @@ -109,60 +109,6 @@ def test_ecdsa_key( raise -@pytest.mark.generic -@idf_parametrize('target', ['supported_targets'], indirect=['target']) -def test_crypto(dut: Dut) -> None: - # if the env variable IDF_FPGA_ENV is set, we would need a longer timeout - # as tests for efuses burning security peripherals would be run - timeout = 600 if os.environ.get('IDF_ENV_FPGA') else 60 - # only expect key manager result if it is supported for the SoC - if dut.app.sdkconfig.get('SOC_KEY_MANAGER_SUPPORTED'): - print('Key Manager is supported') - - # Test for ECDH0 deployment XTS-AES-128 key - dut.expect('Key Manager ECDH0 deployment: XTS_AES_128 key', timeout=timeout) - k2_G = dut.expect(r'K2_G: 0x([0-9a-fA-F]+)', timeout=timeout)[1].decode() - plaintext_data = dut.expect(r'Plaintext data: 0x([0-9a-fA-F]+)', timeout=timeout)[1] - plaintext_data = binascii.unhexlify(plaintext_data) - encrypted_data = dut.expect(r'Encrypted data: 0x([0-9a-fA-F]+)', timeout=timeout)[1].decode() - encrypted_data = binascii.unhexlify(encrypted_data) - negotiated_key = calculate_key_manager_ecdh0_negotiated_key(k2_G, 'main/key_manager/k1_ecdsa.pem') - test_xts_aes_encryption(negotiated_key, plaintext_data, encrypted_data) - - # Test for ECDH0 deployment XTS-AES-256 key - dut.expect('Key Manager ECDH0 deployment: XTS_AES_256 key', timeout=timeout) - k2_G_0 = dut.expect(r'K2_G_0: 0x([0-9a-fA-F]+)', timeout=timeout)[1].decode() - k2_G_1 = dut.expect(r'K2_G_1: 0x([0-9a-fA-F]+)', timeout=timeout)[1].decode() - encrypted_data = dut.expect(r'Encrypted data: 0x([0-9a-fA-F]+)', timeout=timeout)[1].decode() - encrypted_data = binascii.unhexlify(encrypted_data) - negotiated_key_0 = calculate_key_manager_ecdh0_negotiated_key(k2_G_0, 'main/key_manager/k1_ecdsa.pem') - negotiated_key_1 = calculate_key_manager_ecdh0_negotiated_key(k2_G_1, 'main/key_manager/k1_ecdsa.pem') - negotiated_key = negotiated_key_0 + negotiated_key_1 - test_xts_aes_encryption(negotiated_key, plaintext_data, encrypted_data) - # Test for ECDH0 deployment ECDSA-256 key - dut.expect('Key Manager ECDH0 deployment: ECDSA_256 key', timeout=timeout) - k2_G = dut.expect(r'K2_G: 0x([0-9a-fA-F]+)', timeout=timeout)[1].decode() - digest = dut.expect(r'ECDSA message sha256 digest: 0x([0-9a-fA-F]+)', timeout=timeout)[1].decode() - digest = binascii.unhexlify(digest) - signature_r_le = dut.expect(r'ECDSA signature r_le: 0x([0-9a-fA-F]+)', timeout=timeout)[1].decode() - signature_r_le = binascii.unhexlify(signature_r_le) - signature_s_le = dut.expect(r'ECDSA signature s_le: 0x([0-9a-fA-F]+)', timeout=timeout)[1].decode() - signature_s_le = binascii.unhexlify(signature_s_le) - pub_x = dut.expect(r'ECDSA key pubx: 0x([0-9a-fA-F]+)', timeout=timeout)[1].decode() - pub_x = binascii.unhexlify(pub_x) - pub_y = dut.expect(r'ECDSA key puby: 0x([0-9a-fA-F]+)', timeout=timeout)[1].decode() - pub_y = binascii.unhexlify(pub_y) - negotiated_key = calculate_key_manager_ecdh0_negotiated_key(k2_G, 'main/key_manager/k1_ecdsa.pem') - test_ecdsa_key(negotiated_key, digest, signature_r_le, signature_s_le, pub_x, pub_y) - - test_numbers = dut.expect(r'(\d+) Tests (\d+) Failures (\d+) Ignored', timeout=timeout) - failures = test_numbers.group(2).decode() - ignored = test_numbers.group(3).decode() - assert failures == '0', f'No of failures must be 0 (is {failures})' - assert ignored == '0', f'No of Ignored test must be 0 (is {ignored})' - dut.expect('Tests finished', timeout=timeout) - - @pytest.mark.generic @pytest.mark.parametrize('config', ['long_aes_operations'], indirect=True) @idf_parametrize('target', ['supported_targets'], indirect=['target']) diff --git a/components/lwip/test_apps/pytest_lwip.py b/components/lwip/test_apps/pytest_lwip.py deleted file mode 100644 index 962dbd794b..0000000000 --- a/components/lwip/test_apps/pytest_lwip.py +++ /dev/null @@ -1,11 +0,0 @@ -# SPDX-FileCopyrightText: 2022-2025 Espressif Systems (Shanghai) CO LTD -# SPDX-License-Identifier: Apache-2.0 -import pytest -from pytest_embedded import Dut -from pytest_embedded_idf.utils import idf_parametrize - - -@pytest.mark.generic -@idf_parametrize('target', ['esp32'], indirect=['target']) -def test_lwip(dut: Dut) -> None: - dut.expect_unity_test_output() diff --git a/components/nvs_flash/host_test/nvs_host_test/pytest_nvs_host_linux.py b/components/nvs_flash/host_test/nvs_host_test/pytest_nvs_host_linux.py deleted file mode 100644 index 37b8275a7e..0000000000 --- a/components/nvs_flash/host_test/nvs_host_test/pytest_nvs_host_linux.py +++ /dev/null @@ -1,11 +0,0 @@ -# SPDX-FileCopyrightText: 2023-2025 Espressif Systems (Shanghai) CO LTD -# SPDX-License-Identifier: Unlicense OR CC0-1.0 -import pytest -from pytest_embedded import Dut -from pytest_embedded_idf.utils import idf_parametrize - - -@pytest.mark.host_test -@idf_parametrize('target', ['linux'], indirect=['target']) -def test_nvs_host_linux(dut: Dut) -> None: - dut.expect_exact('All tests passed', timeout=60) diff --git a/components/spiffs/test_apps/.build-test-rules.yml b/components/spiffs/test_apps/.build-test-rules.yml index f3bf52966a..45824d892d 100644 --- a/components/spiffs/test_apps/.build-test-rules.yml +++ b/components/spiffs/test_apps/.build-test-rules.yml @@ -1,6 +1,6 @@ components/spiffs/test_apps: disable_test: - - if: IDF_TARGET not in ["esp32", "esp32c3", "esp32s3"] + - if: IDF_TARGET not in ["esp32", "esp32c3"] reason: These chips should be sufficient for test coverage (Xtensa and RISC-V, single and dual core) depends_components: diff --git a/components/spiffs/test_apps/pytest_spiffs.py b/components/spiffs/test_apps/pytest_spiffs.py index 318e0d9f83..f074378113 100644 --- a/components/spiffs/test_apps/pytest_spiffs.py +++ b/components/spiffs/test_apps/pytest_spiffs.py @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: 2022-2025 Espressif Systems (Shanghai) CO LTD +# SPDX-FileCopyrightText: 2022-2026 Espressif Systems (Shanghai) CO LTD # SPDX-License-Identifier: CC0-1.0 import pytest from pytest_embedded import Dut @@ -17,16 +17,3 @@ from pytest_embedded_idf.utils import idf_parametrize @idf_parametrize('target', ['esp32', 'esp32c3'], indirect=['target']) def test_spiffs_generic(dut: Dut) -> None: dut.run_all_single_board_cases(timeout=120) - - -@pytest.mark.quad_psram -@pytest.mark.parametrize( - 'config', - [ - 'psram', - ], - indirect=True, -) -@idf_parametrize('target', ['esp32s3'], indirect=['target']) -def test_spiffs_psram(dut: Dut) -> None: - dut.run_all_single_board_cases(timeout=120) diff --git a/components/vfs/test_apps/.build-test-rules.yml b/components/vfs/test_apps/.build-test-rules.yml index faf5f2de53..c83ce51ffd 100644 --- a/components/vfs/test_apps/.build-test-rules.yml +++ b/components/vfs/test_apps/.build-test-rules.yml @@ -5,7 +5,7 @@ components/vfs/test_apps: reason: not support yet # TODO: [esp32h21] IDF-11593 [ESP32H4] IDF-12372 disable_test: - - if: IDF_TARGET not in ["esp32", "esp32c2", "esp32c3", "esp32c6", "esp32h2", "esp32s3"] + - if: IDF_TARGET not in ["esp32c2", "esp32c3", "esp32c6", "esp32h2"] temporary: true reason: lack of runners diff --git a/components/vfs/test_apps/pytest_vfs.py b/components/vfs/test_apps/pytest_vfs.py index 038e405e29..1220b7d676 100644 --- a/components/vfs/test_apps/pytest_vfs.py +++ b/components/vfs/test_apps/pytest_vfs.py @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: 2023-2025 Espressif Systems (Shanghai) CO LTD +# SPDX-FileCopyrightText: 2023-2026 Espressif Systems (Shanghai) CO LTD # SPDX-License-Identifier: CC0-1.0 import pytest from pytest_embedded import Dut @@ -17,29 +17,3 @@ from pytest_embedded_idf.utils import idf_parametrize @idf_parametrize('target', ['esp32c2', 'esp32c3', 'esp32c6', 'esp32h2'], indirect=['target']) def test_vfs_default(dut: Dut) -> None: dut.run_all_single_board_cases() - - -@pytest.mark.generic -@pytest.mark.parametrize( - 'config', - [ - 'ccomp', - ], - indirect=True, -) -@idf_parametrize('target', ['esp32'], indirect=['target']) -def test_vfs_ccomp(dut: Dut) -> None: - dut.run_all_single_board_cases() - - -@pytest.mark.quad_psram -@pytest.mark.parametrize( - 'config', - [ - 'psram', - ], - indirect=True, -) -@idf_parametrize('target', ['esp32s3'], indirect=['target']) -def test_vfs_psram(dut: Dut) -> None: - dut.run_all_single_board_cases() diff --git a/examples/provisioning/wifi_prov_mgr/pytest_wifi_prov_mgr.py b/examples/provisioning/wifi_prov_mgr/pytest_wifi_prov_mgr.py index 1ab2343f32..65492ded79 100644 --- a/examples/provisioning/wifi_prov_mgr/pytest_wifi_prov_mgr.py +++ b/examples/provisioning/wifi_prov_mgr/pytest_wifi_prov_mgr.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -# SPDX-FileCopyrightText: 2018-2025 Espressif Systems (Shanghai) CO LTD +# SPDX-FileCopyrightText: 2018-2026 Espressif Systems (Shanghai) CO LTD # SPDX-License-Identifier: Apache-2.0 import logging import os @@ -102,10 +102,3 @@ def test_wifi_prov_mgr(dut: Dut, sec_ver: int) -> None: @idf_parametrize('target', ['esp32'], indirect=['target']) def test_examples_wifi_prov_mgr_sec1(dut: Dut) -> None: test_wifi_prov_mgr(dut, 1) - - -@pytest.mark.generic -@pytest.mark.xfail(reason='Runner unable to connect to target over Bluetooth', run=False) -@idf_parametrize('target', ['esp32'], indirect=['target']) -def test_examples_wifi_prov_mgr_sec2(dut: Dut) -> None: - test_wifi_prov_mgr(dut, 2) diff --git a/examples/system/efuse/pytest_system_efuse_example.py b/examples/system/efuse/pytest_system_efuse_example.py index 7e0df3cfd7..6eb218458b 100644 --- a/examples/system/efuse/pytest_system_efuse_example.py +++ b/examples/system/efuse/pytest_system_efuse_example.py @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: 2022-2025 Espressif Systems (Shanghai) CO LTD +# SPDX-FileCopyrightText: 2022-2026 Espressif Systems (Shanghai) CO LTD # SPDX-License-Identifier: Unlicense OR CC0-1.0 import logging import os @@ -6,7 +6,6 @@ import os import pytest from pytest_embedded import Dut from pytest_embedded_idf.utils import idf_parametrize -from pytest_embedded_idf.utils import soc_filtered_targets from pytest_embedded_qemu.dut import QemuDut @@ -664,14 +663,6 @@ def test_examples_efuse_with_virt_secure_boot_v2_esp32xx(dut: Dut) -> None: example_efuse_with_virt_secure_boot_v2_esp32xx(dut) -@pytest.mark.generic -@pytest.mark.parametrize('config', ['virt_secure_boot_v2_ecdsa_p384'], indirect=True) -@pytest.mark.parametrize('skip_autoflash', ['y'], indirect=True) -@idf_parametrize('target', soc_filtered_targets('SOC_ECDSA_SUPPORT_CURVE_P384 == 1'), indirect=['target']) -def test_examples_efuse_with_virt_secure_boot_v2_ecdsa_p384_esp32xx(dut: Dut) -> None: - example_efuse_with_virt_secure_boot_v2_esp32xx(dut) - - @pytest.mark.generic @pytest.mark.parametrize('config', ['virt_secure_boot_v2'], indirect=True) @pytest.mark.parametrize('skip_autoflash', ['y'], indirect=True) @@ -1102,11 +1093,3 @@ def example_efuse_with_virt_sb_v2_and_fe(dut: Dut) -> None: ) def test_examples_efuse_with_virt_sb_v2_and_fe_esp32xx(dut: Dut) -> None: example_efuse_with_virt_sb_v2_and_fe(dut) - - -@pytest.mark.generic -@pytest.mark.parametrize('skip_autoflash', ['y'], indirect=True) -@pytest.mark.parametrize('config', ['virt_sb_v2_ecdsa_p384_and_fe'], indirect=True) -@idf_parametrize('target', soc_filtered_targets('SOC_ECDSA_SUPPORT_CURVE_P384 == 1'), indirect=['target']) -def test_examples_efuse_with_virt_sb_v2_ecdsa_p384_and_fe_esp32xx(dut: Dut) -> None: - example_efuse_with_virt_sb_v2_and_fe(dut) diff --git a/examples/system/ota/partitions_ota/pytest_partitions_ota.py b/examples/system/ota/partitions_ota/pytest_partitions_ota.py index 0b52615901..cbf1ddcd5a 100644 --- a/examples/system/ota/partitions_ota/pytest_partitions_ota.py +++ b/examples/system/ota/partitions_ota/pytest_partitions_ota.py @@ -1,6 +1,7 @@ -# SPDX-FileCopyrightText: 2024-2025 Espressif Systems (Shanghai) CO LTD +# SPDX-FileCopyrightText: 2024-2026 Espressif Systems (Shanghai) CO LTD # SPDX-License-Identifier: Unlicense OR CC0-1.0 import http.server +import itertools import multiprocessing import os import ssl @@ -77,16 +78,19 @@ server_key = ( '-----END PRIVATE KEY-----\n' ) +CONFIG_PARTITIONS_OTA = [ + ('on_update_no_sb_ecdsa', 'esp32'), + *itertools.product( + ['on_update_no_sb_rsa', 'virt_sb_v2_and_fe', 'virt_sb_v2_and_fe_2'], + ['esp32', 'esp32c3', 'esp32s3'], + ), +] + @pytest.mark.wifi_high_traffic -@pytest.mark.parametrize( - 'config', - ['on_update_no_sb_ecdsa', 'on_update_no_sb_rsa', 'virt_sb_v2_and_fe', 'virt_sb_v2_and_fe_2'], - indirect=True, -) @pytest.mark.parametrize('skip_autoflash', ['y'], indirect=True) @pytest.mark.timeout(2400) -@idf_parametrize('target', ['esp32', 'esp32c3', 'esp32s3'], indirect=['target']) +@idf_parametrize('config, target', CONFIG_PARTITIONS_OTA, indirect=['config', 'target']) def test_examples_partitions_ota(dut: Dut) -> None: print(' - Erase flash') dut.serial.erase_flash() diff --git a/examples/wifi/getting_started/pytest_wifi_getting_started.py b/examples/wifi/getting_started/pytest_wifi_getting_started.py index e774507cf2..eb707cb326 100644 --- a/examples/wifi/getting_started/pytest_wifi_getting_started.py +++ b/examples/wifi/getting_started/pytest_wifi_getting_started.py @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: 2022-2025 Espressif Systems (Shanghai) CO LTD +# SPDX-FileCopyrightText: 2022-2026 Espressif Systems (Shanghai) CO LTD # SPDX-License-Identifier: CC0-1.0 import os.path from typing import Tuple @@ -111,33 +111,3 @@ def test_wifi_getting_started_esp32c2eco4_xtal_26mhz(dut: Tuple[IdfDut, IdfDut]) station.expect(f'{tag}: got ip:', timeout=60) station.expect(f'{tag}: connected to ap SSID:{ssid} password:{password}', timeout=60) softap.expect('station .+ join, AID=', timeout=60) - - -@pytest.mark.two_duts -@pytest.mark.esp32c3eco7 -@pytest.mark.parametrize( - 'count, config, app_path', - [ - ( - 2, - 'esp32c3eco7', - f'{os.path.join(os.path.dirname(__file__), "softAP")}|{os.path.join(os.path.dirname(__file__), "station")}', - ), - ], - indirect=True, -) -@idf_parametrize('target', ['esp32c3'], indirect=['target']) -def test_wifi_getting_started_esp32c3eco7(dut: Tuple[IdfDut, IdfDut]) -> None: - softap = dut[0] - station = dut[1] - - assert station.app.sdkconfig['ESP_WIFI_SOFTAP_SUPPORT'] is False - ssid = softap.app.sdkconfig.get('ESP_WIFI_SSID') - password = softap.app.sdkconfig.get('ESP_WIFI_PASSWORD') - assert station.app.sdkconfig.get('ESP_WIFI_SSID') == ssid - assert station.app.sdkconfig.get('ESP_WIFI_PASSWORD') == password - - tag = 'wifi station' - station.expect(f'{tag}: got ip:', timeout=60) - station.expect(f'{tag}: connected to ap SSID:{ssid} password:{password}', timeout=60) - softap.expect('station .+ join, AID=', timeout=60) diff --git a/tools/test_apps/build_system/ld_non_contiguous_memory/pytest_ld_non_contiguous_memory.py b/tools/test_apps/build_system/ld_non_contiguous_memory/pytest_ld_non_contiguous_memory.py index d7ef0b932b..b34d43c39d 100644 --- a/tools/test_apps/build_system/ld_non_contiguous_memory/pytest_ld_non_contiguous_memory.py +++ b/tools/test_apps/build_system/ld_non_contiguous_memory/pytest_ld_non_contiguous_memory.py @@ -6,7 +6,6 @@ from pytest_embedded_idf.utils import idf_parametrize @pytest.mark.generic -@idf_parametrize('config', ['app_in_flash'], indirect=['config']) @idf_parametrize('target', ['esp32p4'], indirect=['target']) def test_ld_non_contiguous_memory(dut: Dut) -> None: dut.expect_exact('buf2 placed in low sram') diff --git a/tools/test_apps/security/.build-test-rules.yml b/tools/test_apps/security/.build-test-rules.yml index 8ec9a97eb6..cb02072ea3 100644 --- a/tools/test_apps/security/.build-test-rules.yml +++ b/tools/test_apps/security/.build-test-rules.yml @@ -10,6 +10,6 @@ tools/test_apps/security/secure_boot: tools/test_apps/security/signed_app_no_secure_boot: enable: - - if: IDF_TARGET in ["esp32c2", "esp32c3"] + - if: IDF_TARGET in ["esp32c3"] temporary: true reason: No need to test on all targets diff --git a/tools/test_apps/security/signed_app_no_secure_boot/README.md b/tools/test_apps/security/signed_app_no_secure_boot/README.md index 7a2105fef3..9e864b59bc 100644 --- a/tools/test_apps/security/signed_app_no_secure_boot/README.md +++ b/tools/test_apps/security/signed_app_no_secure_boot/README.md @@ -1,5 +1,5 @@ -| Supported Targets | ESP32-C2 | ESP32-C3 | -| ----------------- | -------- | -------- | +| Supported Targets | ESP32-C3 | +| ----------------- | -------- | # Secure Signed On Update No Secure Boot diff --git a/tools/test_apps/security/signed_app_no_secure_boot/pytest_signed_app_no_secure_boot.py b/tools/test_apps/security/signed_app_no_secure_boot/pytest_signed_app_no_secure_boot.py index dedbc9b8da..9dde2e391a 100644 --- a/tools/test_apps/security/signed_app_no_secure_boot/pytest_signed_app_no_secure_boot.py +++ b/tools/test_apps/security/signed_app_no_secure_boot/pytest_signed_app_no_secure_boot.py @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: 2023-2025 Espressif Systems (Shanghai) CO LTD +# SPDX-FileCopyrightText: 2023-2026 Espressif Systems (Shanghai) CO LTD # SPDX-License-Identifier: Unlicense OR CC0-1.0 import pytest @@ -6,15 +6,6 @@ from pytest_embedded import Dut from pytest_embedded_idf.utils import idf_parametrize -@pytest.mark.generic -@idf_parametrize('target', ['esp32c2', 'esp32c3'], indirect=['target']) -def test_examples_security_on_update_no_secure_boot(dut: Dut) -> None: - dut.expect( - "This app is not signed, but check signature on update is enabled in config. It won't be possible to verify any update.", # noqa : E501 - timeout=10, - ) - - @pytest.mark.host_test @pytest.mark.qemu @pytest.mark.parametrize('config', ['secure_update_with_fe'], indirect=True) diff --git a/tools/test_apps/system/panic/pytest_panic.py b/tools/test_apps/system/panic/pytest_panic.py index b462bd6027..fc98b2578a 100644 --- a/tools/test_apps/system/panic/pytest_panic.py +++ b/tools/test_apps/system/panic/pytest_panic.py @@ -64,12 +64,6 @@ CONFIG_PANIC = list(itertools.chain(itertools.product(['panic'], ['supported_tar CONFIG_PANIC_DUAL_CORE = list(itertools.chain(itertools.product(['panic'], TARGETS_DUAL_CORE))) CONFIG_PANIC_HALT = list(itertools.chain(itertools.product(['panic_halt'], TARGETS_ALL))) -CONFIGS_BACKTRACE = list( - itertools.chain( - # One single-core target and one dual-core target is enough - itertools.product(['framepointer'], ['esp32c3', 'esp32p4']) - ) -) CONFIGS_DUAL_CORE = list( itertools.chain( @@ -708,7 +702,7 @@ def test_panic_handler_crash1(dut: PanicTestDut, config: str, test_func_name: st # currently ESP32-S2, ESP32-C3, ESP32-C2, ESP32-H2, ESP32-C6, ESP32-P4, ESP32-C5 and ESP32-C61 are supported CONFIGS_MEMPROT_IDRAM = list( itertools.chain( - itertools.product( + zip( [ 'memprot_esp32s2', 'memprot_esp32c3', @@ -727,7 +721,7 @@ CONFIGS_MEMPROT_DCACHE = list(itertools.chain(itertools.product(['memprot_esp32s CONFIGS_MEMPROT_RTC_FAST_MEM = list( itertools.chain( - itertools.product( + zip( [ 'memprot_esp32s2', 'memprot_esp32c3', @@ -746,7 +740,7 @@ CONFIGS_MEMPROT_RTC_SLOW_MEM = list(itertools.chain(itertools.product(['memprot_ CONFIGS_MEMPROT_FLASH_IDROM = list( itertools.chain( - itertools.product( + zip( ['memprot_esp32c5', 'memprot_esp32c6', 'memprot_esp32c61', 'memprot_esp32h2', 'memprot_esp32p4'], ['esp32c5', 'esp32c6', 'esp32c61', 'esp32h2', 'esp32p4'], ) @@ -755,7 +749,7 @@ CONFIGS_MEMPROT_FLASH_IDROM = list( CONFIGS_MEMPROT_SPIRAM_XIP_IROM_ALIGNMENT_HEAP = list( itertools.chain( - itertools.product( + zip( ['memprot_spiram_xip_esp32c5', 'memprot_spiram_xip_esp32c61', 'memprot_spiram_xip_esp32p4'], ['esp32c5', 'esp32c61', 'esp32p4'], ) @@ -764,7 +758,7 @@ CONFIGS_MEMPROT_SPIRAM_XIP_IROM_ALIGNMENT_HEAP = list( CONFIGS_MEMPROT_SPIRAM_XIP_DROM_ALIGNMENT_HEAP = list( itertools.chain( - itertools.product( + zip( [ 'memprot_spiram_xip_esp32s3', 'memprot_spiram_xip_esp32c5', @@ -778,7 +772,7 @@ CONFIGS_MEMPROT_SPIRAM_XIP_DROM_ALIGNMENT_HEAP = list( CONFIGS_MEMPROT_INVALID_REGION_PROTECTION_USING_PMA = list( itertools.chain( - itertools.product( + zip( ['memprot_esp32c5', 'memprot_esp32c6', 'memprot_esp32c61', 'memprot_esp32h2', 'memprot_esp32p4'], ['esp32c5', 'esp32c6', 'esp32c61', 'esp32h2', 'esp32p4'], ) @@ -1284,21 +1278,6 @@ def test_tcb_corrupted(dut: PanicTestDut, target: str, config: str, test_func_na common_test(dut, config, expected_backtrace=None, expected_coredump=coredump_pattern) -@pytest.mark.generic -@idf_parametrize('config, target', CONFIGS_BACKTRACE, indirect=['config', 'target']) -@pytest.mark.temp_skip_ci(targets=['esp32p4'], reason='p4 rev3 migration, IDF-14348') -def test_panic_print_backtrace(dut: PanicTestDut, config: str, test_func_name: str) -> None: - dut.run_test_func(test_func_name) - regex_pattern = rb'abort\(\) was called at PC [0-9xa-f]+ on core 0' - dut.expect(regex_pattern) - dut.expect_backtrace() - dut.expect_elf_sha256() - dut.expect_none(['Guru Meditation', 'Re-entered core dump']) - - coredump_pattern = re.compile(PANIC_ABORT_PREFIX + regex_pattern.decode('utf-8')) - common_test(dut, config, expected_backtrace=None, expected_coredump=[coredump_pattern]) - - @pytest.mark.generic @idf_parametrize('config, target', CONFIG_PANIC_HALT, indirect=['config', 'target']) @pytest.mark.temp_skip_ci(targets=['esp32p4'], reason='p4 rev3 migration, IDF-14348') From 6447e89a192396969c09ef70bf18638633b6bf99 Mon Sep 17 00:00:00 2001 From: Evgeny Torbin Date: Thu, 12 Mar 2026 12:44:23 +0100 Subject: [PATCH 3/3] ci: fix pre-commit hook errors --- tools/ci/idf_pytest/constants.py | 4 +++- tools/ci/idf_pytest/plugin.py | 6 +++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/tools/ci/idf_pytest/constants.py b/tools/ci/idf_pytest/constants.py index 32608322cd..7278497014 100644 --- a/tools/ci/idf_pytest/constants.py +++ b/tools/ci/idf_pytest/constants.py @@ -1,5 +1,7 @@ # SPDX-FileCopyrightText: 2023-2025 Espressif Systems (Shanghai) CO LTD # SPDX-License-Identifier: Apache-2.0 +import typing as t + """ Pytest Related Constants. Don't import third-party packages here. """ @@ -16,7 +18,7 @@ SUPPORTED_TARGETS = [ 'esp32c5', 'esp32c61', ] -PREVIEW_TARGETS: list[str] = [] # this PREVIEW_TARGETS excludes 'linux' target +PREVIEW_TARGETS: t.List[str] = [] # this PREVIEW_TARGETS excludes 'linux' target DEFAULT_LOGDIR = 'pytest-embedded' diff --git a/tools/ci/idf_pytest/plugin.py b/tools/ci/idf_pytest/plugin.py index 4de6ca6ac7..fc1a3503fe 100644 --- a/tools/ci/idf_pytest/plugin.py +++ b/tools/ci/idf_pytest/plugin.py @@ -49,8 +49,8 @@ def requires_elf_or_map(case: PytestCase) -> bool: return False -def skipped_targets(item: Function) -> set[str]: - def _get_temp_markers_disabled_targets(marker_name: str) -> set[str]: +def skipped_targets(item: Function) -> t.Set[str]: + def _get_temp_markers_disabled_targets(marker_name: str) -> t.Set[str]: targets = [] for _m in item.own_markers: if _m.name == marker_name: @@ -115,7 +115,7 @@ class IdfLocalPlugin: return item.callspec.params.get(key, default) or default @pytest.hookimpl(wrapper=True) - def pytest_collection_modifyitems(self, config: Config, items: list[Function]) -> t.Generator[None, None, None]: + def pytest_collection_modifyitems(self, config: Config, items: t.List[Function]) -> t.Generator[None, None, None]: yield # throw it back to idf-ci deselected_items = []