Skip to content

initial support for automated testing with NTFC#17728

Merged
acassis merged 5 commits intoapache:masterfrom
szafonimateusz-mi:ntfc_for_sim
Jan 4, 2026
Merged

initial support for automated testing with NTFC#17728
acassis merged 5 commits intoapache:masterfrom
szafonimateusz-mi:ntfc_for_sim

Conversation

@szafonimateusz-mi
Copy link
Contributor

@szafonimateusz-mi szafonimateusz-mi commented Dec 29, 2025

Summary

First step to solve #17717

This PR adds support for NTFC in CI and migrates sim/citest to use NTFC instead of tools/ci/testrun tool.
The rest of citest configs uses the old testing method.

635cb70 must be also ported to nuttx-apps.
EDIT: PR for nuttx-apps is here apache/nuttx-apps#3291 [DONE]

Impact

NTFC performs more tests so sim-01 will take longer but will provide better code coverage.
EDIT: With this change Linux sim-01 took 1h 13m 56s, before this change it took 58m 25s.

Testing

Tested in a private repository, let's see if it works with upstream.

Here is an example run test for sim/citest on my fork with all tests passed:
https://github.com/szafonimateusz-mi/nuttx/actions/runs/20580444513/job/59106747416#step:11:154

I will update this section when upstream CI is finished.

EDIT: successful run is here:
https://github.com/apache/nuttx/actions/runs/20582851657/job/59113926720?pr=17728#step:11:247

Test start:
image

Test end:
image

Linux sim-01 took 1h 13m 56s, before this change it took 58m 25s, so tests for this target take 15 minutes more (not bad):

image image

Summary from pytest before this PR:

================ 1058 passed, 10 skipped in 2735.05s (0:45:35) =================

Summary from pytest for this PR:

================ 1224 passed, 548 skipped in 3625.97s (1:00:25) ================

@szafonimateusz-mi
Copy link
Contributor Author

I have updated the description according to the CI results. Linux sim-01 took 1h 13m 56s, before this change it took 58m 25s, so tests take 15 minutes more. For comparison, the entire CI workflow took 3 hours.

Summary from pytest before this PR:

================ 1058 passed, 10 skipped in 2735.05s (0:45:35) =================

Summary from pytest for this PR:

================ 1224 passed, 548 skipped in 3625.97s (1:00:25) ================

Add support for NTFC testing framework.

At the moment NTFC is downloaded from a private repo,
and installed with pip and venv. In the future NTFC repositories
will be migrated to Apache organization.

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
export currently build configuration and path to artifacts
so these can be used by NTFC run script

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
migrate sim/citest to NTFC test cases

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
Executable files called "run" don't pass checkpath verification,
so we change the name to "run.sh"

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
@github-actions github-actions bot added the Area: Documentation Improvements or additions to documentation label Jan 2, 2026
@acassis
Copy link
Contributor

acassis commented Jan 2, 2026

What do you want documented? The NTFC documentation is in the NTFC repository https://github.com/szafonimateusz-mi/nuttx-ntfc/

Sorry, I missed that Running CI Tests with tools/ci/testrun section. So I think it is fine

acassis
acassis previously approved these changes Jan 2, 2026
@szafonimateusz-mi
Copy link
Contributor Author

@acassis No need to sorry, I updated this file after your comment :P I've also created a new top section in the docs: "Testing." Ultimately, CI's operation can be better described there.

@raiden00pl raiden00pl requested a review from acassis January 2, 2026 15:12
acassis
acassis previously approved these changes Jan 2, 2026
@hartmannathan
Copy link
Contributor

Hi all, as I said in my review comment, I hope the plan is to eventually move the framework and official test cases under the apache/nuttx repositories.

@simbit18
Copy link
Contributor

simbit18 commented Jan 2, 2026

Question:

Could this repository Apache NuttX Testing

be reused to contain both repositories NuttX Test Framework and NTFC test cases ?

@raiden00pl
Copy link
Member

@simbit18 we need 2 separate repositories. NTFC is not dependent on NTFC test cases in any way, the user can use their own test cases. In addition, NTFC is organized as a Python package and has different requirements regarding maintainence and CI.

@hartmannathan yes, it will be moved to Apache, we just need one more repository for nuttx-ntfc. Do we need INFRA to create a new repository or can we do it ourselves?

update citests.rst and move page from Guides to Testing

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
@hartmannathan
Copy link
Contributor

@simbit18 we need 2 separate repositories. NTFC is not dependent on NTFC test cases in any way, the user can use their own test cases. In addition, NTFC is organized as a Python package and has different requirements regarding maintainence and CI.

@hartmannathan yes, it will be moved to Apache, we just need one more repository for nuttx-ntfc. Do we need INFRA to create a new repository or can we do it ourselves?

@raiden00pl We can create repositories using INFRA's Self-Service tools, but I think that will create empty repositories. I think what we need in this case is to clone the repos; correct me if this isn't the case. I don't see a way to create a repo as a clone. We can ask INFRA to do it by opening a Jira ticket and telling them the URLs of the repos we want cloned... Thoughts?

