Repository navigation
Open
Feature
0 / 50 of 5 issues completed
Copy link
Description
- 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 (
nshandostest) and adapt tests scenarios. Board configs need cleanup and standardizatiion (i.e.:nshonly containsnshnothing else, and standard set of built-ins`. - All tests must return
PASS,FAIL,TIMEOUT,ERROR,SKIP,UNAVAILABLEresults 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/EXPECTconditions, 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
selftestboard configuration. Every board should at least provide mandatory baseselftest, and optionalselftest-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.
Reacted by Ludovic Vanasse and Lup Yuen Lee
Sub-issues
Collapse Sub-issuesSub-issues
Loading 5 sub-issues
Metadata
Metadata
Labels
Type
Projects
- StatusShow more project fieldsIn Progress
Activity
raiden00pl commentedon Jan 31, 2025
@cederom hi, do we need this long label
DRUNX Distrubutes....? Can we use here some standardized way of using labels? We have alreadyArea: 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 :)cederom commentedon Jan 31, 2025
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 :-)fdcavalcanti commentedon Jan 31, 2025
@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.
cederom commentedon Jan 31, 2025
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!! :-)
fdcavalcanti commentedon Jan 31, 2025
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-nuttxplugin (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.
cederom commentedon Jan 31, 2025
Thank you @fdcavalcanti :-) Lets move ESP QEMU discussion to dedicated thread #15733 :-)
31 remaining items
lupyuen commentedon Feb 25, 2025
@simbit18 Wonder if you have any thoughts about this? One of us will have to implement this, it might get messy 🤔
simbit18 commentedon Feb 25, 2025
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.
lupyuen commentedon Feb 25, 2025
Thanks @simbit18! I'm keen to hear your thoughts about this revamped CI Flow:
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...
tmedicci commentedon Feb 25, 2025
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.
cederom commentedon Feb 25, 2025
Yup,
nshconfig for sure needs a cleanup and standardization in terms of built-ins.. for now there are various other applications being part of:nshconfig on some boards, for instanceraspberrypi-pico:nshhas alsoostestandgetprimein that:nshconfig :DRegarding 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 :-PI will update assumptions on top now :-)
lupyuen commentedon Feb 25, 2025
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.
cederom commentedon Feb 25, 2025
@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? :-)
simbit18 commentedon Feb 25, 2025
@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!!!
acassis commentedon Feb 25, 2025
@cederom yes NXDART is nice and probably is unique! (I found nx-dart, but not nxdart)
cederom commentedon Feb 25, 2025
So we change codename to NXDART ? :-)
raiden00pl commentedon Feb 26, 2025
@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.
fdcavalcanti commentedon Feb 26, 2025
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 atestsdirectory 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.[-][DRUNX] Distributed Runtime and bUild for NuttX Test Environment[/-][+][NXDART] NuttX Distributed Automation for Build and Runtime Testing.[/+]