Skip to content

Add standalone unit tests and CI workflow for Unreal GSDK#194

Open
Copilot wants to merge 4 commits intomainfrom
copilot/add-unit-tests-gsdk
Open

Add standalone unit tests and CI workflow for Unreal GSDK#194
Copilot wants to merge 4 commits intomainfrom
copilot/add-unit-tests-gsdk

Conversation

Copy link
Contributor

Copilot AI commented Mar 3, 2026

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 FetchContent
  • UnrealPlugin/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 affecting UnrealPlugin/**

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 needed

Special notes for your reviewer:

The "publicIpV4Adress" JSON key (missing 'd') is intentionally misspelled in the tests to match the existing typo in GSDKConfiguration.cpp and TestConfiguration.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:

  • this PR contains documentation
  • this PR contains unit tests
  • this PR has been tested for backwards compatibility

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: dgkanatsios <8256138+dgkanatsios@users.noreply.github.com>
Copilot AI changed the title [WIP] Add unit tests for Unreal GSDK Add standalone unit tests and CI workflow for Unreal GSDK Mar 3, 2026
@dgkanatsios
Copy link
Contributor

@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>
Copy link
Contributor Author

Copilot AI commented Mar 3, 2026

@copilot can you amend the Unreal README to mention that these files are not needed, when someone uses the Unreal GSDK?

Added a "Directory structure" section to UnrealPlugin/README.md in 9eb3025 that lists the three files/directories needed for integration (Source/, Resources/, PlayFabGSDK.uplugin) and clarifies that Tests/, TestingProject/, Documentation/, docs, and license files are not needed for game projects.

@dgkanatsios
Copy link
Contributor

@copilot can you try again?

…ecific files to copy

Co-authored-by: dgkanatsios <8256138+dgkanatsios@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Mar 3, 2026

@copilot can you try again?

Revised the README section in f18d845 — renamed to "Plugin files" with a clearer note callout, and also updated ThirdPersonMPGSDKSetup.md to list the specific files to copy (Source/, Resources/, PlayFabGSDK.uplugin) instead of "drag all files."

@dgkanatsios dgkanatsios marked this pull request as ready for review March 5, 2026 01:03
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.

2 participants