From c4091261b05ddbd8b3686f71ccaf08f74a3b9059 Mon Sep 17 00:00:00 2001 From: Chen Yudong Date: Fri, 20 Mar 2026 14:27:05 +0800 Subject: [PATCH] ci: fix wifi unit test nvs_config --- components/esp_wifi/test_apps/.build-test-rules.yml | 2 -- .../esp_wifi/test_apps/wifi_nvs_config/CMakeLists.txt | 6 +++--- .../test_apps/wifi_nvs_config/main/app_main.c | 2 +- .../wifi_nvs_config/pytest_wifi_nvs_connect.py | 11 +++++++++++ .../esp_wifi/test_apps/wifi_nvs_config/sdkconfig.ci | 1 + 5 files changed, 16 insertions(+), 6 deletions(-) create mode 100644 components/esp_wifi/test_apps/wifi_nvs_config/sdkconfig.ci diff --git a/components/esp_wifi/test_apps/.build-test-rules.yml b/components/esp_wifi/test_apps/.build-test-rules.yml index 771308393a4..a9972bba6c5 100644 --- a/components/esp_wifi/test_apps/.build-test-rules.yml +++ b/components/esp_wifi/test_apps/.build-test-rules.yml @@ -21,8 +21,6 @@ components/esp_wifi/test_apps/: components/esp_wifi/test_apps/wifi_nvs_config: disable: - if: SOC_WIFI_SUPPORTED != 1 - disable_test: - - if: IDF_TARGET != "esp32c2" depends_components: - esp_hw_support - esp_rom diff --git a/components/esp_wifi/test_apps/wifi_nvs_config/CMakeLists.txt b/components/esp_wifi/test_apps/wifi_nvs_config/CMakeLists.txt index 9f8a4bb4892..fb1b2458dd0 100644 --- a/components/esp_wifi/test_apps/wifi_nvs_config/CMakeLists.txt +++ b/components/esp_wifi/test_apps/wifi_nvs_config/CMakeLists.txt @@ -9,13 +9,13 @@ set(COMPONENTS main) include($ENV{IDF_PATH}/tools/cmake/project.cmake) if($ENV{CI_PIPELINE_ID}) - idf_build_set_property(COMPILE_DEFINITIONS TEST_SUFFIX_STR="_$ENV{CI_PIPELINE_ID}" APPEND) + idf_build_set_property(COMPILE_DEFINITIONS TEST_SUFFIX_STR="_${IDF_TARGET}_$ENV{CI_PIPELINE_ID}" APPEND) endif() if(DEFINED ENV{CI_PIPELINE_ID}) - set(TEST_SUFFIX_STR "_$ENV{CI_PIPELINE_ID}") + set(TEST_SUFFIX_STR "_${IDF_TARGET}_$ENV{CI_PIPELINE_ID}") else() - string(TIMESTAMP TEST_SUFFIX_STR "%Y%m%d%H%M%S") + string(TIMESTAMP TEST_SUFFIX_STR "_${IDF_TARGET}_%Y%m%d%H%M%S") endif() execute_process( diff --git a/components/esp_wifi/test_apps/wifi_nvs_config/main/app_main.c b/components/esp_wifi/test_apps/wifi_nvs_config/main/app_main.c index 23b373738cf..35c3a9f5107 100644 --- a/components/esp_wifi/test_apps/wifi_nvs_config/main/app_main.c +++ b/components/esp_wifi/test_apps/wifi_nvs_config/main/app_main.c @@ -16,7 +16,7 @@ // #define TEST_MEMORY_LEAK_THRESHOLD (-1546) // With PSA Migration, there is an increase in memory usage. // TODO: Check why this is happening and fix it. -#define TEST_MEMORY_LEAK_THRESHOLD (-1850) +#define TEST_MEMORY_LEAK_THRESHOLD (-2560) static size_t before_free_8bit; static size_t before_free_32bit; diff --git a/components/esp_wifi/test_apps/wifi_nvs_config/pytest_wifi_nvs_connect.py b/components/esp_wifi/test_apps/wifi_nvs_config/pytest_wifi_nvs_connect.py index a9b7bf9b668..5fd6124813d 100644 --- a/components/esp_wifi/test_apps/wifi_nvs_config/pytest_wifi_nvs_connect.py +++ b/components/esp_wifi/test_apps/wifi_nvs_config/pytest_wifi_nvs_connect.py @@ -5,6 +5,17 @@ from pytest_embedded_idf.unity_tester import CaseTester from pytest_embedded_idf.utils import idf_parametrize +@pytest.mark.two_duts +@pytest.mark.parametrize('count', [2], indirect=True) +@idf_parametrize( + 'target', + ['esp32', 'esp32c3', 'esp32c5', 'esp32c6', 'esp32c61', 'esp32s2', 'esp32s3'], + indirect=['target'], +) +def test_wifi_nvs_connect_cases(case_tester: CaseTester) -> None: # type: ignore + case_tester.run_all_cases() + + @pytest.mark.two_duts @pytest.mark.xtal_26mhz @pytest.mark.parametrize( diff --git a/components/esp_wifi/test_apps/wifi_nvs_config/sdkconfig.ci b/components/esp_wifi/test_apps/wifi_nvs_config/sdkconfig.ci new file mode 100644 index 00000000000..b25c66247b6 --- /dev/null +++ b/components/esp_wifi/test_apps/wifi_nvs_config/sdkconfig.ci @@ -0,0 +1 @@ +# build for config: default