Skip to content

Initial prototype of test refactor#331

Open
padelsbach wants to merge 1 commit intowolfSSL:mainfrom
padelsbach:test-refactor-prototype
Open

Initial prototype of test refactor#331
padelsbach wants to merge 1 commit intowolfSSL:mainfrom
padelsbach:test-refactor-prototype

Conversation

@padelsbach
Copy link
Copy Markdown
Contributor

@padelsbach padelsbach commented Apr 8, 2026

Refactor top level test modules with the following:

  • New test runner
  • Unified connection logic (helper)
  • Cleaner integration of sequenced tests

See more in the README.md

@padelsbach padelsbach force-pushed the test-refactor-prototype branch 3 times, most recently from 6bd9195 to 1f06444 Compare April 8, 2026 17:17
@padelsbach padelsbach force-pushed the test-refactor-prototype branch 4 times, most recently from e3b29f6 to 5d9dc00 Compare April 22, 2026 16:50
@padelsbach padelsbach force-pushed the test-refactor-prototype branch 8 times, most recently from 5c4e0e2 to 4b6bfe6 Compare April 30, 2026 16:12
Copy link
Copy Markdown
Contributor

@bigbrett bigbrett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall,as discussed, looks great. A few things I wanted to point out and some architectural questions that should be addressed.

Also, can we get a code coverage comparison set up in CI so we can track the coverage metrics between existing test and new harness?

Comment thread test-refactor/wh_test_port.h Outdated
Comment thread test-refactor/wh_test_list.h
Comment thread test-refactor/wh_test_list.h
Comment thread test-refactor/wh_test_list.h
Comment thread test-refactor/wh_test_groups.c Outdated
Comment thread test-refactor/README.md Outdated
Comment thread test-refactor/README.md Outdated
Comment thread test-refactor/posix/wh_test_posix_main.c
Comment thread test-refactor/wh_test_port.h Outdated
Comment thread .github/workflows/build-and-test.yml Outdated
@bigbrett
Copy link
Copy Markdown
Contributor

@padelsbach oh and also, a section of the new README.md mapping old test constructs -> new test constructs would be valuable for people who need to understand the migration. Both discussing key differences at a high level, as well as mapping each individual test from its old location to its new location (this last part can be an AI table - prefer some human input for the first part)

@padelsbach padelsbach force-pushed the test-refactor-prototype branch 2 times, most recently from 770e6ab to 976fdca Compare May 1, 2026 21:05
@padelsbach padelsbach changed the title Initial prototype of test refactor w/ runner, helper and test layers Initial prototype of test refactor May 1, 2026
@padelsbach padelsbach assigned bigbrett and unassigned padelsbach May 1, 2026
bigbrett
bigbrett previously approved these changes May 4, 2026
Copy link
Copy Markdown
Contributor

@bigbrett bigbrett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great start on the framework. This is at like 90% for me but dont want to delay getting it in, since it wont break anything. Opening up to others for investigation and thoughts.

@bigbrett bigbrett assigned AlexLanzano, billphipps and rizlik and unassigned bigbrett May 4, 2026
@bigbrett bigbrett requested review from AlexLanzano and rizlik May 4, 2026 21:50
@bigbrett bigbrett requested a review from billphipps May 4, 2026 21:50
@bigbrett bigbrett marked this pull request as ready for review May 4, 2026 21:58
Copilot AI review requested due to automatic review settings May 4, 2026 21:58
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces an initial “test-refactor” prototype alongside the existing test/ suite, including a portable test registry + group runner, a POSIX threaded harness with shared client/server setup, and updated CI workflows for build/test and coverage (including tracefile merge support).

Changes:

  • Add a new portable test runner/registry (wh_test_list*, wh_test_groups*) with skip-stub support via weak symbols.
  • Add a POSIX test port that brings up a server thread + client thread with shared mem-transport buffers, plus initial migrated tests.
  • Update GitHub Actions coverage to run a matrix of builds emitting JSON tracefiles and merge them into an HTML report; add equivalent workflows for the refactor suite.

Reviewed changes

Copilot reviewed 25 out of 26 changed files in this pull request and generated 15 comments.

Show a summary per file
File Description
test/Makefile Adds a coverage-json target to emit gcovr JSON tracefiles for CI matrix merging.
test-refactor/wh_test_port.h Defines per-port reset hooks invoked between tests.
test-refactor/wh_test_list.h Declares the test registry types and the weak-stub mechanism for skipped tests.
test-refactor/wh_test_list.c Central registry of tests grouped into Misc/Server/Client arrays.
test-refactor/wh_test_groups.h Declares portable group entrypoints + summary/tally helpers.
test-refactor/wh_test_groups.c Implements group iteration, standardized result printing, and final summary.
test-refactor/server/wh_test_cert.c Adds a server-side cert-manager verification suite.
test-refactor/README.md Documents how to run/add ports/tests and migration mapping from test/.
test-refactor/posix/wh_test_posix_server.h POSIX server bring-up API for the refactor harness.
test-refactor/posix/wh_test_posix_server.c Implements POSIX server init/cleanup (flash/NVM/crypto/transport/server).
test-refactor/posix/wh_test_posix_main.c Threaded POSIX driver running Misc inline, then Server, then Client against live server loop.
test-refactor/posix/wh_test_posix_client.h POSIX client bring-up API for the refactor harness.
test-refactor/posix/wh_test_posix_client.c Implements POSIX client init/cleanup and CommInit handshake using shared mem transport.
test-refactor/posix/wh_test_nvm_flash.c POSIX-only NVM/flash unit tests (invoked as port-specific tests).
test-refactor/posix/wh_test_flash_ramsim.c POSIX-only RamSim flash tests (invoked as port-specific tests).
test-refactor/posix/Makefile Build/run/coverage targets for the POSIX refactor test port.
test-refactor/misc/wh_test_dma.c Adds DMA allow-list boundary/overflow unit tests (gated on WOLFHSM_CFG_DMA).
test-refactor/Makefile Top-level forwarder to run the POSIX refactor port via make check etc.
test-refactor/client-server/wh_test_wolfcrypt.c Runs the upstream wolfCrypt test suite through a live wolfHSM client (gated).
test-refactor/client-server/wh_test_server_info.c Client-side server-info query test.
test-refactor/client-server/wh_test_echo.c Client-side echo round-trip test.
test-refactor/client-server/wh_test_crypto.c Client-side SHA256/AES-CBC/ECC round-trips routed via WH_DEV_ID.
.gitignore Ignores test-suite.log output.
.github/workflows/code-coverage.yml Converts legacy coverage to matrix tracefiles + merge job producing a combined HTML report.
.github/workflows/code-coverage-refactor.yml Adds refactor coverage workflow mirroring the legacy matrix/merge model.
.github/workflows/build-and-test-refactor.yml Adds CI build-and-test coverage across multiple refactor build flag combinations.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread test-refactor/server/wh_test_cert.c
Comment thread test-refactor/server/wh_test_cert.c
Comment thread test-refactor/client-server/wh_test_crypto.c
Comment thread test-refactor/client-server/wh_test_crypto.c
Comment thread test-refactor/client-server/wh_test_crypto.c
Comment thread test-refactor/posix/wh_test_posix_server.c
Comment thread test-refactor/posix/wh_test_posix_main.c
Comment thread test-refactor/posix/wh_test_nvm_flash.c
Comment thread .github/workflows/code-coverage.yml Outdated
Comment thread .github/workflows/code-coverage-refactor.yml Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants