Skip to content

ci: Migrate CI test cases to NTFC #17717

Open

Description

@szafonimateusz-mi

NTFC is a new testing tool based on test cases for NuttX from Xiaomi that allows you to automate NuttX tests for various targets (sim, qemu, hw with serial port). All features of currently used in CI tool (tools/ci/testrun) are supported (and much more).

Here is a discussion on mailing list: https://lists.apache.org/thread/618konqxrl38oq7049njgks2y0x5mllq

At the moment, the repositories with NTFC and test cases are on my Github account:

They will eventually go to the Apache Foundation account if the proposal is accepted, but at the moment it's easier for me to develop the project in a private repo. Once NTFC is running stably on NuttX CI, I think it will be a good time to move the repositories to Apache.

Roadmap

Tasks that remain:

    1. Enabling more test cases for citest targets
      The tool automatically detects which tests can be run based on the provided ELF. We just have to enable the appropriate applications in defconfig.
    1. Add stable NTFC package to the Docker image.
    1. clean up after old CI tests engine (testrun)
    1. (SOMEDAY) Run test cases depending on GitHub labels. Running all tests in most cases makes no sense. With NTFC, we can ignore individual test modules and save CI resources.
    1. (SOMEDAY) Network tests on CI. We can set up a virtual network (ETH, CAN) in which several nuttx instances communicate with each other and NTFC runs tests.

    EDIT: more advanced tests are now located in https://github.com/railab/nuttx-testlab and are run as nightly tests outside of the ASF to save CI resources.

Activity

  1. raiden00pl commented on Feb 16, 2026

    @raiden00pl
    Member

    Apache repositories have been created and are here (thanks @cederom):

    I'll probably migrate repositories from my account to the new locations next month. There are a few more features I want to add, and it's easier to do for me when the repo is completely under my control :)

  2. added this to the NTFC milestone on Feb 24, 2026
  3. raiden00pl commented on Mar 2, 2026

    @raiden00pl
    Member

    adding NTFC for arm64 target is not a problem because the qemu-system-arm package is already installed in Docker image (it covers 32-bit and 64-bit arm in Debian).
    For x86-64 target it requires an additional qemu-system-x86 package that needs to be added to Docker image. It will take an additional ~40MB

  4. Brijesh-Thakkar commented on Oct 22, 2026

    @Brijesh-Thakkar
    Contributor

    Hi @raiden00pl @cederom, I’d like to help finish this. Looking at master (0dcbf44), it seems x86_64 citest (44e3504, 7609a72) and the testrun removal (179bf35) are already merged, so those two checklist items can be ticked.

    What still looks open:
    Installing ntfc in the Docker image (build.yml still pip-installs 0.0.3 on every run)
    Leftover testrun pins (pytest==6.2.5, pexpect==4.8.0, …) in the Dockerfile and tools/ci/platforms/*.sh, which conflict with ntfc’s own deps
    Enabling more test cases in citest configs
    I can send a PR for (2) now. For (1), would you prefer I take it, and should test cases stay cloned at runtime with only the tool in the image? Happy to take on (3) for a specific target too.

  5. raiden00pl commented on Oct 22, 2026

    @raiden00pl
    Member

    Let’s hold off on (1) for now; it should be the final step of this issue

  6. Brijesh-Thakkar commented on Oct 22, 2026

    @Brijesh-Thakkar
    Contributor

    Thanks I’ll keep the image install for last. I’ll send a PR for (2) that only removes the leftover testrun pins (no ntfc in the image), and then look at enabling more test cases for (3).
    Is there a target you’d like covered first, or should I start with rv-virt:citest64?

  7. Brijesh-Thakkar commented on Oct 22, 2026

    @Brijesh-Thakkar
    Contributor

    Opened #20882 for (2): it removes the leftover testrun pins (pexpect==4.8.0, pytest==6.2.5, pytest-json, pytest-ordering, pytest-repeat) from the CI Dockerfile and tools/ci/platforms/*.sh. The pytest==6.2.5 pin was already being upgraded to 9.1.1 by pip install ntfc at job time. sim:citest gives identical results with and without the pins (1221 passed / 0 failed / 306 skipped).

    One related finding, also noted in the PR: the pkill -f pytest watchdog in build.yml never matches the ntfc process, because ntfc runs pytest.main() in-process. It only matches the wrapper shell, so on timeout it kills the whole step. I can send a follow-up if you’d like that changed.

    I’ll look at (3), enabling more test cases, next. Is there a target you’d like covered first?

  8. 6 remaining items

  9. Brijesh-Thakkar commented on Oct 25, 2026

    @Brijesh-Thakkar
    Contributor

    Oh, okkk
    will keep this in mind and wont add more ci
    Thanks @raiden00pl

  10. Brijesh-Thakkar commented on Oct 30, 2026

    @Brijesh-Thakkar
    Contributor

    Opened apache/nuttx-apps#3943: it syncs the NTFC setup with nuttx (ntfc 0.0.3, fail-fast install, watchdog removed), following #20958. Understood on not adding more tests to CI. While trialling LTP on rv64 I hit a couple of rv64-only bugs (e.g. mq_send() succeeding on an O_RDONLY queue), which I’ll report as separate issues.

  11. changed the title [-][FEATURE] Migrate CI test cases to NTFC[/-] [+]ci: Migrate CI test cases to NTFC[/+] on Oct 30, 2026
  12. Brijesh-Thakkar commented on Nov 2, 2026

    @Brijesh-Thakkar
    Contributor

    Status update:
    testrun cleanup is done: pins removed (#20882), watchdog replaced by NTFC’s session timeout (#20958), stale citest64 run.sh lines (#21155), and nuttx-apps synced to ntfc 0.0.3 (apache/nuttx-apps#3943). I didn’t find any remaining references to the old harness in either repo.
    “Enable more test cases” is on hold, as you said, because of CI load.
    That leaves “add stable NTFC package to the Docker image”. @raiden00pl is it time for that now, or are you waiting for another NTFC release first? I can prepare it, keeping the test cases cloned at runtime and putting only the ntfc package in the image.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Type: Enhancement

Type

No type

Projects

Relationships

None yet

Development

No branches or pull requests

Issue actions