Development/covering missed tags & removing mock shell dependency#284
Development/covering missed tags & removing mock shell dependency#284smanes0213 wants to merge 33 commits into
Conversation
…pective implementation files
There was a problem hiding this comment.
Pull request overview
This PR expands the FunctionalTests suite to cover additional ProxyStub/JsonGenerator annotations (“missed tags”) by introducing new test interfaces + implementations, new COM-RPC and JSON-RPC test cases, and updating the JSON-RPC test runtime to use Thunder’s embedded PluginHost::Server (ThunderTestRuntime) instead of a stubbed IShell.
Changes:
- Added new functional test interfaces + implementations to exercise JSON shape/naming/format and
@encode:mac, plus COM-RPC-only@length:*modes. - Added corresponding COM-RPC and JSON-RPC gtest coverage, and new CMake options to toggle these test groups.
- Refactored JSON-RPC server setup to initialize
ThunderTestRuntimeand attach to a realIShell; removedMockShell.
Reviewed changes
Copilot reviewed 35 out of 35 changed files in this pull request and generated 13 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/FunctionalTests/README.md | Updates JSON-RPC test architecture documentation to match the new runtime approach. |
| tests/FunctionalTests/jsonrpc/tests/TestLengthModesJsonRpc.cpp | Adds JSON-RPC tests for length-modes (currently not wired into the build). |
| tests/FunctionalTests/jsonrpc/tests/TestJsonShapeJsonRpc.cpp | Adds JSON-RPC tests for @wrapped / @extract shape behaviors. |
| tests/FunctionalTests/jsonrpc/tests/TestJsonFormattingJsonRpc.cpp | Adds JSON-RPC tests for naming/format tags (@text:*, @compliant, @uncompliant:*). |
| tests/FunctionalTests/jsonrpc/tests/TestEncodingMacJsonRpc.cpp | Adds JSON-RPC tests for @encode:mac. |
| tests/FunctionalTests/jsonrpc/MockShell.h | Removes the IShell stub previously used by the JSON-RPC test server. |
| tests/FunctionalTests/jsonrpc/JsonRpcServer.h | Switches server base class and adds ThunderTestRuntime + real IShell members. |
| tests/FunctionalTests/jsonrpc/JsonRpcServer.cpp | Initializes ThunderTestRuntime, attaches to Controller shell, and deinitializes on teardown. |
| tests/FunctionalTests/jsonrpc/CMakeLists.txt | Wires new JSON-RPC test sources and links test-runtime support. |
| tests/FunctionalTests/external/thunder/CMakeLists.txt | Enables Thunder test runtime build option when JSON-RPC tests are enabled. |
| tests/FunctionalTests/comrpc/tests/TestLengthModes.cpp | Adds COM-RPC coverage for less-common @length modes. |
| tests/FunctionalTests/comrpc/tests/TestJsonShape.cpp | Adds COM-RPC coverage for JSON shape-related tags. |
| tests/FunctionalTests/comrpc/tests/TestJsonFormatting.cpp | Adds COM-RPC coverage for naming/format tag interfaces. |
| tests/FunctionalTests/comrpc/tests/TestEncodingMac.cpp | Adds COM-RPC coverage for @encode:mac round-tripping. |
| tests/FunctionalTests/comrpc/CMakeLists.txt | Fixes option names (TEST_BUFFERS, TEST_OPTIONALS) and wires new COM-RPC tests. |
| tests/FunctionalTests/common/interfaces/ITestLengthModes.h | Defines COM-RPC-only interface to exercise @length:1 and @length:return. |
| tests/FunctionalTests/common/interfaces/ITestJsonUncompliantExtended.h | Defines interface tagged @uncompliant:extended. |
| tests/FunctionalTests/common/interfaces/ITestJsonUncompliantCollapsed.h | Defines interface tagged @uncompliant:collapsed. |
| tests/FunctionalTests/common/interfaces/ITestJsonTextKeep.h | Defines interface tagged @text:keep. |
| tests/FunctionalTests/common/interfaces/ITestJsonTextCase.h | Defines interface tagged @text:legacy. |
| tests/FunctionalTests/common/interfaces/ITestJsonShape.h | Defines interface for @wrapped and @extract shape behaviors. |
| tests/FunctionalTests/common/interfaces/ITestJsonCompliant.h | Defines interface tagged @compliant. |
| tests/FunctionalTests/common/interfaces/ITestEncodingMac.h | Defines interface to exercise @encode:mac. |
| tests/FunctionalTests/common/interfaces/Ids.h | Adds new interface IDs for the newly introduced test interfaces. |
| tests/FunctionalTests/common/implementations/TestLengthModesImpl.cpp | Implements ITestLengthModes. |
| tests/FunctionalTests/common/implementations/TestJsonUncompliantExtendedImpl.cpp | Implements ITestJsonUncompliantExtended. |
| tests/FunctionalTests/common/implementations/TestJsonUncompliantCollapsedImpl.cpp | Implements ITestJsonUncompliantCollapsed. |
| tests/FunctionalTests/common/implementations/TestJsonTextKeepImpl.cpp | Implements ITestJsonTextKeep. |
| tests/FunctionalTests/common/implementations/TestJsonTextCaseImpl.cpp | Implements ITestJsonTextCase. |
| tests/FunctionalTests/common/implementations/TestJsonShapeImpl.cpp | Implements ITestJsonShape. |
| tests/FunctionalTests/common/implementations/TestJsonCompliantImpl.cpp | Implements ITestJsonCompliant. |
| tests/FunctionalTests/common/implementations/TestEncodingMacImpl.cpp | Implements ITestEncodingMac. |
| tests/FunctionalTests/common/CMakeLists.txt | Registers new interfaces via AddTestInterface() for COM-RPC / JSON-RPC generation. |
| tests/FunctionalTests/CMakeLists.txt | Adds new CMake options to enable/disable the new test groups. |
| .github/workflows/ProxyStubFunctionalTests.yml | Installs gtest dev package and enables test runtime in CI configuration. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
bramoosterhuis
left a comment
There was a problem hiding this comment.
One general comment. There is a response.find(value) != string::npos pattern that repeats across most of the new JsonRpc tests (TestJsonShapeJsonRpc, TestJsonTextCaseJsonRpc, TestJsonCompliantJsonRpc, TestJsonUncompliantExtendedJsonRpc, TestJsonUncompliantCollapsedJsonRpc, TestEncodingMacJsonRpc). It's a weak assert: it only checks that the value appears somewhere in the response, so a wrapped or otherwise malformed result could still slip through. Could you go through these and replace it with an explicit EXPECT_EQ on the exact expected response where possible?
Add functional tests for the following JSON generator annotation tags, each covered with both COM-RPC and JSON-RPC tests:
@wrapped — verify method returning a wrapped counter is correctly serialised
@extract — verify list extraction flattens the wrapper in JSON
@iterator — verify iterator-based COM-RPC interface (COM-RPC only; not JSON-RPC serialisable)
@encode:mac — verify MAC address encoding/decoding round-trip
@text:keep — verify method and property names are preserved exactly as in C++
@text:legacy — verify method and parameter names are lowercased
@compliant — verify compliant JSON-RPC format is produced
@uncompliant:extended — verify extended uncompliant format is produced
@uncompliant:collapsed — verify collapsed uncompliant format is produced