Draft
Conversation
- Create test project (UnityGsdk/Tests/Tests.csproj) that compiles model and helper source files without Unity engine dependencies - Add GSDKConfigurationTests: config parsing, env vars, round-trip - Add SessionConfigTests: CopyNonNullFields, equality, hash code - Add SerializationTests: heartbeat request/response, maintenance schedule, connected players, game state/operation enum serialization - Add CI workflow (.github/workflows/unity-tests.yml) triggered on PRs with changes to UnityGsdk/** paths - Update UnityGsdk/.gitignore to allow Tests/Tests.csproj Co-authored-by: dgkanatsios <8256138+dgkanatsios@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add unit tests for Unity GSDK and integrate with PR
Add Unity GSDK unit tests and CI workflow
Mar 3, 2026
Contributor
|
@copilot can you amend the Unity GSDK readme to mention that these files don't need to be included when someone uses the Unity GSDK? |
Copilot stopped work on behalf of
dgkanatsios due to an error
March 3, 2026 19:37
Contributor
|
@copilot can you retry? |
Co-authored-by: dgkanatsios <8256138+dgkanatsios@users.noreply.github.com>
Contributor
Author
Added a "What is the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this PR does / why we need it:
Adds standalone unit tests for the Unity GSDK model/helper classes and a GitHub Actions workflow to run them on PRs, matching the pattern established in #191 (C#) and #192 (C++).
The Unity SDK's model classes (
GSDKConfiguration,SessionConfig,HeartbeatRequest/Response,MaintenanceSchedule, etc.) andSimpleJsonhelpers have no Unity engine dependencies, so they compile and test in a standard .NET project without requiring Unity Editor.Test project (
UnityGsdk/Tests/Tests.csproj):<Compile Include="..." Link="..." />— no separate library project neededGSDKConfigurationTests— config parsing, env vars, certificates, ports, round-trip serializationSessionConfigTests—CopyNonNullFields, equality operators, hash codeSerializationTests— heartbeat request/response, maintenance schedule V2, connected players, allGameState/GameOperationenum valuesCI workflow (
.github/workflows/unity-tests.yml):UnityGsdk/**ubuntu-latest, .NET 10.0.x,dotnet testOther:
UnityGsdk/.gitignore— added!Tests/Tests.csprojexception (existing gitignore excludes*.csproj)UnityGsdk/README.md— added FAQ section clarifying that theTests/folder is for development/CI only and does not need to be included when integrating the Unity GSDK; also fixed a pre-existing "scripring" → "scripting" typoSpecial notes for your reviewer:
MSTest package versions match
csharp/Tests/Tests.csprojfor consistency.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.