From 3f74b4e8c0da1e4ef8b09ed2349a3e01b9960169 Mon Sep 17 00:00:00 2001 From: Suren Gabrielyan Date: Fri, 1 Dec 2023 15:36:23 +0400 Subject: [PATCH 1/2] feat(modem): host test support of the latest ESP-IDF release --- .github/workflows/modem__build-host-tests.yml | 17 ++++++++++- .github/workflows/run-host-tests.yml | 23 +++++++++++++-- .../workflows/websocket__build-host-tests.yml | 2 ++ .../examples/linux_modem/main/modem_main.cpp | 3 +- .../esp_modem/test/host_test/CMakeLists.txt | 2 +- components/esp_modem/test/host_test/env.sh | 23 ++++++--------- .../test/host_test/main/CMakeLists.txt | 5 ++-- .../test/host_test/main/idf_component.yml | 5 ++++ .../test/host_test/main/test_modem.cpp | 28 +++++++++++++++++-- 9 files changed, 84 insertions(+), 24 deletions(-) create mode 100644 components/esp_modem/test/host_test/main/idf_component.yml diff --git a/.github/workflows/modem__build-host-tests.yml b/.github/workflows/modem__build-host-tests.yml index 21204c6532..8f9c150da0 100644 --- a/.github/workflows/modem__build-host-tests.yml +++ b/.github/workflows/modem__build-host-tests.yml @@ -76,10 +76,25 @@ jobs: if: contains(github.event.pull_request.labels.*.name, 'modem') || github.event_name == 'push' uses: "./.github/workflows/run-host-tests.yml" with: - idf_version: "release-v4.3" + idf_version: "latest" app_name: "host_modem_test" app_path: "esp-protocols/components/esp_modem/test/host_test" component_path: "esp-protocols/components/esp_modem" upload_artifacts: true + run_executable: true + run_coverage: true pre_run_script: "esp-protocols/components/esp_modem/test/host_test/env.sh" publish_unit_test_result: true + + build_linux_example: + if: contains(github.event.pull_request.labels.*.name, 'modem') || github.event_name == 'push' + uses: "./.github/workflows/run-host-tests.yml" + with: + idf_version: "latest" + app_name: "linux_modem" + app_path: "esp-protocols/components/esp_modem/examples/linux_modem" + component_path: "esp-protocols/components/esp_modem" + upload_artifacts: true + run_executable: false + run_coverage: false + pre_run_script: "esp-protocols/components/esp_modem/test/host_test/env.sh" diff --git a/.github/workflows/run-host-tests.yml b/.github/workflows/run-host-tests.yml index 467e076a9f..ffb70f6a21 100644 --- a/.github/workflows/run-host-tests.yml +++ b/.github/workflows/run-host-tests.yml @@ -18,6 +18,12 @@ on: upload_artifacts: type: boolean required: true + run_executable: + type: boolean + required: true + run_coverage: + type: boolean + required: true pre_run_script: type: string required: false @@ -51,7 +57,16 @@ jobs: # The sdkconfig.ci.linux specifies Linux as the build target with apropriate settings. cp sdkconfig.ci.linux sdkconfig.defaults idf.py build - ./build/${{inputs.app_name}}.elf -r junit -o junit.xml + if [ "${{ inputs.run_executable}}" == "false" ]; then + echo "Executeable wasn't run" + exit 0 + fi + + if [ "${{ inputs.publish_unit_test_result }}" == "true" ]; then + ./build/${{inputs.app_name}}.elf --reporter JUnit::out=result-junit.xml --reporter console::out=-::colour-mode=ansi + else + ./build/${{inputs.app_name}}.elf + fi - name: Publish Unit Test Result uses: EnricoMi/publish-unit-test-result-action@v2 if: ${{ inputs.publish_unit_test_result }} @@ -59,6 +74,7 @@ jobs: files: ${{inputs.component_path}}/**/*junit.xml - name: Build with Coverage Enabled shell: bash + if: ${{ inputs.run_coverage }} run: | component=$(basename ${{ inputs.component_path }}) if [ -f "${{ inputs.pre_run_script }}" ]; then @@ -74,6 +90,7 @@ jobs: ./build/${{inputs.app_name}}.elf - name: Run Coverage shell: bash + if: ${{ inputs.run_coverage }} run: | apt-get update && apt-get install -y python3-pip rsync python -m pip install gcovr @@ -86,6 +103,7 @@ jobs: cp index.html ${{inputs.app_name}}_coverage_report cp -rf ${{inputs.app_name}}_coverage_report ${{inputs.app_name}}_coverage.xml $GITHUB_WORKSPACE - name: Code Coverage Summary Report + if: ${{ inputs.run_coverage }} uses: irongut/CodeCoverageSummary@v1.3.0 with: filename: esp-protocols/**/${{inputs.app_name}}_coverage.xml @@ -99,9 +117,10 @@ jobs: thresholds: '60 80' - name: Write to Job Summary run: cat code-coverage-results.md >> $GITHUB_STEP_SUMMARY + if: ${{ inputs.run_coverage }} - name: Upload files to artifacts for run-target job uses: actions/upload-artifact@v3 - if: ${{inputs.upload_artifacts}} + if: ${{ inputs.run_coverage }} with: name: ${{inputs.app_name}}_coverage_report path: | diff --git a/.github/workflows/websocket__build-host-tests.yml b/.github/workflows/websocket__build-host-tests.yml index f60c8ef133..d1c008ad5a 100644 --- a/.github/workflows/websocket__build-host-tests.yml +++ b/.github/workflows/websocket__build-host-tests.yml @@ -17,4 +17,6 @@ jobs: app_name: "websocket" app_path: "esp-protocols/components/esp_websocket_client/examples/linux" component_path: "esp-protocols/components/esp_websocket_client" + run_executable: true upload_artifacts: true + run_coverage: true diff --git a/components/esp_modem/examples/linux_modem/main/modem_main.cpp b/components/esp_modem/examples/linux_modem/main/modem_main.cpp index 174c369260..9e6253e51f 100644 --- a/components/esp_modem/examples/linux_modem/main/modem_main.cpp +++ b/components/esp_modem/examples/linux_modem/main/modem_main.cpp @@ -22,8 +22,7 @@ using namespace esp_modem; [[maybe_unused]] constexpr auto TAG = "linux_modem_main"; - -int main() +extern "C" void app_main(void) { // init the DTE esp_modem_dte_config_t dte_config = { diff --git a/components/esp_modem/test/host_test/CMakeLists.txt b/components/esp_modem/test/host_test/CMakeLists.txt index 8c603a21e5..e508eb92f5 100644 --- a/components/esp_modem/test/host_test/CMakeLists.txt +++ b/components/esp_modem/test/host_test/CMakeLists.txt @@ -6,7 +6,7 @@ set(EXTRA_COMPONENT_DIRS # Add esp_modem component and linux port components ../.. ../../port/linux) -set(COMPONENTS main) +set(COMPONENTS esp_modem main) project(host_modem_test) idf_component_get_property(esp_modem esp_modem COMPONENT_LIB) diff --git a/components/esp_modem/test/host_test/env.sh b/components/esp_modem/test/host_test/env.sh index 116e13be76..5b39af9228 100755 --- a/components/esp_modem/test/host_test/env.sh +++ b/components/esp_modem/test/host_test/env.sh @@ -3,19 +3,14 @@ idf_version=$1 component=$2 -if [[ "$idf_version" == "release-v4.3" ]] && [[ "$component" == "esp_modem" ]]; then - lwip=lwip-2.1.2 - lwip_uri=http://download.savannah.nongnu.org/releases/lwip - lwip_contrib=contrib-2.1.0 +lwip=lwip-2.1.2 +lwip_uri=http://download.savannah.nongnu.org/releases/lwip +lwip_contrib=contrib-2.1.0 - wget --no-verbose ${lwip_uri}/${lwip}.zip - unzip -oq ${lwip}.zip - wget --no-verbose ${lwip_uri}/${lwip_contrib}.zip - unzip -oq ${lwip_contrib}.zip +wget --no-verbose ${lwip_uri}/${lwip}.zip +unzip -oq ${lwip}.zip +wget --no-verbose ${lwip_uri}/${lwip_contrib}.zip +unzip -oq ${lwip_contrib}.zip - apt-get update && apt-get install -y gcc-8 g++-8 - update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 800 --slave /usr/bin/g++ g++ /usr/bin/g++-8 - rm /usr/bin/gcov && ln -s /usr/bin/gcov-8 /usr/bin/gcov - export LWIP_PATH=`pwd`/$lwip - export LWIP_CONTRIB_PATH=`pwd`/$lwip_contrib -fi +export LWIP_PATH=`pwd`/$lwip +export LWIP_CONTRIB_PATH=`pwd`/$lwip_contrib diff --git a/components/esp_modem/test/host_test/main/CMakeLists.txt b/components/esp_modem/test/host_test/main/CMakeLists.txt index 9b6d4ab57f..a1ee4557aa 100644 --- a/components/esp_modem/test/host_test/main/CMakeLists.txt +++ b/components/esp_modem/test/host_test/main/CMakeLists.txt @@ -1,11 +1,12 @@ idf_component_register(SRCS "test_modem.cpp" "LoopbackTerm.cpp" - INCLUDE_DIRS "$ENV{IDF_PATH}/tools/catch" - REQUIRES esp_modem) + REQUIRES esp_modem WHOLE_ARCHIVE) set(THREADS_PREFER_PTHREAD_FLAG ON) find_package(Threads REQUIRED) target_link_libraries(${COMPONENT_LIB} PRIVATE Threads::Threads) +target_link_libraries(${COMPONENT_LIB} PRIVATE Catch2WithMain) + set_target_properties(${COMPONENT_LIB} PROPERTIES CXX_STANDARD 17 CXX_STANDARD_REQUIRED ON diff --git a/components/esp_modem/test/host_test/main/idf_component.yml b/components/esp_modem/test/host_test/main/idf_component.yml new file mode 100644 index 0000000000..218c0392d7 --- /dev/null +++ b/components/esp_modem/test/host_test/main/idf_component.yml @@ -0,0 +1,5 @@ +dependencies: + espressif/catch2: + version: '*' + idf: + version: ">=5.0" diff --git a/components/esp_modem/test/host_test/main/test_modem.cpp b/components/esp_modem/test/host_test/main/test_modem.cpp index d754839e68..d5d3764101 100644 --- a/components/esp_modem/test/host_test/main/test_modem.cpp +++ b/components/esp_modem/test/host_test/main/test_modem.cpp @@ -1,14 +1,16 @@ /* - * SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2022-2024 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Unlicense OR CC0-1.0 */ #define CATCH_CONFIG_MAIN // This tells the catch header to generate a main #include #include -#include "catch.hpp" +#include +#include #include "cxx_include/esp_modem_api.hpp" #include "LoopbackTerm.h" +#include using namespace esp_modem; @@ -346,3 +348,25 @@ TEST_CASE("CMUX manual mode transitions", "[esp_modem][transitions]") CHECK(dce->set_mode(esp_modem::modem_mode::UNDEF) == true); // Succeeds from any state } + +#define CATCH_CONFIG_RUNNER +extern "C" int app_main(void) +{ + // Define the argument count and arguments for Catch2, including JUnit reporting + int argc = 5; + const char *argv[] = {"esp_modem", "-r", "junit", "-o", "junit.xml", nullptr}; + + // Run the Catch2 session and store the result + int result = Catch::Session().run(argc, argv); + + // Use more descriptive error handling + if (result != 0) { + printf("Test failed with result %d. Refer to the Catch2 documentation for error details.\n", result); + } else { + printf("All tests passed successfully.\n"); + } + + // Check for the junit.xml file in the current working directory + // Exit the application with the test result as the status code + std::exit(result); +} From a23a0027fa35f52348f1b983609ddf070dea547e Mon Sep 17 00:00:00 2001 From: Suren Gabrielyan Date: Mon, 29 Jan 2024 19:34:42 +0400 Subject: [PATCH 2/2] ci(common): updated github actions(checkout, upload, download) v3 to 4, Ubuntu 20.04 to v22.04 --- .github/workflows/asio__build-target-test.yml | 12 ++++++------ .github/workflows/console_cmd_ifconfig__build.yml | 4 ++-- .github/workflows/console_cmd_ping__build.yml | 4 ++-- .github/workflows/console_cmd_wifi__build.yml | 4 ++-- .github/workflows/console_simple_init__build.yml | 4 ++-- .github/workflows/examples_build-host-test.yml | 8 ++++---- .github/workflows/mdns__build-target-test.yml | 12 ++++++------ .github/workflows/mdns__host-tests.yml | 8 ++++---- .github/workflows/modem__build-host-tests.yml | 14 ++++++++++---- .github/workflows/modem__target-test.yml | 4 ++-- .github/workflows/mqtt_cxx__build.yml | 4 ++-- .github/workflows/pre_commit_check.yml | 2 +- .github/workflows/publish-docs-component.yml | 2 +- .github/workflows/run-host-tests.yml | 13 ++++--------- .github/workflows/websocket__build-target-test.yml | 12 ++++++------ components/esp_modem/test/host_test/CMakeLists.txt | 2 +- .../esp_modem/test/host_test/main/test_modem.cpp | 2 +- 17 files changed, 56 insertions(+), 55 deletions(-) diff --git a/.github/workflows/asio__build-target-test.yml b/.github/workflows/asio__build-target-test.yml index 55c60cc503..fd1c7fdd4f 100644 --- a/.github/workflows/asio__build-target-test.yml +++ b/.github/workflows/asio__build-target-test.yml @@ -16,13 +16,13 @@ jobs: idf_ver: ["latest", "release-v5.0", "release-v5.1"] idf_target: ["esp32", "esp32s2"] example: ["asio_chat", "async_request", "socks4", "ssl_client_server", "tcp_echo_server", "udp_echo_server"] - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 container: espressif/idf:${{ matrix.idf_ver }} env: TEST_DIR: components/asio/examples steps: - name: Checkout esp-protocols - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: recursive - name: Build ${{ matrix.example }} with IDF-${{ matrix.idf_ver }} for ${{ matrix.idf_target }} @@ -43,7 +43,7 @@ jobs: run: | . ${IDF_PATH}/export.sh esptool.py --chip ${{ matrix.idf_target }} merge_bin --fill-flash-size 4MB -o flash_image.bin @flash_args - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: name: examples_app_bin_${{ matrix.idf_target }}_${{ matrix.idf_ver }}_${{ matrix.example }} path: | @@ -76,8 +76,8 @@ jobs: steps: - name: Clear repository run: sudo rm -fr $GITHUB_WORKSPACE && mkdir $GITHUB_WORKSPACE - - uses: actions/checkout@v3 - - uses: actions/download-artifact@v3 + - uses: actions/checkout@v4 + - uses: actions/download-artifact@v4 with: name: examples_app_bin_${{ matrix.idf_target }}_${{ matrix.idf_ver }}_${{ matrix.example }} path: ${{ env.TEST_DIR }}/${{ matrix.example }}/build @@ -93,7 +93,7 @@ jobs: working-directory: ${{ env.TEST_DIR }}/${{ matrix.example }} run: | python -m pytest --log-cli-level DEBUG --junit-xml=./examples_results_${{ matrix.idf_target }}_${{ matrix.idf_ver }}_${{ matrix.config }}.xml --target=${{ matrix.idf_target }} - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 if: always() with: name: examples_results_${{ matrix.idf_target }}_${{ matrix.idf_ver }}_${{ matrix.example }} diff --git a/.github/workflows/console_cmd_ifconfig__build.yml b/.github/workflows/console_cmd_ifconfig__build.yml index c5d21626a2..cc0d418897 100644 --- a/.github/workflows/console_cmd_ifconfig__build.yml +++ b/.github/workflows/console_cmd_ifconfig__build.yml @@ -16,11 +16,11 @@ jobs: idf_ver: ["latest", "release-v5.0"] idf_target: ["esp32"] test: [ { app: ifconfig-basic, path: "components/console_cmd_ifconfig/examples"}] - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 container: espressif/idf:${{ matrix.idf_ver }} steps: - name: Checkout esp-protocols - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: recursive - name: Build ${{ matrix.test.app }} with IDF-${{ matrix.idf_ver }} for ${{ matrix.idf_target }} diff --git a/.github/workflows/console_cmd_ping__build.yml b/.github/workflows/console_cmd_ping__build.yml index 37f9f120a4..f8bc7d8e25 100644 --- a/.github/workflows/console_cmd_ping__build.yml +++ b/.github/workflows/console_cmd_ping__build.yml @@ -16,11 +16,11 @@ jobs: idf_ver: ["latest", "release-v5.0"] idf_target: ["esp32"] test: [ { app: ping-basic, path: "components/console_cmd_ping/examples" }] - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 container: espressif/idf:${{ matrix.idf_ver }} steps: - name: Checkout esp-protocols - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: recursive - name: Build ${{ matrix.test.app }} with IDF-${{ matrix.idf_ver }} for ${{ matrix.idf_target }} diff --git a/.github/workflows/console_cmd_wifi__build.yml b/.github/workflows/console_cmd_wifi__build.yml index 8031184332..07ab0c6af2 100644 --- a/.github/workflows/console_cmd_wifi__build.yml +++ b/.github/workflows/console_cmd_wifi__build.yml @@ -16,11 +16,11 @@ jobs: idf_ver: ["latest", "release-v5.0"] idf_target: ["esp32"] test: [ { app: wifi-basic, path: "components/console_cmd_wifi/examples" }] - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 container: espressif/idf:${{ matrix.idf_ver }} steps: - name: Checkout esp-protocols - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: recursive - name: Build ${{ matrix.test.app }} with IDF-${{ matrix.idf_ver }} for ${{ matrix.idf_target }} diff --git a/.github/workflows/console_simple_init__build.yml b/.github/workflows/console_simple_init__build.yml index 53cfc45b7e..9d5d2d500b 100644 --- a/.github/workflows/console_simple_init__build.yml +++ b/.github/workflows/console_simple_init__build.yml @@ -16,11 +16,11 @@ jobs: idf_ver: ["latest", "release-v5.0"] idf_target: ["esp32"] test: [ { app: console_basic, path: "components/console_simple_init/examples" }] - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 container: espressif/idf:${{ matrix.idf_ver }} steps: - name: Checkout esp-protocols - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: recursive - name: Build ${{ matrix.test.app }} with IDF-${{ matrix.idf_ver }} for ${{ matrix.idf_target }} diff --git a/.github/workflows/examples_build-host-test.yml b/.github/workflows/examples_build-host-test.yml index 15d30c7ccd..1d099a4074 100644 --- a/.github/workflows/examples_build-host-test.yml +++ b/.github/workflows/examples_build-host-test.yml @@ -14,11 +14,11 @@ jobs: strategy: matrix: idf_ver: ["latest", "release-v5.1"] - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 container: espressif/idf:${{ matrix.idf_ver }} steps: - name: Checkout esp-protocols - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Build with IDF-${{ matrix.idf_ver }} shell: bash run: | @@ -33,11 +33,11 @@ jobs: strategy: matrix: idf_ver: ["latest"] - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 container: espressif/idf:${{ matrix.idf_ver }} steps: - name: Checkout esp-protocols - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Build with IDF-${{ matrix.idf_ver }} shell: bash run: | diff --git a/.github/workflows/mdns__build-target-test.yml b/.github/workflows/mdns__build-target-test.yml index eca051d697..5caa610709 100644 --- a/.github/workflows/mdns__build-target-test.yml +++ b/.github/workflows/mdns__build-target-test.yml @@ -15,11 +15,11 @@ jobs: matrix: idf_ver: ["latest", "release-v5.0"] test: [ { app: example, path: "examples/query_advertise" }, { app: unit_test, path: "tests/unit_test" }, { app: test_app, path: "tests/test_apps" } ] - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 container: espressif/idf:${{ matrix.idf_ver }} steps: - name: Checkout esp-protocols - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Build ${{ matrix.test.app }} with IDF-${{ matrix.idf_ver }} shell: bash run: | @@ -34,7 +34,7 @@ jobs: $GITHUB_WORKSPACE/ci/clean_build_artifacts.sh `pwd`/$dir zip -qur artifacts.zip $dir done - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: name: mdns_bin_esp32_${{ matrix.idf_ver }}_${{ matrix.test.app }} path: components/mdns/${{ matrix.test.path }}/artifacts.zip @@ -58,8 +58,8 @@ jobs: steps: - name: Clear repository run: sudo rm -fr $GITHUB_WORKSPACE && mkdir $GITHUB_WORKSPACE - - uses: actions/checkout@v3 - - uses: actions/download-artifact@v3 + - uses: actions/checkout@v4 + - uses: actions/download-artifact@v4 with: name: mdns_bin_${{ matrix.idf_target }}_${{ matrix.idf_ver }}_${{ matrix.test.app }} path: components/mdns/${{ matrix.test.path }}/ci/ @@ -77,7 +77,7 @@ jobs: mv $dir build python -m pytest --log-cli-level DEBUG --junit-xml=./results_${{ matrix.test.app }}_${{ matrix.idf_target }}_${{ matrix.idf_ver }}_${dir#"ci/build_"}.xml --target=${{ matrix.idf_target }} done - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 if: always() with: name: results_${{ matrix.test.app }}_${{ matrix.idf_target }}_${{ matrix.idf_ver }}.xml diff --git a/.github/workflows/mdns__host-tests.yml b/.github/workflows/mdns__host-tests.yml index 3fa7cd35ad..81bb3ef688 100644 --- a/.github/workflows/mdns__host-tests.yml +++ b/.github/workflows/mdns__host-tests.yml @@ -11,12 +11,12 @@ jobs: host_test_mdns: if: contains(github.event.pull_request.labels.*.name, 'mdns') || github.event_name == 'push' name: Host test - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 container: espressif/idf:release-v5.1 steps: - name: Checkout esp-protocols - uses: actions/checkout@master + uses: actions/checkout@v4 with: path: esp-protocols @@ -40,11 +40,11 @@ jobs: idf_ver: ["latest"] idf_target: ["esp32"] - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 container: espressif/idf:${{ matrix.idf_ver }} steps: - name: Checkout esp-protocols - uses: actions/checkout@master + uses: actions/checkout@v4 with: path: esp-protocols - name: Install Necessary Libs diff --git a/.github/workflows/modem__build-host-tests.yml b/.github/workflows/modem__build-host-tests.yml index 8f9c150da0..59261008d3 100644 --- a/.github/workflows/modem__build-host-tests.yml +++ b/.github/workflows/modem__build-host-tests.yml @@ -27,13 +27,19 @@ jobs: example: "simple_cmux_client" warning: "Warning: The smallest app partition is nearly full" - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 container: espressif/idf:${{ matrix.idf_ver }} steps: - - name: Checkout esp-protocols + - name: Check out code (v3) # @v4 failed due to Node 20's requirement, incompatible with older IDF versions + if: matrix.idf_ver != 'latest' && matrix.idf_ver < 'release-v5.0' uses: actions/checkout@v3 with: path: protocols + - name: Check out code (v4) + if: matrix.idf_ver == 'latest' || matrix.idf_ver >= 'release-v5.0' + uses: actions/checkout@v4 + with: + path: protocols - if: ${{ matrix.skip_config }} run: rm -f $GITHUB_WORKSPACE/protocols/components/esp_modem/examples/${{ matrix.example }}/sdkconfig.ci.${{ matrix.skip_config }}* - name: Build ${{ matrix.example }} with IDF-${{ matrix.idf_ver }} @@ -54,11 +60,11 @@ jobs: idf_ver: ["release-v5.0", "release-v5.1", "latest"] test: ["target", "target_ota", "target_iperf"] - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 container: espressif/idf:${{ matrix.idf_ver }} steps: - name: Checkout esp-protocols - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: path: protocols - name: Build ${{ matrix.test }} with IDF-${{ matrix.idf_ver }} diff --git a/.github/workflows/modem__target-test.yml b/.github/workflows/modem__target-test.yml index f7f5cf7811..5d55b3e7f4 100644 --- a/.github/workflows/modem__target-test.yml +++ b/.github/workflows/modem__target-test.yml @@ -20,13 +20,13 @@ jobs: - idf_ver: "latest" idf_target: "esp32s2" test: { app: usb_a7670_s2, path: examples/pppos_client } - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 container: espressif/idf:${{ matrix.idf_ver }} env: TEST_DIR: components/esp_modem/${{ matrix.test.path }} steps: - name: Checkout esp-protocols - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: recursive - name: Build esp-modem target tests with IDF-${{ matrix.idf_ver }} for ${{ matrix.idf_target }} diff --git a/.github/workflows/mqtt_cxx__build.yml b/.github/workflows/mqtt_cxx__build.yml index 20cfcf7f5d..770629cf90 100644 --- a/.github/workflows/mqtt_cxx__build.yml +++ b/.github/workflows/mqtt_cxx__build.yml @@ -16,11 +16,11 @@ jobs: idf_ver: ["latest", "release-v5.0"] idf_target: ["esp32"] test: [ { app: mqtt-basic, path: "components/esp_mqtt_cxx/examples" }] - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 container: espressif/idf:${{ matrix.idf_ver }} steps: - name: Checkout esp-protocols - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: recursive - name: Build ${{ matrix.test.app }} with IDF-${{ matrix.idf_ver }} for ${{ matrix.idf_target }} diff --git a/.github/workflows/pre_commit_check.yml b/.github/workflows/pre_commit_check.yml index 7638c498f7..56d0ff772b 100644 --- a/.github/workflows/pre_commit_check.yml +++ b/.github/workflows/pre_commit_check.yml @@ -12,7 +12,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: ref: ${{ github.base_ref }} fetch-depth: 20 diff --git a/.github/workflows/publish-docs-component.yml b/.github/workflows/publish-docs-component.yml index 46d1871f2b..0b7d39ba32 100644 --- a/.github/workflows/publish-docs-component.yml +++ b/.github/workflows/publish-docs-component.yml @@ -20,7 +20,7 @@ jobs: if: github.repository == 'espressif/esp-protocols' steps: - name: Checkout esp-protocols - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: persist-credentials: false fetch-depth: 0 diff --git a/.github/workflows/run-host-tests.yml b/.github/workflows/run-host-tests.yml index ffb70f6a21..8558f963c8 100644 --- a/.github/workflows/run-host-tests.yml +++ b/.github/workflows/run-host-tests.yml @@ -34,14 +34,14 @@ on: jobs: build: name: Build App - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 permissions: checks: write contents: write container: espressif/idf:${{inputs.idf_version}} steps: - name: Checkout esp-protocols - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: path: esp-protocols - name: Build ${{ inputs.app_name }} with IDF-${{ inputs.idf_version }} @@ -61,12 +61,7 @@ jobs: echo "Executeable wasn't run" exit 0 fi - - if [ "${{ inputs.publish_unit_test_result }}" == "true" ]; then - ./build/${{inputs.app_name}}.elf --reporter JUnit::out=result-junit.xml --reporter console::out=-::colour-mode=ansi - else - ./build/${{inputs.app_name}}.elf - fi + ./build/${{inputs.app_name}}.elf - name: Publish Unit Test Result uses: EnricoMi/publish-unit-test-result-action@v2 if: ${{ inputs.publish_unit_test_result }} @@ -119,7 +114,7 @@ jobs: run: cat code-coverage-results.md >> $GITHUB_STEP_SUMMARY if: ${{ inputs.run_coverage }} - name: Upload files to artifacts for run-target job - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 if: ${{ inputs.run_coverage }} with: name: ${{inputs.app_name}}_coverage_report diff --git a/.github/workflows/websocket__build-target-test.yml b/.github/workflows/websocket__build-target-test.yml index d8ca9b4dd6..de55c40c65 100644 --- a/.github/workflows/websocket__build-target-test.yml +++ b/.github/workflows/websocket__build-target-test.yml @@ -15,13 +15,13 @@ jobs: matrix: idf_ver: ["release-v5.0", "release-v5.1", "latest"] test: [ { app: example, path: "examples/target" }, { app: unit_test, path: "test" } ] - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 container: espressif/idf:${{ matrix.idf_ver }} env: TEST_DIR: components/esp_websocket_client/${{ matrix.test.path }} steps: - name: Checkout esp-protocols - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: recursive - name: Build ${{ matrix.example }} with IDF-${{ matrix.idf_ver }} for ${{ matrix.idf_target }} @@ -35,7 +35,7 @@ jobs: $GITHUB_WORKSPACE/ci/clean_build_artifacts.sh `pwd`/$dir zip -qur artifacts.zip $dir done - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: name: websocket_bin_esp32_${{ matrix.idf_ver }}_${{ matrix.test.app }} path: ${{ env.TEST_DIR }}/artifacts.zip @@ -60,8 +60,8 @@ jobs: env: TEST_DIR: components/esp_websocket_client/${{ matrix.test.path }} steps: - - uses: actions/checkout@v3 - - uses: actions/download-artifact@v3 + - uses: actions/checkout@v4 + - uses: actions/download-artifact@v4 with: name: websocket_bin_esp32_${{ matrix.idf_ver }}_${{ matrix.test.app }} path: ${{ env.TEST_DIR }}/ci/ @@ -79,7 +79,7 @@ jobs: mv $dir build python -m pytest --log-cli-level DEBUG --junit-xml=./results_${{ matrix.test.app }}_${{ matrix.idf_target }}_${{ matrix.idf_ver }}_${dir#"ci/build_"}.xml --target=${{ matrix.idf_target }} done - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 if: always() with: name: results_${{ matrix.test.app }}_${{ matrix.idf_target }}_${{ matrix.idf_ver }}.xml diff --git a/components/esp_modem/test/host_test/CMakeLists.txt b/components/esp_modem/test/host_test/CMakeLists.txt index e508eb92f5..8c603a21e5 100644 --- a/components/esp_modem/test/host_test/CMakeLists.txt +++ b/components/esp_modem/test/host_test/CMakeLists.txt @@ -6,7 +6,7 @@ set(EXTRA_COMPONENT_DIRS # Add esp_modem component and linux port components ../.. ../../port/linux) -set(COMPONENTS esp_modem main) +set(COMPONENTS main) project(host_modem_test) idf_component_get_property(esp_modem esp_modem COMPONENT_LIB) diff --git a/components/esp_modem/test/host_test/main/test_modem.cpp b/components/esp_modem/test/host_test/main/test_modem.cpp index d5d3764101..7f15e94dc8 100644 --- a/components/esp_modem/test/host_test/main/test_modem.cpp +++ b/components/esp_modem/test/host_test/main/test_modem.cpp @@ -361,7 +361,7 @@ extern "C" int app_main(void) // Use more descriptive error handling if (result != 0) { - printf("Test failed with result %d. Refer to the Catch2 documentation for error details.\n", result); + printf("Test failed with result %d.\n", result); } else { printf("All tests passed successfully.\n"); }