test: optionally run functional tests via CTest #35762

Open
willcl-ark wants to merge 6 commits from ctest-functional-v6 into master AGit
willcl-ark commented 2026-07-21 11:04:45 +00:00 (Migrated from github.com)

Expose individual functional tests through the same CTest interface used for unit tests, making them easier to select, inspect, and rerun from the command line or CTest-aware IDEs.

Scheduling unit and functional tests together may improve parallel execution. It also enables per-test results and timings to be uploaded to our Bitcoin Core CDash instance, helping track failures and runtime changes across builds.

Registration is opt-in with BUILD_FUNCTIONAL_TESTS=ON and requires CMake 4.4 or newer. The existing runner remains available for RPC coverage and CSV results. The native macOS CI job exercises the combined CTest workflow and passes. See test/README.md for usage and limitations.

Expose individual functional tests through the same CTest interface used for unit tests, making them easier to select, inspect, and rerun from the command line or CTest-aware IDEs. Scheduling unit and functional tests together may improve parallel execution. It also enables per-test results and timings to be uploaded to our [Bitcoin Core CDash instance](https://my.cdash.org/index.php?project=bitcoin-core), helping track failures and runtime changes across builds. Registration is opt-in with `BUILD_FUNCTIONAL_TESTS=ON` and requires CMake 4.4 or newer. The existing runner remains available for RPC coverage and CSV results. The native macOS CI job exercises the combined CTest workflow and passes. See `test/README.md` for usage and limitations.
DrahtBot commented 2026-07-21 11:04:53 +00:00 (Migrated from github.com)

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

External sites

Reviews

See the guideline and AI policy for information on the review process.

Type Reviewers
ACK BrandonOdiwuor

If your review is incorrectly listed, please copy-paste <!--meta-tag:bot-skip--> into the comment that the bot should ignore.

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #35395 (doc: Improve test suite dependencies documentation by hebasto)

If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

<!--e57a25ab6845829454e8d69fc972939a--> The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. <!--006a51241073e994b41acfe9ec718e94--> ### External sites * Code coverage & benchmarks: https://corecheck.dev/bitcoin/bitcoin/pulls/35762 * Ralph review <img src=https://review.fish.foo/assets/bitcoin/bitcoin/35762.png alt="Ralph review status"> https://git.fish.foo/bitcoin/bitcoin/pulls/35762#author-ralph <!--021abf342d371248e50ceaed478a90ca--> ### Reviews See [the guideline](https://github.com/bitcoin/bitcoin/blob/master/CONTRIBUTING.md#code-review) and [AI policy](https://github.com/bitcoin/bitcoin/blob/master/doc/AI_POLICY.md) for information on the review process. | Type | Reviewers | | ---- | --------- | | ACK | [BrandonOdiwuor](https://github.com/bitcoin/bitcoin/pull/35762#pullrequestreview-5641220472) | If your review is incorrectly listed, please copy-paste <code>&lt;!--meta-tag:bot-skip--&gt;</code> into the comment that the bot should ignore. <!--174a7506f384e20aa4161008e828411d--> ### Conflicts Reviewers, this pull request conflicts with the following ones: * [#35395](https://github.com/bitcoin/bitcoin/pull/35395) <sub><img src="https://drahtbot.space/ack_count/bitcoin/bitcoin/35395.svg"></sub> (doc: Improve test suite dependencies documentation by hebasto) If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. <!--5faf32d7da4f0f540f40219e4f7537a3-->
willcl-ark commented 2026-07-21 12:43:40 +00:00 (Migrated from github.com)
The `MacOS native` CI job shows ctest orchestrating the unit and functional tests altogether: https://github.com/bitcoin/bitcoin/actions/runs/29824697919/job/88615235560?pr=35762#step:9:3919
maflcko (Migrated from github.com) reviewed 2026-07-22 13:20:20 +00:00
maflcko (Migrated from github.com) commented 2026-07-21 14:54:58 +00:00

d2b4bd40f23067cad97ba6553fe0832d57424c26: Unrelated change?

d2b4bd40f23067cad97ba6553fe0832d57424c26: Unrelated change?
maflcko (Migrated from github.com) commented 2026-07-21 14:55:38 +00:00

d2b4bd40f23067cad97ba6553fe0832d57424c26: Why not follow the docs and call the test_runner from the build dir, which avoids having to pass the new option?

d2b4bd40f23067cad97ba6553fe0832d57424c26: Why not follow the docs and call the test_runner from the build dir, which avoids having to pass the new option?
maflcko (Migrated from github.com) commented 2026-07-21 14:57:52 +00:00

a9e0c71ca4dee40abce66aad0bbb27682ccdcd7f: Could drop this, or add least add a short rationale for stuff like this?

a9e0c71ca4dee40abce66aad0bbb27682ccdcd7f: Could drop this, or add least add a short rationale for stuff like this?
willcl-ark (Migrated from github.com) reviewed 2026-07-23 21:16:55 +00:00
willcl-ark (Migrated from github.com) commented 2026-07-23 21:16:55 +00:00

Not quite, although it was incorrect (thanks!)

(somethign like this) is needed because native/upstream discover_tests() preserves the empty \5 replacement for tests without an optional argument. Without filtering it, --ctest-direct sees the script plus an empty second “test” and rejects the invocation.

The explicit -- separator is needed separately because argparse allows option abbreviation by default: CTest’s child option --tmpdir (tdestined for test_framework.py) can otherwise be consumed as the runner’s --tmpdirprefix option instead of being forwarded. The arg != "--" filter removes that separator before invoking the child test.

(in fact, I think this is a seperate bug and we could disable argparse allow_abbrev to fix it properly. Or perhaps makes better sense to fix that first, before these changes...)

Not quite, although it was incorrect (thanks!) (somethign like this) is needed because native/upstream `discover_tests()` preserves the empty `\5` replacement for tests without an optional argument. Without filtering it, `--ctest-direct` sees the script plus an empty second “test” and rejects the invocation. The explicit `--` separator is needed separately because `argparse` allows option abbreviation by default: CTest’s child option `--tmpdir` (tdestined for test_framework.py) can otherwise be consumed as the runner’s `--tmpdirprefix` option instead of being forwarded. The `arg != "--"` filter removes that separator before invoking the child test. (in fact, I think this is a seperate bug and we could disable argparse [allow_abbrev](https://docs.python.org/3/library/argparse.html#allow-abbrev) to fix it properly. Or perhaps makes better sense to fix that first, before these changes...)
willcl-ark (Migrated from github.com) reviewed 2026-07-23 21:21:07 +00:00
willcl-ark (Migrated from github.com) commented 2026-07-23 21:21:07 +00:00

Addressed in latest push by invoking the generated build/test/functional/test_runner.py link/copy. The runner can therefore continue locating test/config.ini relative to itself, without adding a runner-level --configfile option.

Nice, thanks. I didn't think of it because I always run everythign from the source directory, for no good reason.

Addressed in latest push by invoking the generated `build/test/functional/test_runner.py` link/copy. The runner can therefore continue locating `test/config.ini` relative to itself, without adding a runner-level `--configfile` option. Nice, thanks. I didn't think of it because I always run everythign from the source directory, for no good reason.
willcl-ark (Migrated from github.com) reviewed 2026-07-23 21:27:10 +00:00
willcl-ark (Migrated from github.com) commented 2026-07-23 21:27:10 +00:00

added a short comment documenting the source-tree resolution (and dropped PYTHON_GIL=1 which is set by test/CMakeLists.txt on each test already.

added a short comment documenting the source-tree resolution (and dropped `PYTHON_GIL=1` which is set by _test/CMakeLists.txt_ on each test already.
DrahtBot commented 2026-07-30 09:04:16 +00:00 (Migrated from github.com)

🚧 At least one of the CI tasks failed.
Task riscv32 bare metal, static libbitcoin_consensus: https://github.com/bitcoin/bitcoin/actions/runs/30046119080/job/90826618769
LLM reason (✨ experimental): CI failed because submodule cloning of newlib-cygwin.git from sourceware.org was rate-limited (HTTP 429), causing the base install step to exit with code 2.

Hints

Try to run the tests locally, according to the documentation. However, a CI failure may still
happen due to a number of reasons, for example:

  • Possibly due to a silent merge conflict (the changes in this pull request being
    incompatible with the current code in the target branch). If so, make sure to rebase on the latest
    commit of the target branch.

  • A sanitizer issue, which can only be found by compiling with the sanitizer and running the
    affected test.

  • An intermittent issue.

Leave a comment here, if you need help tracking down a confusing failure.

<!--85328a0da195eb286784d51f73fa0af9--> 🚧 At least one of the CI tasks failed. <sub>Task `riscv32 bare metal, static libbitcoin_consensus`: https://github.com/bitcoin/bitcoin/actions/runs/30046119080/job/90826618769</sub> <sub>LLM reason (✨ experimental): CI failed because submodule cloning of `newlib-cygwin.git` from `sourceware.org` was rate-limited (HTTP 429), causing the base install step to exit with code 2.</sub> <details><summary>Hints</summary> Try to run the tests locally, according to the documentation. However, a CI failure may still happen due to a number of reasons, for example: * Possibly due to a silent merge conflict (the changes in this pull request being incompatible with the current code in the target branch). If so, make sure to rebase on the latest commit of the target branch. * A sanitizer issue, which can only be found by compiling with the sanitizer and running the affected test. * An intermittent issue. Leave a comment here, if you need help tracking down a confusing failure. </details>
maflcko (Migrated from github.com) reviewed 2026-07-30 19:44:22 +00:00
maflcko (Migrated from github.com) commented 2026-07-30 19:44:22 +00:00

not sure about exposing this in CI. This will silently ignore TEST_RUNNER_EXTRA, and having two ways to achieve the same seems confusing anyway.

However, not exposing it in CI will also make it less useful ...

not sure about exposing this in CI. This will silently ignore `TEST_RUNNER_EXTRA`, and having two ways to achieve the same seems confusing anyway. However, not exposing it in CI will also make it less useful ...
willcl-ark (Migrated from github.com) reviewed 2026-08-04 11:39:55 +00:00
willcl-ark (Migrated from github.com) commented 2026-08-04 11:39:55 +00:00

Thank you for taking a look, and fair point!

I don't consider these strict duplicates: CTEST_TESTS is a coarse CTest label selection: all, functional, or nonfunctional whereas TEST_RUNNER_EXTRA contains runner-specific behavior and test arguments.

However they do certainly overlap, and I think (for now) I will amend the commit to fail if TEST_RUNNER_EXTRA is non-empty in CTEST mode as a check on silently doing something else than the tests might have indented.

Longer-term, say we switch all tests over to ctest, I would see us dropping RUN_FUNCTIONAL_TESTS_WITH_CTEST (it would be default/on for all and unneeded), probably alos remove CTEST_TESTS and instead have each job just construct its own ctest command directly, and maybe even remove TEST_RUNNER_EXTRA (depening on whether we can get all supported options ported to ctest).

Thank you for taking a look, and fair point! I don't consider these strict duplicates: `CTEST_TESTS` is a coarse CTest label selection: all, functional, or nonfunctional whereas `TEST_RUNNER_EXTRA` contains runner-specific behavior and test arguments. However they do certainly overlap, and I think (for now) I will amend the commit to fail if `TEST_RUNNER_EXTRA` is non-empty in `CTEST` mode as a check on silently doing something else than the tests might have indented. Longer-term, say we switch all tests over to ctest, I would see us dropping `RUN_FUNCTIONAL_TESTS_WITH_CTEST` (it would be default/on for all and unneeded), probably alos remove `CTEST_TESTS` and instead have each job just construct its own ctest command directly, and maybe even remove `TEST_RUNNER_EXTRA` (depening on whether we can get all supported options ported to ctest).
maflcko (Migrated from github.com) reviewed 2026-08-04 14:31:56 +00:00
maflcko (Migrated from github.com) commented 2026-08-04 14:31:56 +00:00

Why would porting be hard? The leftover from "${TEST_RUNNER_EXTRA[@]}" would just end up in passon_args and be exported to the test list, no?

This pull is adding 500 LOC of logic complexity, so my preference would be to at least keep the overhead low.

Recall the alternative to this would be to write it in a few trivial lines of Python (https://github.com/bitcoin/bitcoin/issues/32770#issuecomment-3714857697)

Why would porting be hard? The leftover from "${TEST_RUNNER_EXTRA[@]}" would just end up in `passon_args` and be exported to the test list, no? This pull is adding 500 LOC of logic complexity, so my preference would be to at least keep the overhead low. Recall the alternative to this would be to write it in a few trivial lines of Python (https://github.com/bitcoin/bitcoin/issues/32770#issuecomment-3714857697)
maflcko (Migrated from github.com) reviewed 2026-08-04 14:37:13 +00:00
maflcko (Migrated from github.com) commented 2026-08-04 14:37:13 +00:00

Also, recall that Python would work when testing win64-cross builds, but CTest does not.

Also, recall that Python would work when testing win64-cross builds, but CTest does not.
maflcko (Migrated from github.com) reviewed 2026-08-17 06:51:03 +00:00
maflcko (Migrated from github.com) commented 2026-08-17 06:51:03 +00:00

unrelated nit: You may want to rebase this on top of https://github.com/bitcoin/bitcoin/pull/35846, for better error (message) handling

unrelated nit: You may want to rebase this on top of https://github.com/bitcoin/bitcoin/pull/35846, for better error (message) handling
First-time contributor

Base: a773e1e33b349dc819b5a0edc1c7a4839dc73b48
Head: f5741987366395a11dd57c518bf4098251d8b805

Findings

Minor

CTest discovery can fail when the benchmark executable has not been built (test/functional/test_runner.py:608, head)

When BUILD_BENCH is enabled, benchmark expansion runs before the --dump-ctest branch and invokes bench_bitcoin -list. If benchmarks are configured but bench_bitcoin has not been built, subprocess.check_output raises FileNotFoundError, preventing CTest from loading the functional test inventory. Skip or defer benchmark expansion when the executable is unavailable. No checked-in CI invocation was found that runs CTest after a partial benchmark build; the failure is established for user or IDE workflows that load CTest before building bench_bitcoin.

Design and approach

A single clean-chain CTest selection still builds an unused shared cache (test/functional/CMakeLists.txt:19, head)

FIXTURES_REQUIRED applies to every discovered case, so selecting only functional.rpc_bind.ipv6 still runs the cache-removal and cache-creation fixture. That test sets setup_clean_chain=True and initializes an empty chain instead of copying the shared cache, so building the 199-block cache is unnecessary. The legacy runner creates that cache only when running multiple tests in parallel. Require the fixture only for selected cases that use the shared cache, while preserving it for cache-dependent and parallel runs.

Review coverage was incomplete.

Review limitations
  • verifier: The concept candidate’s linked current-PR discussion and external CI run were not independently verified; the concept disposition relies on the supplied description and checked-out code, not those historical claims.
  • verifier: Finding withheld: Source evidence does not match the snapshot

Full review report

<!-- forgejo-review-bot:bitcoin/bitcoin --> <!-- ralph-engine:current:1e40d4c29146a38cb238a037edaa35c22b13996a5383ed7a85e089a15d569009:c9412d948811529792d161d97aa6951829440e3d548b7c576bb8d4df4183e0d0 --> Base: `a773e1e33b349dc819b5a0edc1c7a4839dc73b48` Head: `f5741987366395a11dd57c518bf4098251d8b805` ##### Findings **Minor** **CTest discovery can fail when the benchmark executable has not been built** (test/functional/test_runner.py:608, head) When `BUILD_BENCH` is enabled, benchmark expansion runs before the `--dump-ctest` branch and invokes `bench_bitcoin -list`. If benchmarks are configured but `bench_bitcoin` has not been built, `subprocess.check_output` raises `FileNotFoundError`, preventing CTest from loading the functional test inventory. Skip or defer benchmark expansion when the executable is unavailable. No checked-in CI invocation was found that runs CTest after a partial benchmark build; the failure is established for user or IDE workflows that load CTest before building `bench_bitcoin`. ##### Design and approach **A single clean-chain CTest selection still builds an unused shared cache** (test/functional/CMakeLists.txt:19, head) `FIXTURES_REQUIRED` applies to every discovered case, so selecting only `functional.rpc_bind.ipv6` still runs the cache-removal and cache-creation fixture. That test sets `setup_clean_chain=True` and initializes an empty chain instead of copying the shared cache, so building the 199-block cache is unnecessary. The legacy runner creates that cache only when running multiple tests in parallel. Require the fixture only for selected cases that use the shared cache, while preserving it for cache-dependent and parallel runs. Review coverage was incomplete. <details> <summary>Review limitations</summary> - verifier: The concept candidate’s linked current-PR discussion and external CI run were not independently verified; the concept disposition relies on the supplied description and checked-out code, not those historical claims. - verifier: Finding withheld: Source evidence does not match the snapshot </details> [Full review report](<https://review.fish.foo/traces/35762-f5741987366395a11dd57c518bf4098251d8b805-1313-6.html>)
DrahtBot commented 2026-10-06 13:37:11 +00:00 (Migrated from github.com)

🐙 This pull request conflicts with the target branch and needs rebase.

<!--cf906140f33d8803c4a75a2196329ecb--> 🐙 This pull request conflicts with the target branch and [needs rebase](https://github.com/bitcoin/bitcoin/blob/master/CONTRIBUTING.md#rebasing-changes).
maflcko (Migrated from github.com) reviewed 2026-10-06 14:10:11 +00:00
maflcko (Migrated from github.com) commented 2026-10-06 14:10:11 +00:00

Are you still working on this?

Are you still working on this?
willcl-ark (Migrated from github.com) reviewed 2026-10-06 16:02:43 +00:00
willcl-ark (Migrated from github.com) commented 2026-10-06 16:02:43 +00:00

Yes, thanks. Will update shortly.

Yes, thanks. Will update shortly.
DrahtBot commented 2026-10-07 08:28:15 +00:00 (Migrated from github.com)

🚧 At least one of the CI tasks failed.
Task macOS native: https://github.com/bitcoin/bitcoin/actions/runs/37589945926/job/112688773432
LLM reason (✨ experimental): CI failed because parallel benchmark tests collided on the same temporary directory, causing bench_PrevectorDeserializeTrivial to fail with FileExistsError.

Hints

Try to run the tests locally, according to the documentation. However, a CI failure may still
happen due to a number of reasons, for example:

  • Possibly due to a silent merge conflict (the changes in this pull request being
    incompatible with the current code in the target branch). If so, make sure to rebase on the latest
    commit of the target branch.

  • A sanitizer issue, which can only be found by compiling with the sanitizer and running the
    affected test.

  • An intermittent issue.

Leave a comment here, if you need help tracking down a confusing failure.

<!--85328a0da195eb286784d51f73fa0af9--> 🚧 At least one of the CI tasks failed. <sub>Task `macOS native`: https://github.com/bitcoin/bitcoin/actions/runs/37589945926/job/112688773432</sub> <sub>LLM reason (✨ experimental): CI failed because parallel benchmark tests collided on the same temporary directory, causing `bench_PrevectorDeserializeTrivial` to fail with `FileExistsError`.</sub> <details><summary>Hints</summary> Try to run the tests locally, according to the documentation. However, a CI failure may still happen due to a number of reasons, for example: * Possibly due to a silent merge conflict (the changes in this pull request being incompatible with the current code in the target branch). If so, make sure to rebase on the latest commit of the target branch. * A sanitizer issue, which can only be found by compiling with the sanitizer and running the affected test. * An intermittent issue. Leave a comment here, if you need help tracking down a confusing failure. </details>
willcl-ark (Migrated from github.com) reviewed 2026-10-07 11:16:58 +00:00
willcl-ark (Migrated from github.com) commented 2026-10-07 11:16:58 +00:00

rebased on master

rebased on master
willcl-ark (Migrated from github.com) reviewed 2026-10-07 11:18:07 +00:00
willcl-ark (Migrated from github.com) commented 2026-10-07 11:18:07 +00:00

This pull is adding 500 LOC of logic complexity, so my preference would be to at least keep the overhead low.

Agreed this change was getting too large. About half was supporting this new feature on old cmake versions, so I dropped that. It now just requires cmake >= 4.4 to use.

Also dropped the duplicate selector.

> This pull is adding 500 LOC of logic complexity, so my preference would be to at least keep the overhead low. Agreed this change was getting too large. About half was supporting this new feature on old cmake versions, so I dropped that. It now just requires cmake >= 4.4 to use. Also dropped the duplicate selector.
willcl-ark (Migrated from github.com) reviewed 2026-10-07 11:18:58 +00:00
willcl-ark (Migrated from github.com) commented 2026-10-07 11:18:58 +00:00

CTest now invokes the generated build/test/functional/test_runner.py, which locates config.ini relative to itself. The added runner-level --configfile option is gone.

CTest now invokes the generated build/test/functional/test_runner.py, which locates config.ini relative to itself. The added runner-level --configfile option is gone.
willcl-ark (Migrated from github.com) reviewed 2026-10-07 11:19:14 +00:00
willcl-ark (Migrated from github.com) commented 2026-10-07 11:19:14 +00:00

now removed.

now removed.
willcl-ark commented 2026-10-07 11:21:14 +00:00 (Migrated from github.com)

PR description updated with the new, more limited, scope.

Windows cross remains a limitation for now. It can be made to work without too much tinkering, but I don't think that's needed in this pull.

I also considered a commit to have the macos_native ci job (using ctest) actually push results to cdash, but I think that can also come in a separate followup pull.

PR description updated with the new, more limited, scope. Windows cross remains a limitation for now. It can be made to work without too much tinkering, but I don't think that's needed in this pull. I also considered a commit to have the macos_native ci job (using ctest) actually push results to cdash, but I think that can also come in a separate followup pull.
DrahtBot commented 2026-10-22 15:57:08 +00:00 (Migrated from github.com)

🐙 This pull request conflicts with the target branch and needs rebase.

<!--cf906140f33d8803c4a75a2196329ecb--> 🐙 This pull request conflicts with the target branch and [needs rebase](https://github.com/bitcoin/bitcoin/blob/master/CONTRIBUTING.md#rebasing-changes).
BrandonOdiwuor (Migrated from github.com) reviewed 2026-10-25 02:45:23 +00:00
BrandonOdiwuor (Migrated from github.com) left a comment

Tested ACK f574198736

An opt-in way to run the functional tests through CTest is valuable for developers integrating Bitcoin Core into CMake/CTest/CDash workflows, and for anyone who wants finer-grained control (filtering, parallel scheduling, fixtures, dashboard reporting) while replacing the existing test_runner.py unchanged.

Tested on Ubuntu 24.04 with CMake 4.4.2.

Build and discovery

  • Clean configure/build with -DBUILD_FUNCTIONAL_TESTS=ON.
  • Discovery: 307 base functional tests registered; 311 with TEST_RUNNER_EXTRA='--extended'.
  • Label and regex filtering (-L, -LE, -R) work as expected.

Build and discovery logs:

build-and-discovery.txt

Execution

  • Individual tests and small mixed sets run successfully under CTest.
  • Full wallet suite (76 tests) passed under -j4, with the expected skips for tests that require previous-release binaries.
  • Parallel scheduling, UUID-suffixed temporary directories, and PYTHON_GIL=1 work as intended.
  • Legacy test_runner.py path remains unaffected.
  • --rerun-failed correctly re-runs only previously failed tests and respects the fixture setup.

Execution logs:

ctest logs.txt

Cache fixture behavior

  • Fixture order is correct: functional.cache_remove_before → functional.create_cache → real tests → functional.cache_remove_after.
  • Cache directory is created under the build tree and cleaned up afterward.
  • Consecutive runs both succeed (cache is recreated each time).
  • Manual deletion of the cache mid-suite (after tests had already started) did not break the in-progress tests. The subsequent run recovered cleanly.

Cache logs;

cache-fixture-runs.txt

CDash submission

Submitted functional test runs to a local CDash instance (Experimental track) via a dashboard script. Results appear correctly with the functional label.

Image

Notes

  • The CMake ≥ 4.4 requirement is correctly enforced (needed for discover_tests()).
  • Extended tests are properly gated behind TEST_RUNNER_EXTRA='--extended' at discovery time.
  • Skip semantics (exit 77) are handled correctly by CTest.
Tested ACK f5741987366395a11dd57c518bf4098251d8b805 An opt-in way to run the functional tests through CTest is valuable for developers integrating Bitcoin Core into CMake/CTest/CDash workflows, and for anyone who wants finer-grained control (filtering, parallel scheduling, fixtures, dashboard reporting) while replacing the existing `test_runner.py` unchanged. Tested on Ubuntu 24.04 with CMake 4.4.2. ### Build and discovery - Clean configure/build with -DBUILD_FUNCTIONAL_TESTS=ON. - Discovery: 307 base functional tests registered; 311 with TEST_RUNNER_EXTRA='--extended'. - Label and regex filtering (-L, -LE, -R) work as expected. Build and discovery logs: [build-and-discovery.txt](https://github.com/user-attachments/files/33917679/build-and-discovery.txt) ### Execution - Individual tests and small mixed sets run successfully under CTest. - Full wallet suite (76 tests) passed under -j4, with the expected skips for tests that require previous-release binaries. - Parallel scheduling, UUID-suffixed temporary directories, and PYTHON_GIL=1 work as intended. - Legacy test_runner.py path remains unaffected. - --rerun-failed correctly re-runs only previously failed tests and respects the fixture setup. Execution logs: [ctest logs.txt](https://github.com/user-attachments/files/33917685/ctest.logs.txt) </details> ### Cache fixture behavior - Fixture order is correct: functional.cache_remove_before → functional.create_cache → real tests → functional.cache_remove_after. - Cache directory is created under the build tree and cleaned up afterward. - Consecutive runs both succeed (cache is recreated each time). - Manual deletion of the cache mid-suite (after tests had already started) did not break the in-progress tests. The subsequent run recovered cleanly. Cache logs; [cache-fixture-runs.txt](https://github.com/user-attachments/files/33917697/cache-fixture-runs.txt) ### CDash submission Submitted functional test runs to a local CDash instance (Experimental track) via a dashboard script. Results appear correctly with the functional label. <img width="1912" height="386" alt="Image" src="https://git.fish.foo/attachments/1ea3bf8e-cc8b-432a-999e-b836e8ec38c7" /> - Fixtures and individual tests are reported as expected. - Expected skips surface as Not Run; failures are reported correctly. - Remote submission: https://my.cdash.org/builds/4365061 ### Notes - The CMake ≥ 4.4 requirement is correctly enforced (needed for discover_tests()). - Extended tests are properly gated behind TEST_RUNNER_EXTRA='--extended' at discovery time. - Skip semantics (exit 77) are handled correctly by CTest.
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
bitcoin/bitcoin!35762
No description provided.