Skip to content

ci(audience): add Unity-tests workflow + close test-discovery gap (SDK-326)#743

Merged
nattb8 merged 1 commit intomainfrom
feat/sdk-326-audience-unity-test-ci
May 6, 2026
Merged

ci(audience): add Unity-tests workflow + close test-discovery gap (SDK-326)#743
nattb8 merged 1 commit intomainfrom
feat/sdk-326-audience-unity-test-ci

Conversation

@nattb8
Copy link
Copy Markdown
Collaborator

@nattb8 nattb8 commented May 6, 2026

Summary

Audience package's Unity-dependent tests never ran in CI — test-audience-sdk.yml (dotnet test) excludes UnityEngine/UnityEditor references, and the sample app workflow never discovered package tests because manifest.json had no testables entry.

Changes

  • New test-audience-sdk-unity.yml — single GameCI Linux cell (Unity 2022.3, iOS module, EditMode), runs both Immutable.Audience.Runtime.Tests and Immutable.Audience.Editor.Tests. testables is injected via jq in a CI step so the sample app workflow stays scoped to sample-app-only tests.
  • Compile fixes surfaced once the asmdef ran:
    • Added InternalsVisibleTo("Immutable.Audience.Runtime.Tests") so DeviceCollector/IDFVBridge (internal) are accessible from tests.
    • DeviceCollectorTests — split is not string s pattern (CS0165 on Mono).
    • SessionTests — replaced Thread.Sleep(1500) with ManualResetEvent to eliminate timing flake on slow runners.
    • TimerDisposalTestsAssert.Ignore on Mono; wait-handle invariant doesn't hold under Unity's Mono runtime (production path unaffected).
  • test-audience-sample-app.yml — timeout lowered 60 → 30 min; healthy cells finish in ~10 min.

Test plan

  • CI green on this PR
  • New workflow compiles and runs both test assemblies
  • Sample app PlayMode cells unaffected

@nattb8 nattb8 requested review from a team as code owners May 6, 2026 07:42
@nattb8 nattb8 force-pushed the feat/sdk-326-audience-unity-test-ci branch from 7d89eea to e10a762 Compare May 6, 2026 07:48
@nattb8 nattb8 changed the title ci(audience): run Unity-dependent SDK tests via dedicated workflow (SDK-326) ci(audience): add Editor-tests workflow + close test-discovery gap (SDK-326) May 6, 2026
@nattb8 nattb8 force-pushed the feat/sdk-326-audience-unity-test-ci branch 4 times, most recently from 6f72f9c to 6e4a8df Compare May 6, 2026 12:05
…K-326)

Audience package's Unity-dependent tests have never run in CI:
test-audience-sdk.yml's csproj excludes Tests/Runtime/Unity/** and
Tests/Editor/**, and test-audience-sample-app.yml never discovered the
package's tests because manifest.json had no testables entry.
DeviceCollectorTests has shipped since SDK-297/298 with two compile
errors no PR caught.

Closes the gap with a dedicated single-cell GameCI Linux workflow that
mirrors test-build.yml's pattern. testables is injected at CI time so
the sample app's manifest.json stays uncontaminated and its existing
PlayMode cells continue running only sample-app integration tests.

* New test-audience-sdk-unity.yml — runs Runtime.Tests + Editor.Tests
  in EditMode on Unity 2022.3 with iOS module (UnityEditor.iOS.Xcode +
  UNITY_IOS).
* Add InternalsVisibleTo on Immutable.Audience.Unity for the test
  asmdef so DeviceCollectorTests can see DeviceCollector and IDFVBridge.
* Fix DeviceCollectorTests' is-not-string-s pattern (CS0165).
* Replace Thread.Sleep with ManualResetEvent in SessionTests'
  drain-budget timeout test for deterministic timing on Mono editor.
* Skip TimerDisposalTests' wait-handle invariant test on Mono runtimes
  where Timer.Dispose(WaitHandle) signals before in-flight callbacks
  complete (production code unaffected; SampleApp PlayMode tests
  exercise DrainHeartbeatTimer end-to-end).
* Lower test-audience-sample-app.yml timeout from 60 to 30 min so
  hung cells release the self-hosted runner sooner.
@nattb8 nattb8 force-pushed the feat/sdk-326-audience-unity-test-ci branch from 6e4a8df to 68a9c84 Compare May 6, 2026 21:23
@nattb8 nattb8 changed the title ci(audience): add Editor-tests workflow + close test-discovery gap (SDK-326) ci(audience): add Unity-tests workflow + close test-discovery gap (SDK-326) May 6, 2026
@nattb8 nattb8 enabled auto-merge May 6, 2026 21:43
@nattb8 nattb8 disabled auto-merge May 6, 2026 21:46
@nattb8 nattb8 enabled auto-merge May 6, 2026 22:17
@nattb8 nattb8 merged commit c539fbd into main May 6, 2026
56 of 57 checks passed
@nattb8 nattb8 deleted the feat/sdk-326-audience-unity-test-ci branch May 6, 2026 23:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

2 participants