From 86fd13230e7cc0cb70a3feb9882533dd03820758 Mon Sep 17 00:00:00 2001 From: Roland Dobai Date: Tue, 5 Nov 2019 14:48:30 +0100 Subject: [PATCH] CI: Don't download esp32s2beta builds into example tests --- .../hello_world/loadable_elf_example_test.py | 15 +++++++++++++-- tools/ci/config/target-test.yml | 1 - tools/tiny-test-fw/IDF/IDFApp.py | 2 ++ 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/examples/get-started/hello_world/loadable_elf_example_test.py b/examples/get-started/hello_world/loadable_elf_example_test.py index c6f9e2462..71c2b60cd 100644 --- a/examples/get-started/hello_world/loadable_elf_example_test.py +++ b/examples/get-started/hello_world/loadable_elf_example_test.py @@ -64,8 +64,14 @@ class GDBProcess(CustomProcess): 'Load failed']) if i == 0: Utility.console_log('gdb is at breakpoint') + elif i == 1: + raise RuntimeError('Load has failed. Please examine the logs.') else: - raise RuntimeError('Load failed: probably the ELF file was not built for loading with gdb') + Utility.console_log('i = {}'.format(i)) + Utility.console_log(str(self.p)) + # This really should not happen. TIMEOUT and EOF failures are exceptions. + raise RuntimeError('An unknown error has occurred. Please examine the logs.') + self.p.expect_exact('(gdb)') def close(self): @@ -114,9 +120,14 @@ def test_examples_loadable_elf(env, extra_data): idf_path = os.environ['IDF_PATH'] rel_project_path = os.path.join('examples', 'get-started', 'hello_world') proj_path = os.path.join(idf_path, rel_project_path) - elf_path = os.path.join(IDF.Example(rel_project_path).get_binary_path(rel_project_path), 'hello-world.elf') + example = IDF.Example(rel_project_path) + sdkconfig = example.get_sdkconfig() + elf_path = os.path.join(example.get_binary_path(rel_project_path), 'hello-world.elf') esp_log_path = os.path.join(proj_path, 'esp.log') + assert(sdkconfig['CONFIG_IDF_TARGET_ESP32'] == 'y'), "Only ESP32 target is supported" + assert(sdkconfig['CONFIG_APP_BUILD_TYPE_ELF_RAM'] == 'y'), "ELF should be built with CONFIG_APP_BUILD_TYPE_ELF_RAM" + with SerialThread(esp_log_path): with OCDProcess(proj_path), GDBProcess(proj_path, elf_path) as gdb: gdb.break_till_end() diff --git a/tools/ci/config/target-test.yml b/tools/ci/config/target-test.yml index dcc2fef36..36b8aa414 100644 --- a/tools/ci/config/target-test.yml +++ b/tools/ci/config/target-test.yml @@ -23,7 +23,6 @@ - assign_test - build_examples_make - build_examples_cmake_esp32 - - build_examples_cmake_esp32s2 artifacts: when: always paths: diff --git a/tools/tiny-test-fw/IDF/IDFApp.py b/tools/tiny-test-fw/IDF/IDFApp.py index 6324071f5..5e0321af1 100644 --- a/tools/tiny-test-fw/IDF/IDFApp.py +++ b/tools/tiny-test-fw/IDF/IDFApp.py @@ -213,6 +213,8 @@ class Example(IDFApp): # search for CI build folders app = os.path.basename(app_path) example_path = os.path.join(self.idf_path, "build_examples", "example_builds") + # example_path has subdirectories named after targets. So we need to look into only the right + # subdirectory. Currently, the target is not known at this moment. for dirpath, dirnames, files in os.walk(example_path): if dirnames: if dirnames[0] == app: