From 2cd3758fc796506d0106051101dea5237da3d437 Mon Sep 17 00:00:00 2001 From: Marius Vikhammer Date: Wed, 31 Dec 2025 10:58:05 +0800 Subject: [PATCH] ci(core): fixed esp_event not running properly in CI --- .../esp_event/test_apps/pytest_esp_event.py | 45 +++++++++++++++---- .../esp_event/test_apps/sdkconfig.ci.defaults | 0 .../test_apps/sdkconfig.ci.no_isr_post | 3 +- 3 files changed, 37 insertions(+), 11 deletions(-) create mode 100644 components/esp_event/test_apps/sdkconfig.ci.defaults diff --git a/components/esp_event/test_apps/pytest_esp_event.py b/components/esp_event/test_apps/pytest_esp_event.py index ff04ca3a55b..397e1dc01f0 100644 --- a/components/esp_event/test_apps/pytest_esp_event.py +++ b/components/esp_event/test_apps/pytest_esp_event.py @@ -2,37 +2,64 @@ # SPDX-License-Identifier: CC0-1.0 import pytest from pytest_embedded import Dut +from pytest_embedded_idf.utils import idf_parametrize -@pytest.mark.esp32 -@pytest.mark.esp32s2 -@pytest.mark.esp32c3 @pytest.mark.generic +@pytest.mark.parametrize( + 'config', + [ + 'defaults', + 'no_isr_post', + ], + indirect=True, +) +@idf_parametrize('target', ['esp32', 'esp32s2', 'esp32c3'], indirect=['target']) def test_esp_event(dut: Dut) -> None: dut.run_all_single_board_cases() -@pytest.mark.esp32 -@pytest.mark.esp32c3 @pytest.mark.host_test @pytest.mark.qemu @pytest.mark.xfail('config.getvalue("target") == "esp32c3"', reason='Unstable on QEMU, needs investigation') +@pytest.mark.parametrize( + 'config', + [ + 'defaults', + ], + indirect=True, +) +@idf_parametrize('target', ['esp32', 'esp32c3'], indirect=['target']) def test_esp_event_qemu(dut: Dut) -> None: for case in dut.test_menu: if 'qemu-ignore' not in case.groups and not case.is_ignored and case.type == 'normal': dut._run_normal_case(case) -@pytest.mark.linux @pytest.mark.host_test +@idf_parametrize('target', ['linux'], indirect=['target']) +@pytest.mark.parametrize( + 'config', + [ + 'defaults', + ], + indirect=True, +) def test_esp_event_posix_simulator(dut: Dut) -> None: dut.expect_exact('Press ENTER to see the list of tests.') dut.write('*') dut.expect(r'\d{2} Tests 0 Failures 0 Ignored', timeout=120) -@pytest.mark.esp32 @pytest.mark.generic +@idf_parametrize('target', ['esp32'], indirect=['target']) +@pytest.mark.parametrize( + 'config', + [ + 'defaults', + ], + indirect=True, +) def test_esp_event_profiling(dut: Dut) -> None: dut.expect_exact('Press ENTER to see the list of tests.') dut.write('"profiling reports valid values"') @@ -40,7 +67,7 @@ def test_esp_event_profiling(dut: Dut) -> None: # with an execution time superior to 0 us matches = dut.expect(r'HANDLER .+ inv:[1-9][0-9]{0,} time:[1-9][0-9]{0,} us', timeout=2) matches_arr = matches.group().split(b'\r\n') - assert (len(matches_arr) == 3) + assert len(matches_arr) == 3 dut.expect('1 Tests 0 Failures 0 Ignored', timeout=120) dut.expect_exact("Enter next test, or 'enter' to see menu") @@ -48,7 +75,7 @@ def test_esp_event_profiling(dut: Dut) -> None: # look for 1 handlers never invoked matches = dut.expect(r'HANDLER .+ inv:0 time:0 us', timeout=2) matches_arr = matches.group().split(b'\r\n') - assert (len(matches_arr) == 1) + assert len(matches_arr) == 1 dut.expect('1 Tests 0 Failures 0 Ignored', timeout=120) dut.expect_exact("Enter next test, or 'enter' to see menu") diff --git a/components/esp_event/test_apps/sdkconfig.ci.defaults b/components/esp_event/test_apps/sdkconfig.ci.defaults new file mode 100644 index 00000000000..e69de29bb2d diff --git a/components/esp_event/test_apps/sdkconfig.ci.no_isr_post b/components/esp_event/test_apps/sdkconfig.ci.no_isr_post index 1b0464b2588..74478bc74bf 100644 --- a/components/esp_event/test_apps/sdkconfig.ci.no_isr_post +++ b/components/esp_event/test_apps/sdkconfig.ci.no_isr_post @@ -1,3 +1,2 @@ # This configuration checks the event loop if posting from ISR is disabled -CONFIG_ESP_TASK_WDT_INIT=n -CONFIG_POST_EVENTS_FROM_ISR=n +CONFIG_ESP_EVENT_POST_FROM_ISR=n