Skip to content

[NXDART] NuttX Distributed Automation for Build and Runtime Testing. #15730

Open
0 of 5 issues completed
Open

Description

@cederom
  • In order to maintain high quality of the code releases we need not only Build but also Runtime Automated Testing on a Real World Hardware Boards.
  • GitHub CI provides automated Pull Request verification (@lupyuen manages). TestBot already operational and can be controller with comment commands.
  • We need to test built code on a physical devices in order to validate drivers etc.
  • Solution should be distributed, so anyone can test what they have at hand/home/work/desk.
  • It's called Distributed Test Environment because it enables independent decentralized cross-check examination.
  • Distributed design provides availability redundancy.
  • Solution is designed to be zero-cost and low maintenance cost. Tested already on rPI-Zero-2W that takes 1W idle and 5W build power with ~400 sec build time of medium size configuration (raspberrypi-pico:nsh).
  • Some sort of central Dashboard is required for build/runtime logs storage, analysis, reporting (@lupyuen manages). NuttX Dashboard already updated and serves TestBot to do runtime on real world hardware boards.
  • It will objectively indicate which change broke (or is going to break) what and where, so project can react accordingly.
  • Use case: Some old PC as local CI machine, attach available board(s), build and runtime test master, report problems to Dashboard.
  • For now we are working on existing board configurations (nsh and ostest) and adapt tests scenarios. Board configs need cleanup and standardizatiion (i.e. :nsh only contains nsh nothing else, and standard set of built-ins`.
  • All tests must return PASS, FAIL, TIMEOUT, ERROR, SKIP, UNAVAILABLE results for every single test case plus detailed logs.
    • PASS - test results as expected.
    • FAIL - test result not as expected.
    • ERROR - test execution failed, for any reason, test result is unknown.
    • TIMEOUT - operation did not finish in available time limits.
    • UNAVAILABLE - test is unavailable due to hardware restrictions.
    • SKIP - test was not performed, but on a test list.
  • Tests should define ASSERT / EXPECT conditions, so tests that are designed to fail are possible too (i.e. invalid parameter).
  • Future: List of external and internal tests needs to be created for all boards, and boards/configuration specific tests. This can be implemented as selftest board configuration. Every board should at least provide mandatory base selftest, and optional selftest-extended, selftest-specific, selftest-custom, etc (see below). This is a song of future.
  • Future: We need a building blocks for base / extended / specific / custom test scenarios. Base tests will be mandatory and cover all boards (i.e. nsh + help + ostest). Extended may include benchmarks, stress tests, will be optional (may not be possible on small platforms) but may provide additional results like performance improvement or degradation. Specific tests will be optional too and would cover arch / board specific tests. There must be a way to implement Custom scenarios for closed testing of custom hardware etc.

Sub-issues

Sub-issues

0 of 5 Issues completed
Loading 5 sub-issues

Activity

  1. converted this from a draft issue on Jan 31, 2025
  2. added
    Type: Enhancement
    on Jan 31, 2025
  3. self-assigned this
    on Jan 31, 2025
  4. added and removed
    Type: Enhancement
    on Jan 31, 2025
  5. raiden00pl commented on Jan 31, 2025

    @raiden00pl
    Member

    @cederom hi, do we need this long label DRUNX Distrubutes.... ? Can we use here some standardized way of using labels? We have already Area: Qualification Tests, so maybe this will be enough? We don't want to have a mess in the labels, otherwise they don't fulfill their purpose :)

  6. cederom commented on Jan 31, 2025

    @cederom
    ContributorAuthor

    @raiden00pl: @cederom hi, do we need this long label DRUNX Distrubutes.... ? Can we use here some standardized way of using labels? We have already Area: Qualification Tests, so maybe this will be enough? We don't want to have a mess in the labels, otherwise they don't fulfill their purpose :)

    Allright, sorry, juest testing the projects :-) It displays well in other places. What do you propose? drunx: core, drunx: dashboard? Testing? Please update as you please you will choose the best one :-)

  7. fdcavalcanti commented on Jan 31, 2025

    @fdcavalcanti
    Contributor

    @cederom there are plenty of QEMU tests on Espressif side, all pytest based.
    If there is computing power available for running more QEMU tests, we could think of a way to integrate those tests to Nuttx.
    Had a brief talk about this with @lupyuen, so I'm tagging him here.

  8. cederom commented on Jan 31, 2025

    @cederom
    ContributorAuthor

    @fdcavalcanti: @cederom there are plenty of QEMU tests on Espressif side, all pytest based. If there is computing power available for running more QEMU tests, we could think of a way to integrate those tests to Nuttx. Had a brief talk about this with @lupyuen, so I'm tagging him here.

    Thank you @fdcavalcanti that would be great!!

    Ultimately DRUNX will work on home computers of interested users, @lupyuen already has working prototype that simply run the CI scripts that we run on GitHub. There is also Dashboard that sums up the builds from various places. Ultimately there will be as many computing powers as tehere are users testing :-)

    PyTest is a well standardized choice :-)

    Are those QEMU images available to fetch from some public repo or even build by hand?

    What platforms are supported?

    Do you have some sort of bootstrap for them?

    ESP QEMU tests would perfectly fit the build and runtime in a situation where no hardware is available or necessary.. maybe even GH CI if not too expensive to run :-)

    How much place would it take to place them in nuttx-apps/testing?

    I have created dedicated issue here: #15733 :-)

    Thank you!! :-)

  9. added
    Type: Enhancement
    on Jan 31, 2025
  10. fdcavalcanti commented on Jan 31, 2025

    @fdcavalcanti
    Contributor

    We use QEMU available for ESP32, ESP32S3 and ESP32C3. You can find them here.

    All tests are Pytest based, but heavily use the pytest-embeded plugin, more specifically the pytest-embedded-nuttx plugin (supports Nuttshell parsing, flashing, etc).

    Simple tests like building, booting and testing if nsh> is responsive exist. Which is enough to know if the build is at least working to this extent. This allows testing most defconfigs that do not require external hardware, WiFi and BLE.
    We also test bootloader combinations: reuse all defconfigs and apply MCUBoot instead of simple boot.

    However there are more complex tests that use some customized application similar to nuttx-apps. Most would be Espressif related since they target our boards and don't follow some rules (like directly calling GPIO instead of using gpio.h when testing motor driver, capture driver, etc). That's something to be analyzed internally first.

    I'm afraid the current NuttX CI image is not compatible. We use a Docker image that has the build system and all plugins required for the tests.

  11. cederom commented on Jan 31, 2025

    @cederom
    ContributorAuthor

    Thank you @fdcavalcanti :-) Lets move ESP QEMU discussion to dedicated thread #15733 :-)

  12. 31 remaining items

  13. lupyuen commented on Feb 25, 2025

    @lupyuen
    Member

    @simbit18 Wonder if you have any thoughts about this? One of us will have to implement this, it might get messy 🤔

  14. simbit18 commented on Feb 25, 2025

    @simbit18
    Contributor

    Remind everyone and me too :)

    The inviolable principles of NuttX
    All Users Matter

    All support must apply equally to all supported platforms. At present this includes Linux, Windows MSYS, Windows Cygwin, Windows Ubuntu, Windows native, macOS, Solaris, and FreeBSD. No tool/environment solutions will be considered that limit the usage of NuttX on any of the supported platforms.

    Inclusive rather than exclusive.

    Hobbyists are valued users of the OS including retro computing hobbyists and DIY “Maker” hobbyists.

    Supported toolchains: GCC, Clang, SDCC, ZiLOG ZDS-II (c89), IAR. Others?

    No changes to build system should limit use of NuttX by any user.

    Simplifying things for one user does not justify excluding another user.

    We should seek to expand the NuttX user base, not to limit it for reasons of preference or priority.

    We must resist the pull to make NuttX into a Linux-only, GCC-only, and ARM-only solution.

    https://nuttx.apache.org/docs/latest/introduction/inviolables.html#all-users-matter

    So the system should also be available for all supported platforms, which is not trivial.

    @lupyuen Unfortunately, I have no idea of a simple solution.

  15. lupyuen commented on Feb 25, 2025

    @lupyuen
    Member

    Thanks @simbit18! I'm keen to hear your thoughts about this revamped CI Flow:

    I think that we should start with nsh config for all boards if the nsh fails to build there is not need to proceed with the others

    Also I wonder: If you and I are not keen to maintain NuttX CI for the long term, who would be the right people to do this? Hmmm...

  16. tmedicci commented on Feb 25, 2025

    @tmedicci
    Contributor

    Thanks @simbit18! I'm keen to hear your thoughts about this revamped CI Flow:

    I think that we should start with nsh config for all boards if the nsh fails to build there is not need to proceed with the others

    Also I wonder: If you and I are not keen to maintain NuttX CI for the long term, who would be the right people to do this? Hmmm...

    I don't expect it to be a single-person-only job... NuttX is growing, we need to make our CI more efficient being able to test more platforms before something is merged upstream. I can help, but I'll need help too. This is the kind of task that should be on our roadmap for NuttX.

  17. cederom commented on Feb 25, 2025

    @cederom
    ContributorAuthor

    @jerpelea: I think that we should start with nsh config for all boards if the nsh fails to build there is not need to proceed with the others

    Yup, nsh config for sure needs a cleanup and standardization in terms of built-ins.. for now there are various other applications being part of :nsh config on some boards, for instance raspberrypi-pico:nsh has also ostest and getprime in that :nsh config :D

    Regarding dedicated configurations for tests we were tihnking about this with @lupyuen and it turns our right now it would be best and least invasive to adapt test scenarios to existing configurations and clean up those cinfigurqtions (i.e. mentioned above :nsh). Then when we have clean configurations and working test scripts we could add more new stuff. Otherwise we will add more unclean stuff on top of already unclean stuff :-P

    I will update assumptions on top now :-)

  18. lupyuen commented on Feb 25, 2025

    @lupyuen
    Member

    I think that we should start with nsh config for all boards if the nsh fails to build there is not need to proceed with the others

    Might be good to do some analysis on our Current GitHub Usage, something like this. So we have some idea how much GitHub Usage we will reduce.

  19. cederom commented on Feb 25, 2025

    @cederom
    ContributorAuthor

    @acassis suggested DRUNX is not a serious name. @lupyuen suggested DART (Dristributed Automated build and Runtime), and I think NXDART could be better than DRUNX? :-)

  20. simbit18 commented on Feb 25, 2025

    @simbit18
    Contributor

    Thanks @simbit18! I'm keen to hear your thoughts about this revamped CI Flow:

    I think that we should start with nsh config for all boards if the nsh fails to build there is not need to proceed with the others

    Also I wonder: If you and I are not keen to maintain NuttX CI for the long term, who would be the right people to do this? Hmmm...

    @lupyuen As a first check, it could be useful for boards with many configurations. As @cederom rightly observes, however, all configurations of nsh must be made standard. The important thing is that cleaning :nsh config does not increase the configurations!!!

  21. acassis commented on Feb 25, 2025

    @acassis
    Contributor

    @cederom yes NXDART is nice and probably is unique! (I found nx-dart, but not nxdart)

  22. cederom commented on Feb 25, 2025

    @cederom
    ContributorAuthor

    So we change codename to NXDART ? :-)

  23. raiden00pl commented on Feb 26, 2025

    @raiden00pl
    Member

    @simbit18 clearing nsh config from other options by itself won't increase the number of configs. But... it may reduce the CI coverage and if we want to keep the same CI coverage, we have to create new configs for that. So it's not that easy.
    As the first step it would be useful to standardize the names of configurations and decide what should be in them. The current solution where we create an infinite number of configurations to test even trivial things is not the best from CI point of view. But on the other hand it's good for users.

  24. fdcavalcanti commented on Feb 26, 2025

    @fdcavalcanti
    Contributor

    Testing NSH makes sense from a sanity test stand point. Building NSH should be treated as a smoke test: can't even build it, go back to development. Then, a next step is running the NSH build in QEMU and getting to the Nuttshell should be enough for a sanity test.

    For more board testing, one thing we can do is have a directory ./tests/boards/<arch>/<board>/configs/test_<whatever>. This would put the test defconfigs in a separate place. In fact, having a tests directory that duplicates the folder structure of the main project is common because it provides an easy view for unit tests, however I have not seen it in embedded.

  25. changed the title [-][DRUNX] Distributed Runtime and bUild for NuttX Test Environment[/-] [+][NXDART] NuttX Distributed Automation for Build and Runtime Testing.[/+] on Feb 28, 2025
  26. added this to the NXDART milestone on Feb 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Area: TestingType: Enhancement

Projects

Relationships

None yet

Development

No branches or pull requests

Issue actions