From 559fb2d2bffe6ceb11416b4442e26a0a6794daa1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Rohl=C3=ADnek?= Date: Mon, 16 Oct 2023 08:20:08 +0200 Subject: [PATCH] feat(storage): minimize platforms for tests --- examples/storage/.build-test-rules.yml | 30 ++++++++++++------- .../ext_flash_fatfs/pytest_ext_flash_fatfs.py | 1 - .../fatfsgen/main/fatfsgen_example_main.c | 1 - .../storage/nvs_rw_blob/pytest_nvs_rw_blob.py | 3 +- .../nvs_rw_value/pytest_nvs_rw_value.py | 3 +- .../pytest_nvs_rw_value_cxx.py | 3 +- .../sdspi/pytest_sdspi_card_example.py | 1 - .../semihost_vfs/pytest_semihost_vfs.py | 24 --------------- .../storage/spiffs/pytest_spiffs_example.py | 3 +- .../pytest_wear_levelling_example.py | 3 +- 10 files changed, 30 insertions(+), 42 deletions(-) diff --git a/examples/storage/.build-test-rules.yml b/examples/storage/.build-test-rules.yml index 30e10b7d3a..7840ae2ad7 100644 --- a/examples/storage/.build-test-rules.yml +++ b/examples/storage/.build-test-rules.yml @@ -2,10 +2,11 @@ examples/storage/custom_flash_driver: depends_components: - - fatfs - - vfs - spi_flash - driver + disable_test: + - if: IDF_TARGET not in ["esp32", "esp32c3"] + reason: only one target per arch needed examples/storage/emmc: depends_components: @@ -23,12 +24,11 @@ examples/storage/ext_flash_fatfs: - vfs - spi_flash - driver - - esp_system disable: - if: IDF_TARGET == "esp32p4" reason: not supported yet disable_test: - - if: IDF_TARGET not in ["esp32", "esp32s2"] + - if: IDF_TARGET not in ["esp32"] temporary: true reason: lack of runners @@ -36,7 +36,6 @@ examples/storage/fatfsgen: depends_components: - fatfs - vfs - - esp_system disable_test: - if: IDF_TARGET != "esp32" reason: only one target needed @@ -45,17 +44,23 @@ examples/storage/nvs_rw_blob: depends_components: - nvs_flash - driver - - esp_system + disable_test: + - if: IDF_TARGET not in ["esp32", "esp32c3"] + reason: only one target per arch needed examples/storage/nvs_rw_value: depends_components: - nvs_flash - - nvs_system + disable_test: + - if: IDF_TARGET not in ["esp32", "esp32c3"] + reason: only one target per arch needed examples/storage/nvs_rw_value_cxx: depends_components: - nvs_flash - - nvs_system + disable_test: + - if: IDF_TARGET not in ["esp32", "esp32c3"] + reason: only one target per arch needed examples/storage/nvsgen: depends_components: @@ -100,7 +105,6 @@ examples/storage/perf_benchmark: - vfs - sdmmc - spiffs - - soc - wear_levelling - esp_partition - driver @@ -133,7 +137,7 @@ examples/storage/sd_card/sdspi: disable: - if: SOC_GPSPI_SUPPORTED != 1 disable_test: - - if: IDF_TARGET not in ["esp32", "esp32c3", "esp32s2"] + - if: IDF_TARGET not in ["esp32", "esp32c3"] temporary: true reason: lack of runners @@ -149,6 +153,9 @@ examples/storage/spiffs: depends_components: - spiffs - vfs + disable_test: + - if: IDF_TARGET not in ["esp32", "esp32c3"] + reason: only one target per arch needed examples/storage/spiffsgen: depends_components: @@ -164,3 +171,6 @@ examples/storage/wear_levelling: - vfs - wear_levelling - fatfs + disable_test: + - if: IDF_TARGET not in ["esp32", "esp32c3"] + reason: only one target per arch needed diff --git a/examples/storage/ext_flash_fatfs/pytest_ext_flash_fatfs.py b/examples/storage/ext_flash_fatfs/pytest_ext_flash_fatfs.py index b3dfd1e5b9..afe81763a3 100644 --- a/examples/storage/ext_flash_fatfs/pytest_ext_flash_fatfs.py +++ b/examples/storage/ext_flash_fatfs/pytest_ext_flash_fatfs.py @@ -7,7 +7,6 @@ from pytest_embedded import Dut @pytest.mark.esp32 -@pytest.mark.esp32s2 @pytest.mark.external_flash def test_ext_flash_fatfs(dut: Dut) -> None: message_list = ('Initialized external Flash', diff --git a/examples/storage/fatfsgen/main/fatfsgen_example_main.c b/examples/storage/fatfsgen/main/fatfsgen_example_main.c index 491622c4e4..1c0c94dc3f 100644 --- a/examples/storage/fatfsgen/main/fatfsgen_example_main.c +++ b/examples/storage/fatfsgen/main/fatfsgen_example_main.c @@ -9,7 +9,6 @@ #include #include "esp_vfs.h" #include "esp_vfs_fat.h" -#include "esp_system.h" #include "sdkconfig.h" #if CONFIG_EXAMPLE_FATFS_MODE_READ_ONLY diff --git a/examples/storage/nvs_rw_blob/pytest_nvs_rw_blob.py b/examples/storage/nvs_rw_blob/pytest_nvs_rw_blob.py index 422dee3bb0..01840dcda3 100644 --- a/examples/storage/nvs_rw_blob/pytest_nvs_rw_blob.py +++ b/examples/storage/nvs_rw_blob/pytest_nvs_rw_blob.py @@ -11,7 +11,8 @@ import pytest from pytest_embedded import Dut -@pytest.mark.supported_targets +@pytest.mark.esp32 +@pytest.mark.esp32c3 def test_examples_nvs_rw_blob(dut: Dut) -> None: def expect_start_msg(index: int) -> None: dut.expect('Restart counter = {}'.format(index), timeout=10) diff --git a/examples/storage/nvs_rw_value/pytest_nvs_rw_value.py b/examples/storage/nvs_rw_value/pytest_nvs_rw_value.py index e7f2f30c2a..aae3f1e038 100644 --- a/examples/storage/nvs_rw_value/pytest_nvs_rw_value.py +++ b/examples/storage/nvs_rw_value/pytest_nvs_rw_value.py @@ -8,7 +8,8 @@ import pytest from pytest_embedded import Dut -@pytest.mark.supported_targets +@pytest.mark.esp32 +@pytest.mark.esp32c3 def test_examples_nvs_rw_value(dut: Dut) -> None: for i, counter_state in zip_longest(range(4), ('The value is not initialized yet!',), fillvalue='Done'): dut.expect('Opening Non-Volatile Storage \\(NVS\\) handle... Done', timeout=20) diff --git a/examples/storage/nvs_rw_value_cxx/pytest_nvs_rw_value_cxx.py b/examples/storage/nvs_rw_value_cxx/pytest_nvs_rw_value_cxx.py index e2f990e8e8..cd1237058c 100644 --- a/examples/storage/nvs_rw_value_cxx/pytest_nvs_rw_value_cxx.py +++ b/examples/storage/nvs_rw_value_cxx/pytest_nvs_rw_value_cxx.py @@ -8,7 +8,8 @@ import pytest from pytest_embedded import Dut -@pytest.mark.supported_targets +@pytest.mark.esp32 +@pytest.mark.esp32c3 def test_examples_nvs_rw_value_cxx(dut: Dut) -> None: for i, counter_state in zip_longest(range(4), ('The value is not initialized yet!',), fillvalue='Done'): dut.expect('Opening Non-Volatile Storage \\(NVS\\) handle... Done', timeout=20) diff --git a/examples/storage/sd_card/sdspi/pytest_sdspi_card_example.py b/examples/storage/sd_card/sdspi/pytest_sdspi_card_example.py index 480aa9f2d6..4f2b42bb58 100644 --- a/examples/storage/sd_card/sdspi/pytest_sdspi_card_example.py +++ b/examples/storage/sd_card/sdspi/pytest_sdspi_card_example.py @@ -11,7 +11,6 @@ from pytest_embedded import Dut @pytest.mark.esp32 @pytest.mark.esp32c3 # no runner available at the moment -@pytest.mark.esp32s2 @pytest.mark.sdcard_spimode def test_examples_sd_card_sdspi(dut: Dut) -> None: dut.expect('example: Initializing SD card', timeout=20) diff --git a/examples/storage/semihost_vfs/pytest_semihost_vfs.py b/examples/storage/semihost_vfs/pytest_semihost_vfs.py index 9345086b70..03dd2acdb2 100644 --- a/examples/storage/semihost_vfs/pytest_semihost_vfs.py +++ b/examples/storage/semihost_vfs/pytest_semihost_vfs.py @@ -34,30 +34,6 @@ def prepare() -> t.Generator[None, None, None]: f'-c \'set ESP_SEMIHOST_BASEDIR "{TEMP_DIR}"\' -f board/esp32-wrover-kit-3.3v.cfg', marks=[pytest.mark.esp32], ), - # pytest.param( - # 'esp,idf,jtag', - # 'y', - # f'-c \'set ESP_SEMIHOST_BASEDIR "{TEMP_DIR}"\' -f board/esp32c2-ftdi.cfg', - # marks=[pytest.mark.esp32c2], - # ), - # pytest.param( - # 'esp,idf,jtag', - # 'y', - # f'-c \'set ESP_SEMIHOST_BASEDIR "{TEMP_DIR}"\' -f board/esp32s2-kaluga-1.cfg', - # marks=[pytest.mark.esp32c3], - # ), - # pytest.param( - # 'esp,idf,jtag', - # 'y', - # f'-c \'set ESP_SEMIHOST_BASEDIR "{TEMP_DIR}"\' -f board/esp32s2-kaluga-1.cfg', - # marks=[pytest.mark.esp32s2], - # ), - # pytest.param( - # 'esp,idf,jtag', - # 'y', - # f'-c \'set ESP_SEMIHOST_BASEDIR "{TEMP_DIR}"\' -f board/esp32s2-kaluga-1.cfg', - # marks=[pytest.mark.esp32s3], - # ), ], indirect=True, ) diff --git a/examples/storage/spiffs/pytest_spiffs_example.py b/examples/storage/spiffs/pytest_spiffs_example.py index 0687ffe82f..70e1540ecd 100644 --- a/examples/storage/spiffs/pytest_spiffs_example.py +++ b/examples/storage/spiffs/pytest_spiffs_example.py @@ -7,7 +7,8 @@ import pytest from pytest_embedded import Dut -@pytest.mark.supported_targets +@pytest.mark.esp32 +@pytest.mark.esp32c3 def test_examples_spiffs(dut: Dut) -> None: message_list = (rb'example: Initializing SPIFFS', rb'example: Partition size: total: \d+, used: \d+', diff --git a/examples/storage/wear_levelling/pytest_wear_levelling_example.py b/examples/storage/wear_levelling/pytest_wear_levelling_example.py index c55352e02a..51ef1670ac 100644 --- a/examples/storage/wear_levelling/pytest_wear_levelling_example.py +++ b/examples/storage/wear_levelling/pytest_wear_levelling_example.py @@ -8,7 +8,8 @@ import pytest from pytest_embedded import Dut -@pytest.mark.supported_targets +@pytest.mark.esp32 +@pytest.mark.esp32c3 def test_wear_levelling_example(dut: Dut) -> None: message_list = ('example: Mounting FAT filesystem',