Add standalone unit tests and CI workflow for Unreal GSDK#194
Add standalone unit tests and CI workflow for Unreal GSDK#194
Conversation
Co-authored-by: dgkanatsios <8256138+dgkanatsios@users.noreply.github.com>
|
@copilot can you amend the Unreal README to mention that these files are not needed, when someone uses the Unreal GSDK? |
…es are needed Co-authored-by: dgkanatsios <8256138+dgkanatsios@users.noreply.github.com>
Added a "Directory structure" section to |
|
@copilot can you try again? |
…ecific files to copy Co-authored-by: dgkanatsios <8256138+dgkanatsios@users.noreply.github.com>
Revised the README section in |
What this PR does / why we need it:
Adds standalone C++ unit tests for the Unreal GSDK that validate JSON contracts (configuration format, heartbeat request/response) without requiring Unreal Engine. Includes a GitHub Actions CI workflow to run these tests on PRs affecting
UnrealPlugin/**, similar to PRs #191 and #192 for C# and C++ tests.New files
UnrealPlugin/Tests/CMakeLists.txt— CMake build with Google Test and nlohmann/json via FetchContentUnrealPlugin/Tests/GSDKConfigTests.cpp— 7 configuration JSON format tests mirroring existing UE automation tests (ConfigAllSetInitializesFine,LogFolderNotSetInitializesFine,SharedContentFolderNotSetInitializesFine, plus additional coverage for optional fields, connection info, and file round-trips)UnrealPlugin/Tests/GSDKHeartbeatTests.cpp— 15 heartbeat request/response JSON tests mirroring existing UE automation tests (EncodeGameStateAsValidJson,DecodeAgentResponseJsonCorrectly,GameState_MaintV2_CallbackInvoked,JsonDoesntCrashWhenInvalidJson,ReturnInitialPlayerListFromJson,ReturnSessionMetadataFromJson,AgentOperationStateChangesHandledCorrectly, plus additional coverage for all game states, heartbeat interval enforcement, and edge cases).github/workflows/unreal-tests.yml— CI workflow triggered on PRs affectingUnrealPlugin/**Updated files
UnrealPlugin/README.md— Added a "Plugin files" section clarifying which files are needed when integrating the GSDK plugin into a game project (Source/,Resources/,PlayFabGSDK.uplugin) versus which are for development/CI only (Tests/,TestingProject/,Documentation/, etc.)UnrealPlugin/ThirdPersonMPGSDKSetup.md— Updated the setup guide to list the specific files to copy into the project's Plugins folder instead of "drag all files," noting that test and documentation directories are not neededSpecial notes for your reviewer:
The
"publicIpV4Adress"JSON key (missing 'd') is intentionally misspelled in the tests to match the existing typo inGSDKConfiguration.cppandTestConfiguration.cpp. Both serialization and deserialization use this key, so the tests preserve the same contract.All 22 tests pass locally. The existing UE editor automation tests in
TestingProject/are unchanged and continue to work as before.If applicable:
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.