Merge branch 'ci/metric_apps' into 'master'

ci(size_metrics): add more size metrics apps

See merge request espressif/esp-idf!51622
This commit is contained in:
Marius Vikhammer
2026-08-10 19:50:14 +08:00
8 changed files with 85 additions and 0 deletions

View File

@@ -5,3 +5,8 @@ tools/test_apps/size_metrics/minimal_baseline:
- if: IDF_TARGET == "linux"
temporary: true
reason: Not a real hardware target
tools/test_apps/size_metrics/wifi_ota:
disable:
- if: SOC_WIFI_SUPPORTED != 1
reason: Wi-Fi is not supported

View File

@@ -0,0 +1,12 @@
# This is the project CMakeLists.txt file for the wifi_ota size metrics test app
cmake_minimum_required(VERSION 3.22)
list(PREPEND SDKCONFIG_DEFAULTS
"$ENV{IDF_PATH}/tools/test_apps/configs/sdkconfig.size_metrics"
"sdkconfig.defaults")
# "Trim" the build. Include the minimal set of components, main, and anything it depends on.
set(COMPONENTS main)
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
project(wifi_ota)

View File

@@ -0,0 +1,8 @@
| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C5 | ESP32-C6 | ESP32-C61 | ESP32-H2 | ESP32-H21 | ESP32-H4 | ESP32-P4 | ESP32-S2 | ESP32-S3 | ESP32-S31 |
| ----------------- | ----- | -------- | -------- | -------- | -------- | --------- | -------- | --------- | -------- | -------- | -------- | -------- | --------- |
# Wi-Fi OTA Size Metrics App
This build-only app tracks the size of a minimal application using Wi-Fi and
HTTPS OTA. It calls the production APIs so their implementations are retained
by the linker, but it is intentionally skipped by the target-test pipeline.

View File

@@ -0,0 +1,2 @@
idf_component_register(SRCS "main.c"
PRIV_REQUIRES esp_event esp_https_ota esp_netif esp_wifi mbedtls nvs_flash)

View File

@@ -0,0 +1,32 @@
/*
* SPDX-FileCopyrightText: 2026 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Unlicense OR CC0-1.0
*/
#include "esp_event.h"
#include "esp_https_ota.h"
#include "esp_netif.h"
#include "esp_wifi.h"
#include "nvs_flash.h"
void app_main(void)
{
ESP_ERROR_CHECK(nvs_flash_init());
ESP_ERROR_CHECK(esp_netif_init());
ESP_ERROR_CHECK(esp_event_loop_create_default());
esp_netif_create_default_wifi_sta();
wifi_init_config_t wifi_config = WIFI_INIT_CONFIG_DEFAULT();
ESP_ERROR_CHECK(esp_wifi_init(&wifi_config));
ESP_ERROR_CHECK(esp_wifi_set_mode(WIFI_MODE_STA));
ESP_ERROR_CHECK(esp_wifi_start());
esp_http_client_config_t http_config = {
.url = "https://example.invalid/firmware.bin",
};
esp_https_ota_config_t ota_config = {
.http_config = &http_config,
};
ESP_ERROR_CHECK(esp_https_ota(&ota_config));
}

View File

@@ -0,0 +1,18 @@
# SPDX-FileCopyrightText: 2026 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: Unlicense OR CC0-1.0
import pytest
from pytest_embedded_idf.dut import IdfDut
from pytest_embedded_idf.utils import idf_parametrize
from pytest_embedded_idf.utils import soc_filtered_targets
@pytest.mark.generic
@pytest.mark.skip(reason='Build-only configuration used for size metrics')
@pytest.mark.parametrize('config', ['default'], indirect=True)
@idf_parametrize(
'target',
soc_filtered_targets('SOC_WIFI_SUPPORTED == 1', targets='supported_targets'),
indirect=['target'],
)
def test_wifi_ota_build_only(dut: IdfDut) -> None:
pass

View File

@@ -0,0 +1,3 @@
# App-specific defaults for the Wi-Fi OTA size metrics app
CONFIG_PARTITION_TABLE_TWO_OTA=y
CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y