From e02801caadc9c5f3dc0d0d3feb15e4fde6effc6f Mon Sep 17 00:00:00 2001 From: Harshit Malpani Date: Thu, 29 Feb 2024 12:11:36 +0530 Subject: [PATCH] ci: Fix otatool example failure in CI for ESP32-C2 --- examples/system/ota/otatool/pytest_otatool.py | 30 ++++++++++++------- tools/ci/idf_pytest/constants.py | 1 + 2 files changed, 21 insertions(+), 10 deletions(-) diff --git a/examples/system/ota/otatool/pytest_otatool.py b/examples/system/ota/otatool/pytest_otatool.py index 9313d3ae0d..4f8fd2bd85 100644 --- a/examples/system/ota/otatool/pytest_otatool.py +++ b/examples/system/ota/otatool/pytest_otatool.py @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD +# SPDX-FileCopyrightText: 2022-2024 Espressif Systems (Shanghai) CO LTD # SPDX-License-Identifier: Unlicense OR CC0-1.0 import os import subprocess @@ -8,15 +8,7 @@ import pytest from pytest_embedded import Dut -@pytest.mark.esp32 -@pytest.mark.esp32s2 -@pytest.mark.esp32c3 -@pytest.mark.esp32s3 -@pytest.mark.esp32c6 -@pytest.mark.esp32c2 -@pytest.mark.esp32p4 -@pytest.mark.generic -def test_otatool_example(dut: Dut) -> None: +def _real_test_func(dut: Dut) -> None: # Verify factory firmware dut.expect('OTA Tool Example') dut.expect('Example end') @@ -32,3 +24,21 @@ def test_otatool_example(dut: Dut) -> None: binary_path = flash_file[1] break subprocess.check_call([sys.executable, script_path, '--binary', binary_path]) + + +@pytest.mark.esp32 +@pytest.mark.esp32s2 +@pytest.mark.esp32c3 +@pytest.mark.esp32s3 +@pytest.mark.esp32c6 +@pytest.mark.esp32p4 +@pytest.mark.generic +def test_otatool_example(dut: Dut) -> None: + _real_test_func(dut) + + +@pytest.mark.esp32c2 +@pytest.mark.generic +@pytest.mark.flash_4mb +def test_otatool_example_c2_4mb(dut: Dut) -> None: + _real_test_func(dut) diff --git a/tools/ci/idf_pytest/constants.py b/tools/ci/idf_pytest/constants.py index c855b9d2ad..8ab64183f0 100644 --- a/tools/ci/idf_pytest/constants.py +++ b/tools/ci/idf_pytest/constants.py @@ -102,6 +102,7 @@ ENV_MARKERS = { 'nvs_encr_hmac': 'Runner with test HMAC key programmed in efuse', 'i2c_oled': 'Runner with ssd1306 I2C oled connected', 'httpbin': 'runner for tests that need to access the httpbin service', + 'flash_4mb': 'C2 runners with 4 MB flash', # multi-dut markers 'multi_dut_modbus_rs485': 'a pair of runners connected by RS485 bus', 'ieee802154': 'ieee802154 related tests should run on ieee802154 runners.',