@raiden00pl
Copy link
Member

raiden00pl commented Jan 3, 2026

@hartmannathan We can clone the repo with INFRA, but we can also do it differently: create an empty repository and add all changes in one pull request. Both options are OK for me, the question is which one is faster :)

@raiden00pl
Copy link
Member

Here's a PR for nuttx-testing adding test cases to repo: apache/nuttx-testing#102

@acassis acassis merged commit e1fb049 into apache:master Jan 4, 2026
41 checks passed
@hartmannathan
Copy link
Contributor

@hartmannathan We can clone the repo with INFRA, but we can also do it differently: create an empty repository and add all changes in one pull request. Both options are OK for me, the question is which one is faster :)

@raiden00pl I don't know, but let's try the way you suggested. Would you like to do the honors and setup the new repos? (If you'd like me to do it, I'll need to know what repository names you'd like...)

@szafonimateusz-mi szafonimateusz-mi deleted the ntfc_for_sim branch March 2, 2026 14:23
@lupyuen
Copy link
Member

lupyuen commented Mar 24, 2026

Sorry @szafonimateusz-mi would you be able to Retry the Failed Downloads for NTFC? According to the log below: When NTFC fails to download some dependencies, all the CI Jobs will fail. Which will waste GitHub Runners (1.5 hours elapsed time, 11 hours chargeable time) and frustrate our devs. Thanks :-)

FYI: We are now testing the Retry of CI Builds, with Random Exponential Backoff. Hopefully it will fix any Failed Downloads for ESP32 Runtime, LVGL, OpenAMP, Device Tree, etc:

Download Failure for NTFC: https://github.com/apache/nuttx/actions/runs/23468549943/job/68286177498#step:10:64

Err:10 http://security.ubuntu.com/ubuntu jammy-security/universe amd64 Packages
  File has unexpected size (1302502 != 1302485). Mirror sync in progress? [IP: 91.189.91.83 80]
E: Failed to fetch http://security.ubuntu.com/ubuntu/dists/jammy-security/universe/binary-amd64/Packages.gz  File has unexpected size (1302502 != 1302485). Mirror sync in progress? [IP: 91.189.91.83 80]
E: Failed to fetch http://security.ubuntu.com/ubuntu/dists/jammy-security/universe/binary-i386/Packages.gz  
E: Failed to fetch http://security.ubuntu.com/ubuntu/dists/jammy-security/main/binary-i386/Packages.gz  

Update: Found another NTFC Download Failure from #17573: https://github.com/apache/nuttx/actions/runs/20914875922/job/60086076606#step:10:206

Err:2 http://security.ubuntu.com/ubuntu jammy-security/universe amd64 python3.10-venv amd64 3.10.12-1~22.04.13
  404  Not Found [IP: 91.189.91.81 80]
E: Failed to fetch http://security.ubuntu.com/ubuntu/pool/universe/p/python3.10/python3.10-venv_3.10.12-1%7e22.04.13_amd64.deb  404  Not Found [IP: 91.189.91.81 80]

Another one from the same PR #17573: https://github.com/apache/nuttx/actions/runs/20777559190/job/59667205045#step:10:95

E: Failed to fetch http://security.ubuntu.com/ubuntu/dists/jammy-security/main/binary-amd64/Packages.gz  File has unexpected size (3633035 != 3633630). Mirror sync in progress? [IP: 91.189.91.81 80]
E: Failed to fetch http://security.ubuntu.com/ubuntu/dists/jammy-security/universe/binary-amd64/Packages.gz  
E: Failed to fetch http://security.ubuntu.com/ubuntu/dists/jammy-security/main/binary-i386/Packages.gz  

FYI @simbit18 :-)

@lupyuen
Copy link
Member

lupyuen commented Mar 25, 2026

I made a video to explain the NTFC Download Failure. We have some evidence that NTFC Download Failure contributed to the Overuse of GitHub Runners in Jan-Feb 2026. So I really hope our NTFC Maintainers can implement the Retry of NTFC Downloads soon. Thanks :-)

vlcsnap-2026-03-25-13h24m40s519

@raiden00pl
Copy link
Member

@lupyuen most of these downloads should disappear when I move the package to pip. For now all these downloads are required to install venv support (even system update). I'll eventually build NTFC into Docker image, it won't take up much space, then the only package to download will be NTFC test repo. I'm also wondering whether NTFC test repo should be integrated into Docker image, then NTFC won't need any download

@lupyuen
Copy link
Member

lupyuen commented Mar 25, 2026

@raiden00pl Cool thanks! Please inform @simbit18 and me when the migration is done, we will have to monitor for errors.

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

Labels

Area: CI Area: Documentation Improvements or additions to documentation Area: Tooling Board: arm Board: risc-v Board: simulator Size: M The size of the change in this PR is medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants