From 9d16395ec7c6e5f2b58f3c7f04acf20f1b2c64b9 Mon Sep 17 00:00:00 2001 From: Krzysztof Taborowski Date: Mon, 9 Dec 2024 10:12:38 +0100 Subject: [PATCH 1/6] doc: document the way of testing [KRKNWK-14886] Signed-off-by: Krzysztof Taborowski --- doc/additional_resources.rst | 7 ++ doc/testing.rst | 130 +++++++++++++++++++++++++++++++++++ 2 files changed, 137 insertions(+) create mode 100644 doc/testing.rst diff --git a/doc/additional_resources.rst b/doc/additional_resources.rst index a011cb3320..81ae1edcd7 100644 --- a/doc/additional_resources.rst +++ b/doc/additional_resources.rst @@ -19,6 +19,13 @@ For additional Amazon resources, refer to the following list: * `Sidewalk terms of use`_ * `Sidewalk qualification`_ +Additional Nordic resources for developers: + +.. toctree:: + :maxdepth: 1 + :glob: + + testing.rst .. _Introduction to Sidewalk: https://docs.sidewalk.amazon/introduction/ .. _Getting Started Guide: https://docs.aws.amazon.com/iot/latest/developerguide/sidewalk-getting-started.html diff --git a/doc/testing.rst b/doc/testing.rst new file mode 100644 index 0000000000..5233783de6 --- /dev/null +++ b/doc/testing.rst @@ -0,0 +1,130 @@ +.. _sidewalk_testing: + +Sidewalk Testing +################ + +Levels of Testing +================= + +Testing levels are essential for a structured approach to quality assurance, allowing for targeted testing at each stage of development to reduce defects and ensure software reliability. + +The most commonly recognized levels of testing in software development include: + +* **Unit Testing**: Focuses on individual functions to ensure they work correctly in isolation. +* **Integration Testing**: Tests the interaction between integrated components to identify issues arising from their interactions. +* **System Testing**: Validates the complete and integrated software system against specified requirements. +* **Acceptance Testing**: Confirms that the software meets the business needs and is ready for deployment, often involving end-user validation. + +.. note:: + + There is sometimes a confusion between *integration* tests and *functional* tests as they both require multiple components to interact with each other. + For the purposes of this document, *integration* term is used to describe tests that verify components, but not necessarily the system as a whole. + +For System Testing and Acceptance Testing, you can use Sidewalk sample variants, such as: + +* CLI - application to test against the Sidewalk Test Specification. +* Sensor monitoring - example of a sensor device use case, with release configuration support. + +In this document we focus on Unit and Integration testing, as they are delivered as part of the sdk-sidewalk repository. + +Table below provides a comparison of Unit and Integration testing in the Sidewalk SDK: + ++----------------+---------------------+--------------------------+ +| | Unit | Integration | ++================+=====================+==========================+ +| Scope | One source file | One module | ++----------------+---------------------+--------------------------+ +| Platform | * unit_testing (PC) | * native_sim (PC) | +| | | * nRF development boards | ++----------------+---------------------+--------------------------+ +| Frameworks | * Ztest | * Ztest | +| | * Twister | * Twister | +| | * FFF | | ++----------------+---------------------+--------------------------+ +| Allows mocking | Yes | No | ++----------------+---------------------+--------------------------+ + + +Unit Testing +============ + +Unit tests are designed to test individual functions or methods in isolation to ensure they work as expected. + +To run unit test: + +#. Go to the unit test folder: + + .. code-block:: bash + + cd sidewalk/tests/unit/ + +#. Build the test application by running the following command: + + .. code-block:: bash + + west build --no-sysbuild -b unit_testing + +#. Run the test application by running the following command: + + .. code-block:: bash + + ./build/testbinary + +Integration Testing +=================== + +Integration tests are designed to verify that multiple components work together as expected. + +There are two main purposes of integration tests: + +* Verify that multiple files and functions work together as one module, e.g. crypto, timer, storage. Those tests typically operates on Sidewalk Platform Abstraction Layer (PAL) API. Usually there is a dedicated Kconfig option to enable/disable the module. +* Verify that module works correctly on specify Nordic SoC. This type of tests was sometimes called "unit test on hardware". + +To run integration test: + +.. tabs:: + + .. tab:: native_sim (PC) + + #. Go to the integration test folder: + + .. code-block:: bash + + cd sidewalk/tests/integration/ + + #. Build the test application by running the following command: + + .. code-block:: bash + + west build -b native_sim + + #. Run the test application by running the following command: + + .. code-block:: bash + + ./build//zephyr/zephyr.exe + + .. tab:: nRF (development boards) + + #. Go to the integration test folder: + + .. code-block:: bash + + cd sidewalk/tests/integration/ + + #. Build the test application by running the following command: + + .. code-block:: bash + + west build -b + + Use your board name e.g. ``nRF52840dk/nrf52840``, ``nRF55l15dk/nrf54l15/cpuapp``. + + #. Flash the test application running the following command: + + .. code-block:: bash + + west flash + + Make sure your board is connected to the computer. + Test output will be displayed on the UART console. From dc4a4863369c58739e60e9eef889c22c49d58b2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Ga=C5=82at?= Date: Tue, 10 Dec 2024 15:47:11 +0000 Subject: [PATCH 2/6] GHA: add test_config and update GHA MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit prepare gitHub automation for unit test refactoring Signed-off-by: Robert Gałat --- .github/workflows/compare_config.yml | 2 +- .github/workflows/on-commit.yml | 32 ++++++- .github/workflows/on-pr.yml | 30 +++++- .github/workflows/on-pr_dnm.yml | 2 +- .github/workflows/on-pr_labeler.yml | 2 +- .../on-pr_nrf_manifest_update_PR.yml | 4 +- .github/workflows/on-pr_publish_comment.yml | 2 +- .github/workflows/on-push-tag.yml | 2 +- .github/workflows/on_docker_change.yml | 2 +- .github/workflows/publish_documentation.yml | 2 +- .github/workflows/run_tests.yml | 91 ++----------------- .github/workflows/run_tests_dut.yml | 16 +++- .github/workflows/samples_build.yml | 41 +++++++-- .github/workflows/validate_code_style.yml | 4 +- samples/sid_end_device/sample.yaml | 18 ++-- test_config.yaml | 36 ++++++++ .../functional/critical_region/testcase.yaml | 2 +- tests/functional/crypto/testcase.yaml | 2 +- tests/functional/crypto_keys/testcase.yaml | 2 +- tests/functional/interrupts/testcase.yaml | 2 +- tests/functional/mfg_storage/testcase.yaml | 4 +- tests/functional/pal_delay/testcase.yaml | 2 +- tests/functional/spi_bus/testcase.yaml | 2 +- tests/functional/storage/testcase.yaml | 2 +- tests/functional/temperature/testcase.yaml | 2 +- tests/functional/time/testcase.yaml | 2 +- tests/manual/simple_bootloader/sample.yaml | 2 +- .../boards/nrf54l15dk_nrf54l10_cpuapp.overlay | 14 +++ tests/unit_tests/mfg_parsers/testcase.yaml | 4 +- tests/unit_tests/pal_assert/testcase.yaml | 2 +- .../unit_tests/pal_ble_adapter/testcase.yaml | 2 +- tests/unit_tests/pal_crypto/testcase.yaml | 2 +- tests/unit_tests/pal_log/testcase.yaml | 2 +- .../unit_tests/pal_mfg_storage/testcase.yaml | 2 +- tests/unit_tests/pal_storage_kv/testcase.yaml | 4 +- .../pal_sw_interrupts/testcase.yaml | 2 +- .../unit_tests/pal_temperature/testcase.yaml | 2 +- tests/unit_tests/pal_timer/testcase.yaml | 2 +- tests/unit_tests/pal_uptime/testcase.yaml | 2 +- tests/unit_tests/scratch_buffer/testcase.yaml | 2 +- tests/unit_tests/sid_ace_alloc/testcase.yaml | 2 +- .../sid_ble_adapter_callbacks/testcase.yaml | 2 +- tests/unit_tests/sid_ble_advert/testcase.yaml | 2 +- .../sid_ble_connection/testcase.yaml | 2 +- .../unit_tests/sid_ble_service/testcase.yaml | 2 +- tests/unit_tests/sid_dut_shell/testcase.yaml | 2 +- tests/unit_tests/sid_pal_gpio/testcase.yaml | 2 +- tests/unit_tests/state_notifier/testcase.yaml | 2 +- tests/unit_tests/tlv/testcase.yaml | 2 +- tests/validation/crypto/testcase.yaml | 2 +- tests/validation/storage_kv/testcase.yaml | 2 +- tests/validation/timer/testcase.yaml | 2 +- 52 files changed, 212 insertions(+), 164 deletions(-) create mode 100644 test_config.yaml create mode 100644 tests/unit_tests/mfg_parsers/boards/nrf54l15dk_nrf54l10_cpuapp.overlay diff --git a/.github/workflows/compare_config.yml b/.github/workflows/compare_config.yml index bafd7d0ddb..41c1f5ad50 100644 --- a/.github/workflows/compare_config.yml +++ b/.github/workflows/compare_config.yml @@ -22,7 +22,7 @@ jobs: diff_detected: ${{steps.config_diff.outputs.diff}} artifact_url: ${{steps.save_diff.outputs.artifact-url}} - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - name: Get artifacts from current diff --git a/.github/workflows/on-commit.yml b/.github/workflows/on-commit.yml index 5a93bc6153..8f2ecb0082 100644 --- a/.github/workflows/on-commit.yml +++ b/.github/workflows/on-commit.yml @@ -11,7 +11,7 @@ on: jobs: get_base_commit: - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 outputs: commit_number: ${{ steps.get_commits.outputs.commit_number }} steps: @@ -33,16 +33,42 @@ jobs: with: reference_commit: "HEAD~${{needs.get_base_commit.outputs.commit_number}}" + discover_target_boards: + runs-on: ubuntu-24.04 + outputs: + targets: ${{ steps.platforms.outputs.targets }} + steps: + - name: install yq + run: pip install yq + + - name: Checkout + uses: actions/checkout@v4 + with: + path: sidewalk + + - name: get_platforms + id: platforms + run: | + result=$(yq '.common.platform_allow' sidewalk/samples/sid_end_device/sample.yaml -c) + echo "targets=$result" >> $GITHUB_OUTPUT; + echo "$result" + build_samples: + needs: [discover_target_boards] uses: ./.github/workflows/samples_build.yml + with: + boards_to_test: ${{needs.discover_target_boards.outputs.targets}} build_and_run_tests: + needs: [discover_target_boards] uses: ./.github/workflows/run_tests.yml + with: + boards_to_test: ${{needs.discover_target_boards.outputs.targets}} Post_fail_to_Teams: needs: [verify_changes, build_samples, build_and_run_tests] if: ${{ failure() }} - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - uses: neonidian/teams-notify-build-status@v4 with: @@ -62,7 +88,7 @@ jobs: post_configuration_diff: needs: [compare_configuration] - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 if: ${{ fromJson(needs.compare_configuration.outputs.diff_detected)}} steps: - uses: actions/download-artifact@v4 diff --git a/.github/workflows/on-pr.yml b/.github/workflows/on-pr.yml index a5b8bb69f4..7b8c9bcf6d 100644 --- a/.github/workflows/on-pr.yml +++ b/.github/workflows/on-pr.yml @@ -4,7 +4,7 @@ on: jobs: Run_Configuration: - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 outputs: NRF_revision: ${{ steps.config.outputs.NRF_revision }} steps: @@ -47,7 +47,7 @@ jobs: reference_commit: ${{ github.event.pull_request.base.sha }} save_pr_number: - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - name: Save PR number to file run: | @@ -60,14 +60,36 @@ jobs: path: | PR_number + discover_target_boards: + runs-on: ubuntu-24.04 + outputs: + targets: ${{ steps.platforms.outputs.targets }} + steps: + - name: install yq + run: pip install yq + + - name: Checkout + uses: actions/checkout@v4 + with: + path: sidewalk + + - name: get_platforms + id: platforms + run: | + result=$(yq '.common.platform_allow' sidewalk/samples/sid_end_device/sample.yaml -c) + echo "targets=$result" >> $GITHUB_OUTPUT; + echo "$result" + build_samples: - needs: Run_Configuration + needs: [Run_Configuration, discover_target_boards] uses: ./.github/workflows/samples_build.yml with: nrf_revision: ${{needs.Run_Configuration.outputs.NRF_revision}} + boards_to_test: ${{needs.discover_target_boards.outputs.targets}} build_and_run_tests: - needs: Run_Configuration + needs: [Run_Configuration, discover_target_boards] uses: ./.github/workflows/run_tests.yml with: nrf_revision: ${{needs.Run_Configuration.outputs.NRF_revision}} + boards_to_test: ${{needs.discover_target_boards.outputs.targets}} diff --git a/.github/workflows/on-pr_dnm.yml b/.github/workflows/on-pr_dnm.yml index 5c83dce6ec..ee148b5cc2 100644 --- a/.github/workflows/on-pr_dnm.yml +++ b/.github/workflows/on-pr_dnm.yml @@ -8,7 +8,7 @@ jobs: do_not_merge: if: ${{ contains(github.event.*.labels.*.name, 'DNM') }} name: Prevent Merging - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - name: Check for label run: | diff --git a/.github/workflows/on-pr_labeler.yml b/.github/workflows/on-pr_labeler.yml index 8dfc49f337..1b8284c051 100644 --- a/.github/workflows/on-pr_labeler.yml +++ b/.github/workflows/on-pr_labeler.yml @@ -4,7 +4,7 @@ on: jobs: triage: - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - uses: actions/labeler@v5 with: diff --git a/.github/workflows/on-pr_nrf_manifest_update_PR.yml b/.github/workflows/on-pr_nrf_manifest_update_PR.yml index fa7f08f99c..43ea244a9a 100644 --- a/.github/workflows/on-pr_nrf_manifest_update_PR.yml +++ b/.github/workflows/on-pr_nrf_manifest_update_PR.yml @@ -7,7 +7,7 @@ on: jobs: read_pr_configuration: - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 outputs: Create_NRF_PR: ${{ steps.config.outputs.Create_NRF_PR }} steps: @@ -46,7 +46,7 @@ jobs: fi; create-manifest-pr: - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 needs: read_pr_configuration if: ${{ fromJson(needs.read_pr_configuration.outputs.Create_NRF_PR)}} steps: diff --git a/.github/workflows/on-pr_publish_comment.yml b/.github/workflows/on-pr_publish_comment.yml index b45075f560..65e9c71cd2 100644 --- a/.github/workflows/on-pr_publish_comment.yml +++ b/.github/workflows/on-pr_publish_comment.yml @@ -15,7 +15,7 @@ jobs: create_PR_comment: needs: [compare_configuration] - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 permissions: issues: write pull-requests: write diff --git a/.github/workflows/on-push-tag.yml b/.github/workflows/on-push-tag.yml index 53ef06780a..91eb7b00d4 100644 --- a/.github/workflows/on-push-tag.yml +++ b/.github/workflows/on-push-tag.yml @@ -20,7 +20,7 @@ jobs: needs: [build_documentation, build_samples] permissions: write-all name: Create release page - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - name: Download artifact diff --git a/.github/workflows/on_docker_change.yml b/.github/workflows/on_docker_change.yml index b8a12ae388..64ab936bec 100644 --- a/.github/workflows/on_docker_change.yml +++ b/.github/workflows/on_docker_change.yml @@ -21,7 +21,7 @@ env: jobs: build-and-push-image: - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 permissions: contents: read packages: write diff --git a/.github/workflows/publish_documentation.yml b/.github/workflows/publish_documentation.yml index 8b0886d048..d145474ead 100644 --- a/.github/workflows/publish_documentation.yml +++ b/.github/workflows/publish_documentation.yml @@ -33,7 +33,7 @@ jobs: env: ARCHIVE: "sidewalk_${{inputs.documentation_tag}}.zip" - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 container: image: ghcr.io/nrfconnect/sdk-sidewalk:main options: --cpus 2 diff --git a/.github/workflows/run_tests.yml b/.github/workflows/run_tests.yml index 4500129184..9c5e7aa78f 100644 --- a/.github/workflows/run_tests.yml +++ b/.github/workflows/run_tests.yml @@ -8,90 +8,12 @@ on: default: "main" boards_to_test: type: string - required: false - default: '["nrf52840dk/nrf52840", "nrf5340dk/nrf5340/cpuapp", "nrf54l15dk/nrf54l15/cpuapp"]' + required: true + default: '["nrf52840dk/nrf52840", "nrf5340dk/nrf5340/cpuapp", "nrf54l15dk/nrf54l15/cpuapp", "nrf54l15dk/nrf54l15/cpuapp/ns", "nrf54l15dk/nrf54l10/cpuapp"]' jobs: - build_manual_tests: - strategy: - fail-fast: false - matrix: - subset: [1, 2, 3, 4, 5] - env: - MAX_SUBSETS: 5 - - runs-on: ubuntu-latest - container: - image: ghcr.io/nrfconnect/sdk-sidewalk:main - options: --cpus 2 - defaults: - run: - shell: nrfutil toolchain-manager launch --install-dir /root/ncs bash -- {0} - - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 0 - path: sidewalk - - - name: update NRF - run: | - cd sidewalk && git rev-parse HEAD > /workdir/sidewalk_hash && cd .. && - west init -m https://github.com/nrfconnect/sdk-nrf --mr main . && - cd nrf && - git fetch origin ${{inputs.nrf_revision}}:PR-branch && - git checkout PR-branch && - cd .. && - west config manifest.group-filter +sidewalk && - west update -n -o=--depth=1 --path-cache /workdir/ && - cd sidewalk && git checkout `cat /workdir/sidewalk_hash` && rm -rf /workdir/sidewalk_hash - - - name: Install Python dependencies - run: | - python3 -m pip install -r nrf/scripts/requirements.txt -r zephyr/scripts/requirements.txt -r sidewalk/scripts/ci/requirements.txt - - - name: Twister build manual tests - run: | - source zephyr/zephyr-env.sh - west twister --testsuite-root sidewalk/tests/manual --inline-logs --overflow-as-errors --enable-size-report --show-footprint --footprint-from-buildlog -vvv --build-only --subset ${{ matrix.subset }}/${{ env.MAX_SUBSETS }} - - - name: Prepare artifacts for upload - run: | - mkdir -p subsets/${{ matrix.subset }}_of_${{ env.MAX_SUBSETS }} - cp twister-out/twister.json subsets/${{ matrix.subset }}_of_${{ env.MAX_SUBSETS }} - - - name: Upload build artifacts - uses: actions/upload-artifact@v4 - if: always() - with: - name: manual-tests-artifacts-${{ matrix.subset }} - path: | - subsets - twister-out/**/*sidewalk*/build.log - twister-out/**/*sidewalk*/zephyr/.config - twister-out/**/*sidewalk*/zephyr/runners.yaml - twister-out/**/*sidewalk*/zephyr/zephyr.elf - twister-out/**/*sidewalk*/zephyr/zephyr.hex - twister-out/**/*sidewalk*/zephyr/merged.hex - twister-out/**/*sidewalk*/zephyr/merged_domains.hex - twister-out/**/*sidewalk*/zephyr/*.dts - twister-out/**/*sidewalk*/zephyr/dfu_application.zip - - merge_manual_tests: - needs: build_manual_tests - runs-on: ubuntu-latest - permissions: write-all - steps: - - name: Merge Artifacts - uses: actions/upload-artifact/merge@v4 - with: - delete-merged: true - name: manual-tests-artifacts - pattern: manual-tests-artifacts-* - build_and_run_x86_tests: - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 container: image: ghcr.io/nrfconnect/sdk-sidewalk:main options: --cpus 2 @@ -109,7 +31,8 @@ jobs: - name: update NRF run: | cd sidewalk && git rev-parse HEAD > /workdir/sidewalk_hash && cd .. && - west init -m https://github.com/nrfconnect/sdk-nrf --mr main . && + cp -r /workdir/nrf nrf; + west init -l nrf && cd nrf && git fetch origin ${{inputs.nrf_revision}}:PR-branch && git checkout PR-branch && @@ -125,7 +48,7 @@ jobs: - name: Twister build and run x86 tests run: | source zephyr/zephyr-env.sh - west twister --platform native_posix --platform unit_testing --coverage --coverage-basedir sidewalk --coverage-formats html,xml --enable-ubsan --enable-lsan --enable-asan --testsuite-root sidewalk --inline-logs --overflow-as-errors -vvv + west twister --test-config sidewalk/test_config.yaml --level="Github_tests" --testsuite-root sidewalk --platform native_sim --platform native_posix --platform unit_testing --coverage --coverage-basedir sidewalk --coverage-formats html,xml --enable-ubsan --enable-lsan --enable-asan --inline-logs --overflow-as-errors -vvv - name: Upload test results uses: actions/upload-artifact@v4 @@ -167,7 +90,7 @@ jobs: merge_tests_on_hw: needs: build-and-test_on_hw - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 if: always() permissions: write-all steps: diff --git a/.github/workflows/run_tests_dut.yml b/.github/workflows/run_tests_dut.yml index c25b8a83a3..9873c60bfc 100644 --- a/.github/workflows/run_tests_dut.yml +++ b/.github/workflows/run_tests_dut.yml @@ -27,7 +27,7 @@ on: jobs: build_dut_tests: name: "Build DUT tests (${{inputs.target_board}} - ${{ inputs.subset }})" - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 container: image: ghcr.io/nrfconnect/sdk-sidewalk:main options: --cpus 2 @@ -45,8 +45,9 @@ jobs: - name: update NRF run: | rm -rf .west nrf; + cp -r /workdir/nrf nrf; cd sidewalk && git rev-parse HEAD > /workdir/sidewalk_hash && cd .. && - west init -m https://github.com/nrfconnect/sdk-nrf --mr main . && + west init -l nrf && cd nrf && git fetch origin ${{inputs.nrf_revision}}:branch_to_run && git checkout branch_to_run && @@ -63,7 +64,11 @@ jobs: - name: Build DUT test artifacts run: | source zephyr/zephyr-env.sh - west twister --platform ${{inputs.target_board}} --testsuite-root sidewalk --filter runnable --shuffle-tests --shuffle-tests-seed 123 --inline-logs --overflow-as-errors -vvv --prep-artifacts-for-testing --package-artifacts PACKAGE_ARTIFACTS_${{ inputs.subset }}.tar.bz2 --subset ${{ inputs.subset }}/${{ inputs.max_subsets }} + west twister --test-config sidewalk/test_config.yaml --levels="Github_tests" --platform ${{inputs.target_board}} --testsuite-root sidewalk --filter runnable --shuffle-tests --shuffle-tests-seed 123 --inline-logs --overflow-as-errors -vvv --prep-artifacts-for-testing --package-artifacts PACKAGE_ARTIFACTS_${{ inputs.subset }}.tar.bz2 --subset ${{ inputs.subset }}/${{ inputs.max_subsets }} + + - name: Print ccache stats + run: | + ccache -ps; - name: Replace slash with underscore id: replace @@ -103,8 +108,9 @@ jobs: - name: update NRF run: | rm -rf .west nrf; - cd sidewalk && git rev-parse HEAD > /workdir/sidewalk_hash && cd .. - west init -m https://github.com/nrfconnect/sdk-nrf --mr main . && + cp -r /workdir/nrf nrf; + cd sidewalk && git rev-parse HEAD > /workdir/sidewalk_hash && cd .. && + west init -l nrf && cd nrf && git fetch origin ${{inputs.nrf_revision}}:branch_to_run && git checkout branch_to_run && diff --git a/.github/workflows/samples_build.yml b/.github/workflows/samples_build.yml index 0bae0a7a8f..f0db03b956 100644 --- a/.github/workflows/samples_build.yml +++ b/.github/workflows/samples_build.yml @@ -10,17 +10,23 @@ on: type: boolean required: false default: true + boards_to_test: + type: string + required: true + default: '["nrf52840dk/nrf52840", "nrf5340dk/nrf5340/cpuapp", "nrf54l15dk/nrf54l15/cpuapp", "nrf54l15dk/nrf54l15/cpuapp/ns", "nrf54l15dk/nrf54l10/cpuapp"]' + jobs: build_samples: strategy: fail-fast: false matrix: - subset: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15] + subset: [1, 2, 3, 4, 5] + board: ${{ fromJson(inputs.boards_to_test) }} env: - MAX_SUBSETS: 15 + MAX_SUBSETS: 5 - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 container: image: ghcr.io/nrfconnect/sdk-sidewalk:main options: --cpus 2 @@ -37,8 +43,10 @@ jobs: - name: update NRF run: | + rm -rf .west nrf; + cp -r /workdir/nrf nrf; cd sidewalk && git rev-parse HEAD > /workdir/sidewalk_hash && cd .. && - west init -m https://github.com/nrfconnect/sdk-nrf --mr main . && + west init -l nrf && cd nrf && git fetch origin ${{inputs.nrf_revision}}:PR-branch && git checkout PR-branch && @@ -51,21 +59,32 @@ jobs: run: | python3 -m pip install -r nrf/scripts/requirements.txt -r zephyr/scripts/requirements.txt -r sidewalk/scripts/ci/requirements.txt + - name: Replace slash with underscore + id: replace + run: | + TARGET_BOARD=${{ matrix.board }} + TARGET_BOARD=${TARGET_BOARD//\//_} + echo "target_board=$TARGET_BOARD" >> $GITHUB_OUTPUT + - name: Twister build samples run: | source zephyr/zephyr-env.sh - west twister --testsuite-root sidewalk/samples/ --inline-logs --overflow-as-errors --enable-size-report --show-footprint -vvv --build-only --subset ${{ matrix.subset }}/${{ env.MAX_SUBSETS }} + west twister --test-config sidewalk/test_config.yaml --testsuite-root sidewalk --level="samples" --platform ${{ matrix.board }} --inline-logs --overflow-as-errors --enable-size-report --show-footprint -vvv --build-only --subset ${{ matrix.subset }}/${{ env.MAX_SUBSETS }} + + - name: Print ccache stats + run: | + ccache -ps; - name: Prepare artifacts for upload run: | - mkdir -p subsets/${{ matrix.subset }}_of_${{ env.MAX_SUBSETS }} - cp twister-out/twister.json subsets/${{ matrix.subset }}_of_${{ env.MAX_SUBSETS }} + mkdir -p subsets/${{ matrix.subset }}_of_${{ env.MAX_SUBSETS }}_${{ steps.replace.outputs.target_board}} + cp twister-out/twister.json subsets/${{ matrix.subset }}_of_${{ env.MAX_SUBSETS }}_${{ steps.replace.outputs.target_board}} - name: Upload build metadata uses: actions/upload-artifact@v4 if: always() with: - name: sample-artifacts-meta-${{ matrix.subset }} + name: sample-artifacts-meta-${{ matrix.subset }}-${{ steps.replace.outputs.target_board}} path: | subsets twister-out/**/build.log @@ -77,17 +96,19 @@ jobs: uses: actions/upload-artifact@v4 if: ${{ inputs.save_images }} with: - name: sample-artifacts-build-${{ matrix.subset }} + name: sample-artifacts-build-${{ matrix.subset }}-${{ steps.replace.outputs.target_board}} path: | + subsets twister-out/**/zephyr.elf twister-out/**/zephyr.hex twister-out/**/merged.hex twister-out/**/merged_domains.hex + twister-out/**/dfu_multi_image.bin twister-out/**/dfu_application.zip merge_sample_artifacts: needs: build_samples - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 if: always() permissions: write-all steps: diff --git a/.github/workflows/validate_code_style.yml b/.github/workflows/validate_code_style.yml index 1ba3af78c8..16e732a025 100644 --- a/.github/workflows/validate_code_style.yml +++ b/.github/workflows/validate_code_style.yml @@ -9,7 +9,7 @@ on: jobs: check_formating_and_license: - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - name: Checkout uses: actions/checkout@v4 @@ -34,7 +34,7 @@ jobs: python3 sidewalk/scripts/ci/verify_license.py -s . -c sidewalk/scripts/ci/license.yml validate_compliance_with_zephyr: - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 container: image: ghcr.io/nrfconnect/sdk-sidewalk:main options: --cpus 2 diff --git a/samples/sid_end_device/sample.yaml b/samples/sid_end_device/sample.yaml index a5fc402319..c09f5e8524 100644 --- a/samples/sid_end_device/sample.yaml +++ b/samples/sid_end_device/sample.yaml @@ -17,14 +17,14 @@ common: - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54l15dk/nrf54l10/cpuapp tests: - sample.sidewalk.hello: + sidewalk.samples.sid_end_device.hello: extra_configs: - CONFIG_SID_END_DEVICE_PERSISTENT_LINK_MASK=y - CONFIG_SIDEWALK_FILE_TRANSFER=y - CONFIG_SIDEWALK_APPLICATION_NAME="hello" tags: Sidewalk hello - sample.sidewalk.hello.release: + sidewalk.samples.sid_end_device.hello.release: extra_args: FILE_SUFFIX=release extra_configs: @@ -32,13 +32,13 @@ tests: - CONFIG_SIDEWALK_APPLICATION_NAME="hello.release" tags: Sidewalk hello - sample.sidewalk.hello.ble_only: + sidewalk.samples.sid_end_device.hello.ble_only: extra_configs: - CONFIG_SIDEWALK_SUBGHZ_SUPPORT=n - CONFIG_SIDEWALK_APPLICATION_NAME="hello.ble_only" tags: Sidewalk hello BLE - sample.sidewalk.hello.ble_only.release: + sidewalk.samples.sid_end_device.hello.ble_only.release: extra_args: FILE_SUFFIX=release extra_configs: @@ -46,7 +46,7 @@ tests: - CONFIG_SIDEWALK_APPLICATION_NAME="hello.ble_only.release" tags: Sidewalk hello BLE - sample.sidewalk.demo: + sidewalk.samples.sid_end_device.demo: extra_args: OVERLAY_CONFIG="overlay-demo.conf" extra_configs: @@ -54,7 +54,7 @@ tests: - CONFIG_SIDEWALK_APPLICATION_NAME="demo" tags: Sidewalk demo - sample.sidewalk.demo.ble_only: + sidewalk.samples.sid_end_device.demo.ble_only: platform_allow: - thingy53/nrf5340/cpuapp extra_args: @@ -66,14 +66,14 @@ tests: - thingy53/nrf5340/cpuapp tags: Sidewalk demo BLE - sample.sidewalk.dut: + sidewalk.samples.sid_end_device.dut: extra_args: OVERLAY_CONFIG="overlay-dut.conf" extra_configs: - CONFIG_SIDEWALK_APPLICATION_NAME="dut" tags: Sidewalk cli - sample.sidewalk.dut.ble_only: + sidewalk.samples.sid_end_device.dut.ble_only: extra_args: OVERLAY_CONFIG="overlay-dut.conf" extra_configs: @@ -81,7 +81,7 @@ tests: - CONFIG_SIDEWALK_APPLICATION_NAME="dut.ble_only" tags: Sidewalk cli BLE - sample.sidewalk.dut.no_secure: + sidewalk.samples.sid_end_device.dut.no_secure: extra_args: OVERLAY_CONFIG="overlay-dut.conf" extra_configs: diff --git a/test_config.yaml b/test_config.yaml new file mode 100644 index 0000000000..43356fa987 --- /dev/null +++ b/test_config.yaml @@ -0,0 +1,36 @@ +platforms: + override_default_platforms: false + increased_platform_scope: false + +levels: + - name: samples + description: > + Prepare samples. + adds: + - sidewalk.samples.* + - sidewalk.test.acceptance.simple_bootloader + + - name: unit + description: > + Check units in isolation. + adds: + - sidewalk.test.unit.* + + - name: integration + description: > + Verify implementation of PAL on target + adds: + - sidewalk.test.integration.* + + - name: Github_tests + description: > + set of tests run on GitHub + inherits: + - unit + - integration + + - name: bugs + description: > + Test known issues and bug scenarios. + adds: + - sidewalk.test.acceptance.bugs.* diff --git a/tests/functional/critical_region/testcase.yaml b/tests/functional/critical_region/testcase.yaml index 27ac7968aa..6ac26b1c23 100644 --- a/tests/functional/critical_region/testcase.yaml +++ b/tests/functional/critical_region/testcase.yaml @@ -1,5 +1,5 @@ tests: - sidewalk.functional.critical_region: + sidewalk.test.integration.critical_region: sysbuild: true platform_allow: - nrf52840dk/nrf52840 diff --git a/tests/functional/crypto/testcase.yaml b/tests/functional/crypto/testcase.yaml index 9ee76969b1..9e9339c787 100644 --- a/tests/functional/crypto/testcase.yaml +++ b/tests/functional/crypto/testcase.yaml @@ -1,5 +1,5 @@ tests: - sidewalk.functional.crypto: + sidewalk.test.integration.crypto: sysbuild: true tags: Sidewalk platform_allow: diff --git a/tests/functional/crypto_keys/testcase.yaml b/tests/functional/crypto_keys/testcase.yaml index 69ad53855c..ab9baa66fc 100644 --- a/tests/functional/crypto_keys/testcase.yaml +++ b/tests/functional/crypto_keys/testcase.yaml @@ -1,5 +1,5 @@ tests: - sidewalk.functional.crypto_keys: + sidewalk.test.integration.crypto_keys: sysbuild: true tags: Sidewalk platform_allow: diff --git a/tests/functional/interrupts/testcase.yaml b/tests/functional/interrupts/testcase.yaml index 2b464b3548..3a8a32be59 100644 --- a/tests/functional/interrupts/testcase.yaml +++ b/tests/functional/interrupts/testcase.yaml @@ -1,5 +1,5 @@ tests: - unity.sidewalk.functional.interrupts: + sidewalk.test.integration.interrupts: sysbuild: true tags: Sidewalk platform_allow: diff --git a/tests/functional/mfg_storage/testcase.yaml b/tests/functional/mfg_storage/testcase.yaml index 19459cfe90..f0b454d391 100644 --- a/tests/functional/mfg_storage/testcase.yaml +++ b/tests/functional/mfg_storage/testcase.yaml @@ -1,5 +1,5 @@ tests: - sidewalk.functional.mfg_storage: + sidewalk.test.integration.mfg_storage: skip: true sysbuild: true tags: Sidewalk @@ -16,7 +16,7 @@ tests: - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54l15dk/nrf54l10/cpuapp - sidewalk.functional.mfg_storage_deprecated: + sidewalk.test.integration.mfg_storage_deprecated: skip: true sysbuild: true tags: Sidewalk diff --git a/tests/functional/pal_delay/testcase.yaml b/tests/functional/pal_delay/testcase.yaml index 7036873df7..a0e95362ec 100644 --- a/tests/functional/pal_delay/testcase.yaml +++ b/tests/functional/pal_delay/testcase.yaml @@ -1,5 +1,5 @@ tests: - sidewalk.functional.delay: + sidewalk.test.integration.delay: sysbuild: true platform_allow: - nrf52840dk/nrf52840 diff --git a/tests/functional/spi_bus/testcase.yaml b/tests/functional/spi_bus/testcase.yaml index 65fac9d01c..2666aa16f1 100644 --- a/tests/functional/spi_bus/testcase.yaml +++ b/tests/functional/spi_bus/testcase.yaml @@ -1,5 +1,5 @@ tests: - sidewalk.functional.spi_bus: + sidewalk.test.integration.spi_bus: sysbuild: true platform_allow: - nrf52840dk/nrf52840 diff --git a/tests/functional/storage/testcase.yaml b/tests/functional/storage/testcase.yaml index b49f883356..370f95866e 100644 --- a/tests/functional/storage/testcase.yaml +++ b/tests/functional/storage/testcase.yaml @@ -1,5 +1,5 @@ tests: - sidewalk.functional.storage: + sidewalk.test.integration.storage: sysbuild: true tags: Sidewalk platform_allow: diff --git a/tests/functional/temperature/testcase.yaml b/tests/functional/temperature/testcase.yaml index a250fc537d..869e6c60ac 100644 --- a/tests/functional/temperature/testcase.yaml +++ b/tests/functional/temperature/testcase.yaml @@ -1,5 +1,5 @@ tests: - sidewalk.functional.temperature: + sidewalk.test.integration.temperature: sysbuild: true platform_allow: - nrf52840dk/nrf52840 diff --git a/tests/functional/time/testcase.yaml b/tests/functional/time/testcase.yaml index 7a1eeb6a39..8a982c6407 100644 --- a/tests/functional/time/testcase.yaml +++ b/tests/functional/time/testcase.yaml @@ -1,5 +1,5 @@ tests: - sidewalk.functional.time: + sidewalk.test.integration.time: sysbuild: true tags: Sidewalk platform_allow: diff --git a/tests/manual/simple_bootloader/sample.yaml b/tests/manual/simple_bootloader/sample.yaml index f6443c67de..471a2c0ed6 100644 --- a/tests/manual/simple_bootloader/sample.yaml +++ b/tests/manual/simple_bootloader/sample.yaml @@ -2,7 +2,7 @@ sample: name: simple bootloader app description: Small footprint application to verify sidewalk dfu tests: - sidewalk.test.simple_bootloader: + sidewalk.test.acceptance.simple_bootloader: sysbuild: true build_only: true platform_allow: diff --git a/tests/unit_tests/mfg_parsers/boards/nrf54l15dk_nrf54l10_cpuapp.overlay b/tests/unit_tests/mfg_parsers/boards/nrf54l15dk_nrf54l10_cpuapp.overlay new file mode 100644 index 0000000000..e5d21541b8 --- /dev/null +++ b/tests/unit_tests/mfg_parsers/boards/nrf54l15dk_nrf54l10_cpuapp.overlay @@ -0,0 +1,14 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +&cpuapp_rram { + reg = <0x0 DT_SIZE_K(1024)>; +}; + +&cpuapp_sram { + reg = <0x20000000 DT_SIZE_K(192)>; + ranges = <0x0 0x20000000 DT_SIZE_K(192)>; +}; diff --git a/tests/unit_tests/mfg_parsers/testcase.yaml b/tests/unit_tests/mfg_parsers/testcase.yaml index 872f09e2a8..90ad5e0bca 100644 --- a/tests/unit_tests/mfg_parsers/testcase.yaml +++ b/tests/unit_tests/mfg_parsers/testcase.yaml @@ -1,5 +1,5 @@ tests: - sidewalk.unit_tests.mfg_parser: + sidewalk.test.unit.mfg_parser: sysbuild: true platform_allow: - native_posix @@ -15,7 +15,7 @@ tests: - nrf54l15dk/nrf54l15/cpuapp - nrf54l15dk/nrf54l10/cpuapp - sidewalk.unit_tests.mfg_parser_psa_storage: + sidewalk.test.unit.mfg_parser_psa_storage: sysbuild: true platform_allow: native_posix tags: Sidewalk diff --git a/tests/unit_tests/pal_assert/testcase.yaml b/tests/unit_tests/pal_assert/testcase.yaml index 26d46be30b..8b24de2420 100644 --- a/tests/unit_tests/pal_assert/testcase.yaml +++ b/tests/unit_tests/pal_assert/testcase.yaml @@ -1,5 +1,5 @@ tests: - sidewalk.unit_tests.assert: + sidewalk.test.unit.assert: sysbuild: false tags: Sidewalk type: unit diff --git a/tests/unit_tests/pal_ble_adapter/testcase.yaml b/tests/unit_tests/pal_ble_adapter/testcase.yaml index 55d870581a..3b166b2e31 100644 --- a/tests/unit_tests/pal_ble_adapter/testcase.yaml +++ b/tests/unit_tests/pal_ble_adapter/testcase.yaml @@ -1,5 +1,5 @@ tests: - sidewalk.unit_tests.ble_adapter: + sidewalk.test.unit.ble_adapter: sysbuild: true platform_allow: native_posix tags: Sidewalk diff --git a/tests/unit_tests/pal_crypto/testcase.yaml b/tests/unit_tests/pal_crypto/testcase.yaml index 1317b34c0a..047a2dca7e 100644 --- a/tests/unit_tests/pal_crypto/testcase.yaml +++ b/tests/unit_tests/pal_crypto/testcase.yaml @@ -1,5 +1,5 @@ tests: - sidewalk.unit_tests.crypto: + sidewalk.test.unit.crypto: sysbuild: true tags: Sidewalk platform_allow: native_posix diff --git a/tests/unit_tests/pal_log/testcase.yaml b/tests/unit_tests/pal_log/testcase.yaml index 084d3dd9d5..a25a782494 100644 --- a/tests/unit_tests/pal_log/testcase.yaml +++ b/tests/unit_tests/pal_log/testcase.yaml @@ -1,5 +1,5 @@ tests: - sidewalk.unit_tests.log: + sidewalk.test.unit.log: sysbuild: true platform_allow: native_posix tags: Sidewalk diff --git a/tests/unit_tests/pal_mfg_storage/testcase.yaml b/tests/unit_tests/pal_mfg_storage/testcase.yaml index 10fb344b83..18224e148e 100644 --- a/tests/unit_tests/pal_mfg_storage/testcase.yaml +++ b/tests/unit_tests/pal_mfg_storage/testcase.yaml @@ -1,5 +1,5 @@ tests: - sidewalk.unit_tests.mfg_storage: + sidewalk.test.unit.mfg_storage: skip: true sysbuild: true platform_allow: native_posix diff --git a/tests/unit_tests/pal_storage_kv/testcase.yaml b/tests/unit_tests/pal_storage_kv/testcase.yaml index 1435b99114..4bbf9ee61e 100644 --- a/tests/unit_tests/pal_storage_kv/testcase.yaml +++ b/tests/unit_tests/pal_storage_kv/testcase.yaml @@ -1,12 +1,12 @@ tests: - sidewalk.unit_tests.storage_kv.NVS: + sidewalk.test.unit.storage_kv.NVS: sysbuild: true platform_allow: native_posix tags: Sidewalk integration_platforms: - native_posix - sidewalk.unit_tests.storage_kv.ZMS: + sidewalk.test.unit.storage_kv.ZMS: sysbuild: true platform_allow: native_posix tags: Sidewalk diff --git a/tests/unit_tests/pal_sw_interrupts/testcase.yaml b/tests/unit_tests/pal_sw_interrupts/testcase.yaml index bf785633f5..699cfb589c 100644 --- a/tests/unit_tests/pal_sw_interrupts/testcase.yaml +++ b/tests/unit_tests/pal_sw_interrupts/testcase.yaml @@ -1,5 +1,5 @@ tests: - unity.sidewalk.unit_tests.interrupts: + sidewalk.test.unit.interrupts: sysbuild: false tags: Sidewalk type: unit diff --git a/tests/unit_tests/pal_temperature/testcase.yaml b/tests/unit_tests/pal_temperature/testcase.yaml index 05e4c51e2f..9d01274deb 100644 --- a/tests/unit_tests/pal_temperature/testcase.yaml +++ b/tests/unit_tests/pal_temperature/testcase.yaml @@ -1,5 +1,5 @@ tests: - sidewalk.unit_tests.temperature: + sidewalk.test.unit.temperature: sysbuild: true platform_allow: native_posix tags: Sidewalk diff --git a/tests/unit_tests/pal_timer/testcase.yaml b/tests/unit_tests/pal_timer/testcase.yaml index 78cd6f9430..94f18f9c5a 100644 --- a/tests/unit_tests/pal_timer/testcase.yaml +++ b/tests/unit_tests/pal_timer/testcase.yaml @@ -1,5 +1,5 @@ tests: - sidewalk.unit_tests.timer: + sidewalk.test.unit.timer: sysbuild: true platform_allow: native_posix tags: Sidewalk diff --git a/tests/unit_tests/pal_uptime/testcase.yaml b/tests/unit_tests/pal_uptime/testcase.yaml index 2c1d62cdea..1d45c4c52f 100644 --- a/tests/unit_tests/pal_uptime/testcase.yaml +++ b/tests/unit_tests/pal_uptime/testcase.yaml @@ -1,5 +1,5 @@ tests: - sidewalk.unit_tests.uptime: + sidewalk.test.unit.uptime: sysbuild: true platform_allow: native_posix tags: Sidewalk diff --git a/tests/unit_tests/scratch_buffer/testcase.yaml b/tests/unit_tests/scratch_buffer/testcase.yaml index 1b307de70b..81c1b91bb9 100644 --- a/tests/unit_tests/scratch_buffer/testcase.yaml +++ b/tests/unit_tests/scratch_buffer/testcase.yaml @@ -1,5 +1,5 @@ tests: - sidewalk.unit_tests.scratch_buffer: + sidewalk.test.unit.scratch_buffer: sysbuild: false tags: Sidewalk type: unit diff --git a/tests/unit_tests/sid_ace_alloc/testcase.yaml b/tests/unit_tests/sid_ace_alloc/testcase.yaml index 7232bc8098..e90d99b1c7 100644 --- a/tests/unit_tests/sid_ace_alloc/testcase.yaml +++ b/tests/unit_tests/sid_ace_alloc/testcase.yaml @@ -1,5 +1,5 @@ tests: - sidewalk.unit_tests.ace.alloc: + sidewalk.test.unit.ace.alloc: sysbuild: true platform_allow: - nrf52840dk/nrf52840 diff --git a/tests/unit_tests/sid_ble_adapter_callbacks/testcase.yaml b/tests/unit_tests/sid_ble_adapter_callbacks/testcase.yaml index 8282d765a2..186037e2f4 100644 --- a/tests/unit_tests/sid_ble_adapter_callbacks/testcase.yaml +++ b/tests/unit_tests/sid_ble_adapter_callbacks/testcase.yaml @@ -1,5 +1,5 @@ tests: - sidewalk.unit_tests.ble_adapter_callbacks: + sidewalk.test.unit.ble_adapter_callbacks: sysbuild: true platform_allow: native_posix tags: Sidewalk diff --git a/tests/unit_tests/sid_ble_advert/testcase.yaml b/tests/unit_tests/sid_ble_advert/testcase.yaml index 54c0a7c784..c16bb8191b 100644 --- a/tests/unit_tests/sid_ble_advert/testcase.yaml +++ b/tests/unit_tests/sid_ble_advert/testcase.yaml @@ -1,5 +1,5 @@ tests: - sidewalk.unit_tests.ble_advertising: + sidewalk.test.unit.ble_advertising: sysbuild: true platform_allow: native_posix tags: Sidewalk diff --git a/tests/unit_tests/sid_ble_connection/testcase.yaml b/tests/unit_tests/sid_ble_connection/testcase.yaml index b5662bc127..a68ddb0f84 100644 --- a/tests/unit_tests/sid_ble_connection/testcase.yaml +++ b/tests/unit_tests/sid_ble_connection/testcase.yaml @@ -1,5 +1,5 @@ tests: - sidewalk.unit_tests.ble_connection: + sidewalk.test.unit.ble_connection: sysbuild: true platform_allow: native_posix tags: Sidewalk diff --git a/tests/unit_tests/sid_ble_service/testcase.yaml b/tests/unit_tests/sid_ble_service/testcase.yaml index 820ddd4932..6efbe9b6b0 100644 --- a/tests/unit_tests/sid_ble_service/testcase.yaml +++ b/tests/unit_tests/sid_ble_service/testcase.yaml @@ -1,5 +1,5 @@ tests: - sidewalk.unit_tests.sid_ble_service: + sidewalk.test.unit.sid_ble_service: sysbuild: true platform_allow: native_posix tags: Sidewalk diff --git a/tests/unit_tests/sid_dut_shell/testcase.yaml b/tests/unit_tests/sid_dut_shell/testcase.yaml index 7e80f10ff6..85715e4ed7 100644 --- a/tests/unit_tests/sid_dut_shell/testcase.yaml +++ b/tests/unit_tests/sid_dut_shell/testcase.yaml @@ -1,5 +1,5 @@ tests: - sidewalk.unit_tests.sid_dut_shell: + sidewalk.test.unit.sid_dut_shell: sysbuild: false tags: Sidewalk type: unit diff --git a/tests/unit_tests/sid_pal_gpio/testcase.yaml b/tests/unit_tests/sid_pal_gpio/testcase.yaml index 711b20d6ec..34615a6385 100644 --- a/tests/unit_tests/sid_pal_gpio/testcase.yaml +++ b/tests/unit_tests/sid_pal_gpio/testcase.yaml @@ -1,5 +1,5 @@ tests: - sidewalk.unit_tests.gpio: + sidewalk.test.unit.gpio: sysbuild: true platform_allow: native_posix tags: Sidewalk diff --git a/tests/unit_tests/state_notifier/testcase.yaml b/tests/unit_tests/state_notifier/testcase.yaml index 31c35fdbc5..7214a424a1 100644 --- a/tests/unit_tests/state_notifier/testcase.yaml +++ b/tests/unit_tests/state_notifier/testcase.yaml @@ -1,5 +1,5 @@ tests: - sidewalk.unit_tests.state_notifier: + sidewalk.test.unit.state_notifier: sysbuild: false tags: Sidewalk type: unit diff --git a/tests/unit_tests/tlv/testcase.yaml b/tests/unit_tests/tlv/testcase.yaml index bda296d117..b50175420b 100644 --- a/tests/unit_tests/tlv/testcase.yaml +++ b/tests/unit_tests/tlv/testcase.yaml @@ -1,5 +1,5 @@ tests: - sidewalk.unit_tests.tlv: + sidewalk.test.unit.tlv: sysbuild: true platform_allow: native_posix tags: Sidewalk diff --git a/tests/validation/crypto/testcase.yaml b/tests/validation/crypto/testcase.yaml index f761b2ca73..d9fb1a2068 100644 --- a/tests/validation/crypto/testcase.yaml +++ b/tests/validation/crypto/testcase.yaml @@ -1,5 +1,5 @@ tests: - sidewalk.sid_validation.pal_crypto: + sidewalk.test.integration.pal_crypto: sysbuild: true platform_allow: - nrf52840dk/nrf52840 diff --git a/tests/validation/storage_kv/testcase.yaml b/tests/validation/storage_kv/testcase.yaml index 66fecb12ca..c3af2f0785 100644 --- a/tests/validation/storage_kv/testcase.yaml +++ b/tests/validation/storage_kv/testcase.yaml @@ -1,5 +1,5 @@ tests: - sidewalk.sid_validation.pal_storage_kv: + sidewalk.test.integration.pal_storage_kv: sysbuild: true platform_allow: - nrf52840dk/nrf52840 diff --git a/tests/validation/timer/testcase.yaml b/tests/validation/timer/testcase.yaml index 3dbf9b992e..2b24978939 100644 --- a/tests/validation/timer/testcase.yaml +++ b/tests/validation/timer/testcase.yaml @@ -1,5 +1,5 @@ tests: - sidewalk.sid_validation.pal_timer: + sidewalk.test.integration.pal_timer: sysbuild: true platform_allow: - nrf52840dk/nrf52840 From ebd9e5f65f07090f002278b188eb0055a0b7b887 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Ga=C5=82at?= Date: Tue, 10 Dec 2024 18:27:04 +0000 Subject: [PATCH 3/6] GHA: add cache MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit restore ccache data before build Signed-off-by: Robert Gałat --- .github/workflows/run_tests.yml | 8 ++++++++ .github/workflows/run_tests_dut.yml | 22 +++++++++++++++------- .github/workflows/samples_build.yml | 8 ++++++++ 3 files changed, 31 insertions(+), 7 deletions(-) diff --git a/.github/workflows/run_tests.yml b/.github/workflows/run_tests.yml index 9c5e7aa78f..ec36ac1cff 100644 --- a/.github/workflows/run_tests.yml +++ b/.github/workflows/run_tests.yml @@ -45,6 +45,14 @@ jobs: run: | python3 -m pip install -r nrf/scripts/requirements.txt -r zephyr/scripts/requirements.txt -r sidewalk/scripts/ci/requirements.txt + - name: Ccache + id: ccache + uses: actions/cache@v4 + with: + path: ~/.cache/ccache + key: ccache-test_x86-${{ github.run_id }} + restore-keys: ccache-test_x86- + - name: Twister build and run x86 tests run: | source zephyr/zephyr-env.sh diff --git a/.github/workflows/run_tests_dut.yml b/.github/workflows/run_tests_dut.yml index 9873c60bfc..fa544f010a 100644 --- a/.github/workflows/run_tests_dut.yml +++ b/.github/workflows/run_tests_dut.yml @@ -61,6 +61,21 @@ jobs: run: | python3 -m pip install -r nrf/scripts/requirements.txt -r zephyr/scripts/requirements.txt -r sidewalk/scripts/ci/requirements.txt + - name: Replace slash with underscore + id: replace + run: | + TARGET_BOARD=${{ inputs.target_board }} + TARGET_BOARD=${TARGET_BOARD//\//_} + echo "target_board=$TARGET_BOARD" >> $GITHUB_OUTPUT + + - name: Ccache + id: ccache + uses: actions/cache@v4 + with: + path: ~/.cache/ccache + key: ccache-tests_dut-${{ inputs.subset }}-${{steps.replace.outputs.target_board}}-${{ github.run_id }} + restore-keys: ccache-tests_dut-${{ inputs.subset }}-${{ steps.replace.outputs.target_board}}- + - name: Build DUT test artifacts run: | source zephyr/zephyr-env.sh @@ -70,13 +85,6 @@ jobs: run: | ccache -ps; - - name: Replace slash with underscore - id: replace - run: | - TARGET_BOARD=${{ inputs.target_board }} - TARGET_BOARD=${TARGET_BOARD//\//_} - echo "target_board=$TARGET_BOARD" >> $GITHUB_OUTPUT - - name: Save build artifacts uses: actions/upload-artifact@v4 with: diff --git a/.github/workflows/samples_build.yml b/.github/workflows/samples_build.yml index f0db03b956..4f6c12366e 100644 --- a/.github/workflows/samples_build.yml +++ b/.github/workflows/samples_build.yml @@ -66,6 +66,14 @@ jobs: TARGET_BOARD=${TARGET_BOARD//\//_} echo "target_board=$TARGET_BOARD" >> $GITHUB_OUTPUT + - name: Ccache + id: ccache + uses: actions/cache@v4 + with: + path: ~/.cache/ccache + key: ccache-samples-${{ matrix.subset }}-${{ steps.replace.outputs.target_board}}-${{ github.run_id }} + restore-keys: ccache-samples-${{ matrix.subset }}-${{ steps.replace.outputs.target_board}}- + - name: Twister build samples run: | source zephyr/zephyr-env.sh From aaede1ac9b40c8358b50ae7a49783747a2dddee1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Ga=C5=82at?= Date: Tue, 10 Dec 2024 18:58:51 +0000 Subject: [PATCH 4/6] test: pal_delay MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit add log to asserts Signed-off-by: Robert Gałat --- tests/functional/pal_delay/src/main.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/functional/pal_delay/src/main.c b/tests/functional/pal_delay/src/main.c index 4e598a064e..4d5b8bb796 100644 --- a/tests/functional/pal_delay/src/main.c +++ b/tests/functional/pal_delay/src/main.c @@ -24,11 +24,13 @@ ZTEST(pal_delay, test_sid_pal_delay) sid_pal_delay_us(MIN_DELAY_US); uint64_t delta = TIMESTAMP_US_GET() - timestamp; - zassert_true(abs((int)(MIN_DELAY_US - delta)) <= MAX_DELAY_US_THRESHOLD); + zassert_true(abs((int)(MIN_DELAY_US - delta)) <= MAX_DELAY_US_THRESHOLD, + "expected delay %d took %d", MIN_DELAY_US, delta); timestamp = TIMESTAMP_US_GET(); sid_pal_delay_us(DELAY_US); delta = TIMESTAMP_US_GET() - timestamp; - zassert_true(abs((int)(DELAY_US - delta)) <= MAX_DELAY_US_THRESHOLD); + zassert_true(abs((int)(DELAY_US - delta)) <= MAX_DELAY_US_THRESHOLD, + "expected delay %d took %d", DELAY_US, delta); } ZTEST(pal_delay, test_sanity) From 89e202a99b03819bad998f944caf7b2c8ce6c9dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Ga=C5=82at?= Date: Tue, 10 Dec 2024 19:13:28 +0000 Subject: [PATCH 5/6] GHA: reduce number of subsets MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit after introduction to ccache, setup is now significant part of run by increasing jobs on machine we increase value Signed-off-by: Robert Gałat --- .github/workflows/run_tests.yml | 4 ++-- .github/workflows/run_tests_dut.yml | 2 +- .github/workflows/samples_build.yml | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/run_tests.yml b/.github/workflows/run_tests.yml index ec36ac1cff..2c0629fdca 100644 --- a/.github/workflows/run_tests.yml +++ b/.github/workflows/run_tests.yml @@ -86,12 +86,12 @@ jobs: strategy: fail-fast: false matrix: - subset: [1, 2, 3, 4] + subset: [1, 2] board: ${{ fromJson(inputs.boards_to_test) }} uses: ./.github/workflows/run_tests_dut.yml with: subset: ${{ matrix.subset }} - max_subsets: 4 + max_subsets: 2 run_tests: true target_board: ${{ matrix.board }} nrf_revision: ${{ inputs.nrf_revision }} diff --git a/.github/workflows/run_tests_dut.yml b/.github/workflows/run_tests_dut.yml index fa544f010a..b2f3c2a994 100644 --- a/.github/workflows/run_tests_dut.yml +++ b/.github/workflows/run_tests_dut.yml @@ -172,5 +172,5 @@ jobs: - name: clean artifacts if: always() run: | - cd nrf; git checkout main; git branch -D branch_to_run; + cd nrf; git checkout main; git branch -D branch_to_run; cd ..; rm -rf PACKAGE_ARTIFACTS_* twister-out diff --git a/.github/workflows/samples_build.yml b/.github/workflows/samples_build.yml index 4f6c12366e..c59bc7ba30 100644 --- a/.github/workflows/samples_build.yml +++ b/.github/workflows/samples_build.yml @@ -21,10 +21,10 @@ jobs: strategy: fail-fast: false matrix: - subset: [1, 2, 3, 4, 5] + subset: [1, 2, 3] board: ${{ fromJson(inputs.boards_to_test) }} env: - MAX_SUBSETS: 5 + MAX_SUBSETS: 3 runs-on: ubuntu-24.04 container: From 5391e16527bd2b3e3623b3d48c91e6773524d78f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Ga=C5=82at?= Date: Fri, 13 Dec 2024 11:51:17 +0000 Subject: [PATCH 6/6] test: revert change name of samples in testcase.yml MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit the test names are used by Jenkins. They will be changed in other time Signed-off-by: Robert Gałat --- samples/sid_end_device/sample.yaml | 18 +++++++++--------- test_config.yaml | 4 ++-- tests/manual/simple_bootloader/sample.yaml | 2 +- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/samples/sid_end_device/sample.yaml b/samples/sid_end_device/sample.yaml index c09f5e8524..a5fc402319 100644 --- a/samples/sid_end_device/sample.yaml +++ b/samples/sid_end_device/sample.yaml @@ -17,14 +17,14 @@ common: - nrf54l15dk/nrf54l15/cpuapp/ns - nrf54l15dk/nrf54l10/cpuapp tests: - sidewalk.samples.sid_end_device.hello: + sample.sidewalk.hello: extra_configs: - CONFIG_SID_END_DEVICE_PERSISTENT_LINK_MASK=y - CONFIG_SIDEWALK_FILE_TRANSFER=y - CONFIG_SIDEWALK_APPLICATION_NAME="hello" tags: Sidewalk hello - sidewalk.samples.sid_end_device.hello.release: + sample.sidewalk.hello.release: extra_args: FILE_SUFFIX=release extra_configs: @@ -32,13 +32,13 @@ tests: - CONFIG_SIDEWALK_APPLICATION_NAME="hello.release" tags: Sidewalk hello - sidewalk.samples.sid_end_device.hello.ble_only: + sample.sidewalk.hello.ble_only: extra_configs: - CONFIG_SIDEWALK_SUBGHZ_SUPPORT=n - CONFIG_SIDEWALK_APPLICATION_NAME="hello.ble_only" tags: Sidewalk hello BLE - sidewalk.samples.sid_end_device.hello.ble_only.release: + sample.sidewalk.hello.ble_only.release: extra_args: FILE_SUFFIX=release extra_configs: @@ -46,7 +46,7 @@ tests: - CONFIG_SIDEWALK_APPLICATION_NAME="hello.ble_only.release" tags: Sidewalk hello BLE - sidewalk.samples.sid_end_device.demo: + sample.sidewalk.demo: extra_args: OVERLAY_CONFIG="overlay-demo.conf" extra_configs: @@ -54,7 +54,7 @@ tests: - CONFIG_SIDEWALK_APPLICATION_NAME="demo" tags: Sidewalk demo - sidewalk.samples.sid_end_device.demo.ble_only: + sample.sidewalk.demo.ble_only: platform_allow: - thingy53/nrf5340/cpuapp extra_args: @@ -66,14 +66,14 @@ tests: - thingy53/nrf5340/cpuapp tags: Sidewalk demo BLE - sidewalk.samples.sid_end_device.dut: + sample.sidewalk.dut: extra_args: OVERLAY_CONFIG="overlay-dut.conf" extra_configs: - CONFIG_SIDEWALK_APPLICATION_NAME="dut" tags: Sidewalk cli - sidewalk.samples.sid_end_device.dut.ble_only: + sample.sidewalk.dut.ble_only: extra_args: OVERLAY_CONFIG="overlay-dut.conf" extra_configs: @@ -81,7 +81,7 @@ tests: - CONFIG_SIDEWALK_APPLICATION_NAME="dut.ble_only" tags: Sidewalk cli BLE - sidewalk.samples.sid_end_device.dut.no_secure: + sample.sidewalk.dut.no_secure: extra_args: OVERLAY_CONFIG="overlay-dut.conf" extra_configs: diff --git a/test_config.yaml b/test_config.yaml index 43356fa987..55589a2898 100644 --- a/test_config.yaml +++ b/test_config.yaml @@ -7,8 +7,8 @@ levels: description: > Prepare samples. adds: - - sidewalk.samples.* - - sidewalk.test.acceptance.simple_bootloader + - sample.sidewalk.* + - sidewalk.test.simple_bootloader - name: unit description: > diff --git a/tests/manual/simple_bootloader/sample.yaml b/tests/manual/simple_bootloader/sample.yaml index 471a2c0ed6..f6443c67de 100644 --- a/tests/manual/simple_bootloader/sample.yaml +++ b/tests/manual/simple_bootloader/sample.yaml @@ -2,7 +2,7 @@ sample: name: simple bootloader app description: Small footprint application to verify sidewalk dfu tests: - sidewalk.test.acceptance.simple_bootloader: + sidewalk.test.simple_bootloader: sysbuild: true build_only: true platform_allow: