From 7e8181b976305c29ed74af937ae47258940277ad Mon Sep 17 00:00:00 2001 From: Marius Vikhammer Date: Tue, 24 Oct 2023 12:25:20 +0800 Subject: [PATCH] ci(heap): reduce the number of test apps built --- .../heap/test_apps/.build-test-rules.yml | 9 ++++ .../heap/test_apps/heap_tests/pytest_heap.py | 45 +++++-------------- .../heap_tests/sdkconfig.ci.abort_alloc_fail | 1 - .../heap_tests/sdkconfig.ci.func_hooks | 1 - ....8bit_access => sdkconfig.ci.misc_options} | 2 + 5 files changed, 23 insertions(+), 35 deletions(-) delete mode 100644 components/heap/test_apps/heap_tests/sdkconfig.ci.abort_alloc_fail delete mode 100644 components/heap/test_apps/heap_tests/sdkconfig.ci.func_hooks rename components/heap/test_apps/heap_tests/{sdkconfig.ci.8bit_access => sdkconfig.ci.misc_options} (59%) diff --git a/components/heap/test_apps/.build-test-rules.yml b/components/heap/test_apps/.build-test-rules.yml index e323365b56..1e3b8ecd8c 100644 --- a/components/heap/test_apps/.build-test-rules.yml +++ b/components/heap/test_apps/.build-test-rules.yml @@ -2,8 +2,17 @@ components/heap/test_apps/heap_tests: disable: + - if: IDF_TARGET == "linux" - if: CONFIG_NAME == "psram" and SOC_SPIRAM_SUPPORTED != 1 - if: CONFIG_NAME == "psram_all_ext" and SOC_SPIRAM_SUPPORTED != 1 + # These 3 configs are build only for non-nightly, buildig for a single target is sufficient + - if: CONFIG_NAME == "no_poisoning" and (IDF_TARGET != "esp32" and NIGHTLY_RUN != "1") + - if: CONFIG_NAME == "light_poisoning" and (IDF_TARGET != "esp32" and NIGHTLY_RUN != "1") + - if: CONFIG_NAME == "comprehensive_poisoning" and (IDF_TARGET != "esp32" and NIGHTLY_RUN != "1") + # Non-target specific functionality, only test on a single target in default pipeline + - if: CONFIG_NAME == "in_flash" and (IDF_TARGET != "esp32c6" and NIGHTLY_RUN != "1") + depends_components: + - heap components/heap/test_apps/host_test_linux: enable: diff --git a/components/heap/test_apps/heap_tests/pytest_heap.py b/components/heap/test_apps/heap_tests/pytest_heap.py index 1c51d22fd4..c3684eff2d 100644 --- a/components/heap/test_apps/heap_tests/pytest_heap.py +++ b/components/heap/test_apps/heap_tests/pytest_heap.py @@ -39,8 +39,7 @@ def test_heap_poisoning_qemu(dut: Dut) -> None: @pytest.mark.generic -@pytest.mark.esp32 -@pytest.mark.esp32c6 +@pytest.mark.supported_targets @pytest.mark.parametrize( 'config', [ @@ -71,27 +70,21 @@ def test_heap(dut: Dut) -> None: @pytest.mark.parametrize( 'config', [ - 'abort_alloc_fail' + 'misc_options' ] ) -def test_heap_abort_on_alloc_failure(dut: Dut) -> None: - dut.expect_exact('Press ENTER to see the list of tests') - dut.write('"When enabled, allocation operation failure generates an abort"') - dut.expect('Backtrace: ') - - -@pytest.mark.generic -@pytest.mark.esp32 -@pytest.mark.parametrize( - 'config', - [ - '8bit_access' - ] -) -def test_heap_8bit_access(dut: Dut) -> None: +def test_heap_misc_options(dut: Dut) -> None: dut.expect_exact('Press ENTER to see the list of tests') dut.write('"IRAM_8BIT capability test"') - dut.expect_unity_test_output(timeout=300) + dut.expect_unity_test_output() + + dut.expect_exact("Enter next test, or 'enter' to see menu") + dut.write('"test allocation and free function hooks"') + dut.expect_unity_test_output() + + dut.expect_exact("Enter next test, or 'enter' to see menu") + dut.write('"When enabled, allocation operation failure generates an abort"') + dut.expect('Backtrace: ') @pytest.mark.generic @@ -134,17 +127,3 @@ def test_memory_protection(dut: Dut) -> None: dut.expect_exact('Press ENTER to see the list of tests') dut.write('[heap][mem_prot]') dut.expect_unity_test_output(timeout=300) - - -@pytest.mark.generic -@pytest.mark.esp32 -@pytest.mark.parametrize( - 'config', - [ - 'func_hooks' - ] -) -def test_heap_func_hooks(dut: Dut) -> None: - dut.expect_exact('Press ENTER to see the list of tests') - dut.write('"test allocation and free function hooks"') - dut.expect_unity_test_output(timeout=300) diff --git a/components/heap/test_apps/heap_tests/sdkconfig.ci.abort_alloc_fail b/components/heap/test_apps/heap_tests/sdkconfig.ci.abort_alloc_fail deleted file mode 100644 index 1dd2c31d33..0000000000 --- a/components/heap/test_apps/heap_tests/sdkconfig.ci.abort_alloc_fail +++ /dev/null @@ -1 +0,0 @@ -CONFIG_HEAP_ABORT_WHEN_ALLOCATION_FAILS=y diff --git a/components/heap/test_apps/heap_tests/sdkconfig.ci.func_hooks b/components/heap/test_apps/heap_tests/sdkconfig.ci.func_hooks deleted file mode 100644 index 9a440b80de..0000000000 --- a/components/heap/test_apps/heap_tests/sdkconfig.ci.func_hooks +++ /dev/null @@ -1 +0,0 @@ -CONFIG_HEAP_USE_HOOKS=y diff --git a/components/heap/test_apps/heap_tests/sdkconfig.ci.8bit_access b/components/heap/test_apps/heap_tests/sdkconfig.ci.misc_options similarity index 59% rename from components/heap/test_apps/heap_tests/sdkconfig.ci.8bit_access rename to components/heap/test_apps/heap_tests/sdkconfig.ci.misc_options index 3cc667f532..8e7394bf68 100644 --- a/components/heap/test_apps/heap_tests/sdkconfig.ci.8bit_access +++ b/components/heap/test_apps/heap_tests/sdkconfig.ci.misc_options @@ -1,3 +1,5 @@ CONFIG_IDF_TARGET="esp32" CONFIG_FREERTOS_UNICORE=y CONFIG_ESP32_IRAM_AS_8BIT_ACCESSIBLE_MEMORY=y +CONFIG_HEAP_USE_HOOKS=y +CONFIG_HEAP_ABORT_WHEN_ALLOCATION_FAILS=y