From c898d7984ca3fbe5235aac8896b02b620bd6ff8c Mon Sep 17 00:00:00 2001 From: Makihiro <13536348+mackysoft@users.noreply.github.com> Date: Tue, 20 Oct 2026 12:55:48 +0900 Subject: [PATCH 1/2] ci(tests): record progress before native Editor failures Why Unity 2021.3 can stop before the test runner writes its result XML. The existing artifact cannot identify the active test or crash time. What Changed Record batch test starts and finishes through Unity Test Framework's callback API and add timestamps to the CI Editor log. Impact Keeps failure diagnostics available without changing test assertions, time limits, or the shipped package. Verified callback logging with a scoped Unity 2021.3 EditMode run. --- .github/workflows/tests.yaml | 2 +- .../Editor/BatchTestProgress.cs | 43 +++++++++++++++++++ .../Editor/BatchTestProgress.cs.meta | 11 +++++ 3 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 Assets/Tests/SerializeReferenceExtensions/Editor/BatchTestProgress.cs create mode 100644 Assets/Tests/SerializeReferenceExtensions/Editor/BatchTestProgress.cs.meta diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 753b961..e8c0ac7 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -94,7 +94,7 @@ jobs: --mode EditMode \ --output Logs/TestResults/editmode.xml \ --timeout 900 \ - -- -force-glcore -logFile Logs/editmode.log + -- -force-glcore -timestamps -logFile Logs/editmode.log DISPLAY_SESSION - name: Return Unity license diff --git a/Assets/Tests/SerializeReferenceExtensions/Editor/BatchTestProgress.cs b/Assets/Tests/SerializeReferenceExtensions/Editor/BatchTestProgress.cs new file mode 100644 index 0000000..124df82 --- /dev/null +++ b/Assets/Tests/SerializeReferenceExtensions/Editor/BatchTestProgress.cs @@ -0,0 +1,43 @@ +using System; +using NUnit.Framework.Interfaces; +using UnityEngine; +using UnityEngine.TestRunner; + +[assembly: TestRunCallback(typeof(MackySoft.SerializeReferenceExtensions.Tests.BatchTestProgress))] + +namespace MackySoft.SerializeReferenceExtensions.Tests +{ + // Results XML is written only after the run finishes. Keep the current test + // in the Editor log even when a native crash prevents that final report. + public sealed class BatchTestProgress : ITestRunCallback + { + public void RunStarted (ITest testsToRun) => Write("RUN START", testsToRun.FullName); + + public void RunFinished (ITestResult result) => Write("RUN FINISH", result.ResultState.ToString()); + + public void TestStarted (ITest test) + { + if (!test.IsSuite) + { + Write("START", test.FullName); + } + } + + public void TestFinished (ITestResult result) + { + if (!result.Test.IsSuite) + { + Write("FINISH", result.Test.FullName + " " + result.ResultState); + } + } + + private static void Write (string phase, string detail) + { + if (Application.isBatchMode) + { + Debug.LogFormat(LogType.Log, LogOption.NoStacktrace, null, + "[EditMode {0:O}] {1} {2}", DateTime.UtcNow, phase, detail); + } + } + } +} diff --git a/Assets/Tests/SerializeReferenceExtensions/Editor/BatchTestProgress.cs.meta b/Assets/Tests/SerializeReferenceExtensions/Editor/BatchTestProgress.cs.meta new file mode 100644 index 0000000..804b913 --- /dev/null +++ b/Assets/Tests/SerializeReferenceExtensions/Editor/BatchTestProgress.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0cc093637968f48a3aeda9afdb4586ed +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: From 2a8e139caa51d9381d63c6e3fee7467edcc3bc65 Mon Sep 17 00:00:00 2001 From: Makihiro <13536348+mackysoft@users.noreply.github.com> Date: Tue, 20 Oct 2026 13:19:06 +0900 Subject: [PATCH 2/2] ci(tests): allow healthy EditMode runs to finish on slower hosts Why The diagnostic Unity 2021.3 run passed 177 tests and was still advancing when the 900-second process limit interrupted its final layout checks. Its GUI operations took about 1.6 times the previous successful run. What Changed Give the complete Editor process 1200 seconds. This covers the measured progress and remaining operations with headroom for hosted-runner variation. Impact Keeps all test assertions, individual condition deadlines, and required Editor versions unchanged. Retains progress logging to distinguish a real stall from expiration of the total execution budget. --- .github/workflows/tests.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index e8c0ac7..0313bea 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -93,7 +93,7 @@ jobs: --editor-version "$UNITY_EDITOR_VERSION" \ --mode EditMode \ --output Logs/TestResults/editmode.xml \ - --timeout 900 \ + --timeout 1200 \ -- -force-glcore -timestamps -logFile Logs/editmode.log DISPLAY_SESSION