Files
threadx/.github/workflows/regression_test.yml
T
Akif EjazandFrédéric Desbiens 18abe103af Enabled the RISC-V regression suite in CI for QEMU targets (#717)
* Enable the RISC-V regression suite in CI

The riscv: job in regression_test.yml has been present but commented out
since the RISC-V CI infrastructure landed (scripts/install_riscv.sh,
scripts/build_tx_riscv.sh, scripts/test_tx_riscv.sh, and the CMake tree
under test/tx/cmake/riscv/). It has been gated on a note that read
're-enable when RISC-V CI is ready', with no other blocker recorded.

The suite is ready. A local run of scripts/build_tx_riscv.sh followed by
scripts/test_tx_riscv.sh against upstream/dev builds every RISC-V target
and passes every registered test across all ten build configurations:

  RV32 (five configs): 5 * 95 = 475 tests, 0 failures, 0 timeouts.
  RV64 (five configs): 5 * 96 = 480 tests, 0 failures, 0 timeouts.

The extra RV64 test is threadx_riscv_new_thread_fpu_state_test, which
lives beside test/tx/cmake/riscv/regression/CMakeLists.txt and is added
only when THREADX_ARCH is risc-v64 -- the RV32 stack builder still
leaves the mstatus slot of the frame unwritten. Every test runs on
qemu-system-riscv32 / qemu-system-riscv64 with -machine virt, and each
configuration completes in roughly thirteen to fifteen seconds.

The job is wired the same way the ThreadX, SMP and FreeRTOS suites are:
it calls .github/workflows/regression_template.yml with the RISC-V
install/build/test scripts and the RISC-V cmake_path, sets
result_affix: RISC-V so its check name and artifacts are named, and
carries skip_deploy: true because coverage publishing stays on the
Linux suites for now. skip_coverage: true is kept because the CMake
configurations under test/tx/cmake/riscv match the Linux suite's minus
the coverage instrumentation, so gcovr has nothing to read -- the same
reason the FreeRTOS lane sets it. The regression_test.yml triggers were
not touched, so the RISC-V suite now runs on push and pull_request to
master and dev alongside the other three suites.

* Said why the RISC-V suite collects no coverage, instead of implying a missing build configuration

The comment added with the job read "No coverage build configuration for the
RISC-V suite yet". Both halves of what followed are true -- the configurations
under test/tx/cmake/riscv are the Linux suite's minus the coverage one, and
gcovr has nothing to read -- but "yet" points the next reader at a fix that
would not work.

Coverage here is not one missing default_build_coverage entry. These tests are
bare-metal images run under QEMU with -bios none, and
test/tx/cmake/riscv/bsp/syscalls.c has _write to the UART, _exit through the
sifive_test device, and stubs for _close, _fstat, _isatty, _lseek, _read and
_sbrk -- but no _open. gcov emits a .gcda by opening a path, so instrumenting
these builds produces nothing regardless of how they are configured. Nor is
the template's TX_COVERAGE=OFF what holds coverage off: test/tx/cmake/riscv is
its own top-level project and never declares that option, so the value is
inert there.

Getting a figure out of this suite needs a transport off the target -- gcov's
dump routines over the UART the BSP already drives, or semihosting. Worth
stating plainly in a project that asks for 100% coverage, rather than leaving
a reader to discover it after adding a configuration that cannot help.

Comment only; the job's inputs are unchanged.

Assisted-by: Claude Code (Opus 5) <noreply@anthropic.com>

---------

Co-authored-by: Frédéric Desbiens <frederic.desbiens@eclipse-foundation.org>
2026-09-10 09:08:11 -04:00

159 lines
6.8 KiB
YAML

name: regression_test
# Runs the ThreadX, SMP and FreeRTOS-compatibility regression suites.
#
# dev is included as well as master, for the same reason ports_arch_check.yml
# names it: dev is the integration branch, so a check that runs only against
# master gates nothing that anybody opens. Until now these suites ran on no
# pull request that anybody actually raised, and the last dev run of any kind
# was a manual workflow_dispatch.
#
# That run, on 2026-08-18, failed two tests: threadx_timer_simple_test in the
# ThreadX suite and threadx_thread_priority_change in the SMP one. Both are
# fixed -- the first by running the suites one test at a time (#643), the
# second by #647 -- and both suites now pass all 1030 tests across all ten
# build configurations. The suites were never the problem; the trigger was.
on:
workflow_dispatch:
push:
branches: [ master, dev ]
pull_request:
branches: [ master, dev ]
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
tx:
permissions:
contents: read
issues: read
checks: write
pull-requests: write
pages: write
id-token: write
uses: ./.github/workflows/regression_template.yml
with:
build_script: ./scripts/build_tx.sh
test_script: ./scripts/test_tx.sh
cmake_path: ./test/tx/cmake
result_affix: ThreadX
skip_deploy: true
# 99 is the tightest floor available below this suite's figure. The
# merged report reads 4503/4503 lines -- 100.00% -- on the dev push run
# of #666, and two local runs of the same green tree came in at 100.00%
# and 99.98%: tx_thread_system_resume.c:529 is reached by timing rather
# than by construction and flaps between runs, and #666 could not reach
# it deliberately. So a floor of 100 is a check that fails on a race --
# probed against the pinned action, 4502/4503 fails a floor of 100 and
# clears one of 99 -- and the thresholds are integers, so there is
# nothing between the two. Ratchet this to 100 if 529 is ever covered
# by construction.
coverage_thresholds: '99 100'
smp:
permissions:
contents: read
issues: read
checks: write
pull-requests: write
pages: write
id-token: write
uses: ./.github/workflows/regression_template.yml
with:
build_script: ./scripts/build_smp.sh
test_script: ./scripts/test_smp.sh
cmake_path: ./test/smp/cmake
result_affix: SMP
skip_deploy: true
# Raised from 98 with the four tests that closed 53 of the 64 lines this
# comment used to list: the merged report goes from 5114/5178 -- 98.76% --
# to 5167/5178, 99.79%. A floor of 99 needs 5127, so there are 40 lines of
# headroom against a numerator measured flickering by two between runs.
#
# Still not 100, and not because the last eleven lines were skipped. Eight
# are tx_byte_pool_search.c's ownership delay loop, which needs another
# core to take the pool inside the window the search opens when it drops
# protection every twenty blocks; this port serialises all four cores on
# one pthread mutex and the thread that releases it wins the re-acquire
# every time -- measured over 180,003 windows, zero handovers. The other
# three are in tx_thread_smp_utilities.c: one is a range guard placed
# after the shift it is meant to guard, so reaching it needs undefined
# behaviour, and two are a priority-inheritance branch that needs the
# mutex owner genuinely executing on another core. See #677, which
# made these measurements and raised the floor.
coverage_thresholds: '99 100'
freertos:
permissions:
contents: read
issues: read
checks: write
pull-requests: write
pages: write
id-token: write
uses: ./.github/workflows/regression_template.yml
with:
build_script: ./scripts/build_freertos.sh
test_script: ./scripts/test_freertos.sh
cmake_path: ./test/freertos/cmake
result_affix: FreeRTOS
skip_deploy: true
# No coverage build configuration yet; the suite covers the creation
# paths of the layer rather than all of it.
skip_coverage: true
riscv:
permissions:
contents: read
issues: read
checks: write
pull-requests: write
pages: write
id-token: write
uses: ./.github/workflows/regression_template.yml
with:
install_script: ./scripts/install_riscv.sh
build_script: ./scripts/build_tx_riscv.sh
test_script: ./scripts/test_tx_riscv.sh
cmake_path: ./test/tx/cmake/riscv
result_affix: RISC-V
skip_deploy: true
# No coverage from this suite, and not for want of a build configuration.
# These tests are bare-metal images run under QEMU with -bios none, and
# test/tx/cmake/riscv/bsp/syscalls.c gives them _write to the UART, _exit
# through the sifive_test device, and stubs for _close, _fstat, _isatty,
# _lseek, _read and _sbrk -- but no _open. gcov emits a .gcda by opening
# a path, so instrumenting these builds would produce nothing to read.
#
# test/tx/cmake/riscv/CMakeLists.txt is its own top-level project and does
# not declare the TX_COVERAGE option that test/tx/cmake and test/smp/cmake
# do, so the OFF the template exports is inert here rather than the thing
# holding coverage off.
#
# Collecting it therefore needs a transport off the target -- gcov's dump
# routines over the UART the BSP already drives, or semihosting -- and not
# a default_build_coverage entry beside the other five configurations.
skip_coverage: true
deploy:
# Publishing the coverage report stays on master. Adding dev to this
# workflow's triggers was meant to run the suites on the branch the pull
# requests target, not to change what gets published -- and the first
# push to dev after that change failed here with 'Branch "dev" is not
# allowed to deploy to github-pages due to environment protection rules',
# while all three suites passed. The github-pages environment restricts
# deployments to master, so the job was rejected before it ran.
#
# Guarding here rather than relaxing the environment rule, because the
# rule is doing its job: it is a deliberate answer to the question of
# which branch the published report describes. Moving that answer to dev
# is a separate decision, and it needs the environment setting changed
# as well as this line removed.
if: github.ref == 'refs/heads/master'
permissions:
contents: read
issues: read
checks: write
pull-requests: write
pages: write
id-token: write
needs: [tx, smp]
uses: ./.github/workflows/regression_template.yml
with:
skip_test: true
deploy_list: "ThreadX SMP"