inkle / ink-unity-integration

Unity integration for the open source ink narrative scripting language.
http://www.inklestudios.com/ink
Other
578 stars 101 forks source link

Unity Test Runner on GitHub Actions times out #159

Closed ViMaSter closed 3 years ago

ViMaSter commented 3 years ago

For a project I'm working on, we're using GameCI to build out Unity project and also run automated PlayMode and EditMode tests. We're using version 1.0.2 of the ink-Unity integration.

Inside our PlayMode-assembly, we're referencing our game code assembly, which references the ink-Unity integration package.

The tests are executed using the following command: /opt/unity/Editor/Unity -batchmode -logFile /github/workspace/artifacts/editmode.log -projectPath /github/workspace/. -runTests -testPlatform playmode -testResults /github/workspace/artifacts/editmode-results.xml

Doing so, results in the following errors:

2021-09-09T23:13:10.0218254Z File path for ink file is null! The ink library requires rebuilding.
2021-09-09T23:13:10.0219901Z UnityEngine.StackTraceUtility:ExtractStackTrace () (at /home/bokken/buildslave/unity/build/Runtime/Export/Scripting/StackTrace.cs:37)
2021-09-09T23:13:10.0222413Z UnityEngine.DebugLogHandler:LogFormat (UnityEngine.LogType,UnityEngine.Object,string,object[])
2021-09-09T23:13:10.0224488Z UnityEngine.Logger:Log (UnityEngine.LogType,object)
2021-09-09T23:13:10.0225692Z UnityEngine.Debug:Assert (bool,string)
2021-09-09T23:13:10.0227737Z Ink.UnityIntegration.InkFile:get_jsonPath () (at Library/PackageCache/com.inklestudios.ink-unity-integration@1.0.2/Editor/Core/Ink Library/InkFile.cs:54)
2021-09-09T23:13:10.0230551Z Ink.UnityIntegration.InkCompiler:DelayedComplete () (at Library/PackageCache/com.inklestudios.ink-unity-integration@1.0.2/Editor/Core/Compiler/InkCompiler.cs:455)
2021-09-09T23:13:10.0233678Z Ink.UnityIntegration.InkCompiler:Update () (at Library/PackageCache/com.inklestudios.ink-unity-integration@1.0.2/Editor/Core/Compiler/InkCompiler.cs:198)
2021-09-09T23:13:10.0331783Z UnityEditor.EditorApplication:Internal_CallUpdateFunctions () (at /home/bokken/buildslave/unity/build/Editor/Mono/EditorApplication.cs:327)
2021-09-09T23:13:10.0333446Z 
2021-09-09T23:13:10.0335357Z (Filename: Library/PackageCache/com.inklestudios.ink-unity-integration@1.0.2/Editor/Core/Ink Library/InkFile.cs Line: 54)
2021-09-09T23:13:10.0336954Z 
2021-09-09T23:13:10.0337721Z JSON folder not found for ink file at path 
2021-09-09T23:13:10.0339168Z UnityEngine.StackTraceUtility:ExtractStackTrace () (at /home/bokken/buildslave/unity/build/Runtime/Export/Scripting/StackTrace.cs:37)
2021-09-09T23:13:10.0341459Z UnityEngine.DebugLogHandler:LogFormat (UnityEngine.LogType,UnityEngine.Object,string,object[])
2021-09-09T23:13:10.0343521Z UnityEngine.Logger:Log (UnityEngine.LogType,object)
2021-09-09T23:13:10.0345062Z UnityEngine.Debug:Assert (bool,string)
2021-09-09T23:13:10.0347284Z Ink.UnityIntegration.InkFile:get_jsonPath () (at Library/PackageCache/com.inklestudios.ink-unity-integration@1.0.2/Editor/Core/Ink Library/InkFile.cs:72)
2021-09-09T23:13:10.0350702Z Ink.UnityIntegration.InkCompiler:DelayedComplete () (at Library/PackageCache/com.inklestudios.ink-unity-integration@1.0.2/Editor/Core/Compiler/InkCompiler.cs:455)
2021-09-09T23:13:10.0353747Z Ink.UnityIntegration.InkCompiler:Update () (at Library/PackageCache/com.inklestudios.ink-unity-integration@1.0.2/Editor/Core/Compiler/InkCompiler.cs:198)
2021-09-09T23:13:10.0356377Z UnityEditor.EditorApplication:Internal_CallUpdateFunctions () (at /home/bokken/buildslave/unity/build/Editor/Mono/EditorApplication.cs:327)
2021-09-09T23:13:10.0357659Z 
2021-09-09T23:13:10.0359748Z (Filename: Library/PackageCache/com.inklestudios.ink-unity-integration@1.0.2/Editor/Core/Ink Library/InkFile.cs Line: 72)
2021-09-09T23:13:10.0360773Z 
2021-09-09T23:13:10.0361450Z Assertion failed
2021-09-09T23:13:10.0362966Z UnityEngine.StackTraceUtility:ExtractStackTrace () (at /home/bokken/buildslave/unity/build/Runtime/Export/Scripting/StackTrace.cs:37)
2021-09-09T23:13:10.0367014Z UnityEngine.DebugLogHandler:LogFormat (UnityEngine.LogType,UnityEngine.Object,string,object[])
2021-09-09T23:13:10.0369465Z UnityEngine.Logger:Log (UnityEngine.LogType,object)
2021-09-09T23:13:10.0371083Z UnityEngine.Debug:Assert (bool)
2021-09-09T23:13:10.0375154Z Ink.UnityIntegration.InkEditorUtils:CombinePaths (string,string) (at Library/PackageCache/com.inklestudios.ink-unity-integration@1.0.2/Editor/Core/InkEditorUtils.cs:249)
2021-09-09T23:13:10.0379235Z Ink.UnityIntegration.InkFile:get_jsonPath () (at Library/PackageCache/com.inklestudios.ink-unity-integration@1.0.2/Editor/Core/Ink Library/InkFile.cs:75)
2021-09-09T23:13:10.0383168Z Ink.UnityIntegration.InkCompiler:DelayedComplete () (at Library/PackageCache/com.inklestudios.ink-unity-integration@1.0.2/Editor/Core/Compiler/InkCompiler.cs:455)
2021-09-09T23:13:10.0386933Z Ink.UnityIntegration.InkCompiler:Update () (at Library/PackageCache/com.inklestudios.ink-unity-integration@1.0.2/Editor/Core/Compiler/InkCompiler.cs:198)
2021-09-09T23:13:10.0390636Z UnityEditor.EditorApplication:Internal_CallUpdateFunctions () (at /home/bokken/buildslave/unity/build/Editor/Mono/EditorApplication.cs:327)
2021-09-09T23:13:10.0392219Z 
2021-09-09T23:13:10.0395027Z (Filename: Library/PackageCache/com.inklestudios.ink-unity-integration@1.0.2/Editor/Core/InkEditorUtils.cs Line: 249)
2021-09-09T23:13:10.0396149Z 
2021-09-09T23:13:10.0397057Z ArgumentNullException: Value cannot be null.
2021-09-09T23:13:10.0398351Z Parameter name: path2
2021-09-09T23:13:10.0400430Z   at System.IO.Path.Combine (System.String path1, System.String path2) [0x00011] in <695d1cc93cca45069c528c15c9fdd749>:0 
2021-09-09T23:13:10.0403875Z   at Ink.UnityIntegration.InkEditorUtils.CombinePaths (System.String firstPath, System.String secondPath) [0x00012] in /github/workspace/Library/PackageCache/com.inklestudios.ink-unity-integration@1.0.2/Editor/Core/InkEditorUtils.cs:250 
2021-09-09T23:13:10.0407785Z   at Ink.UnityIntegration.InkFile.get_jsonPath () [0x00074] in /github/workspace/Library/PackageCache/com.inklestudios.ink-unity-integration@1.0.2/Editor/Core/Ink Library/InkFile.cs:75 
2021-09-09T23:13:10.0418238Z   at Ink.UnityIntegration.InkCompiler.DelayedComplete () [0x00062] in /github/workspace/Library/PackageCache/com.inklestudios.ink-unity-integration@1.0.2/Editor/Core/Compiler/InkCompiler.cs:455 
2021-09-09T23:13:10.0421867Z   at Ink.UnityIntegration.InkCompiler.Update () [0x000b6] in /github/workspace/Library/PackageCache/com.inklestudios.ink-unity-integration@1.0.2/Editor/Core/Compiler/InkCompiler.cs:198 
2021-09-09T23:13:10.0425306Z   at (wrapper delegate-invoke) <Module>.invoke_void()
2021-09-09T23:13:10.0427546Z   at UnityEditor.EditorApplication.Internal_CallUpdateFunctions () [0x00076] in /home/bokken/buildslave/unity/build/Editor/Mono/EditorApplication.cs:327 
2021-09-09T23:13:10.0430820Z 
2021-09-09T23:13:10.0432636Z (Filename: Library/PackageCache/com.inklestudios.ink-unity-integration@1.0.2/Editor/Core/InkEditorUtils.cs Line: 250)

These are thrown multiple thousand times and the GitHub action workflow doesn't stop for over 2 hours; I've attached the full log until the error simply gets repeated.

How can we prevent this issue from occurring, as it blocks us from running automated tests inside our game on GitHub.

tomkail commented 3 years ago

Gosh - to be entirely honest I have no bloody clue. We don’t do any automated tests and so I wouldn’t even know how to fix it! I’d be very interested in hearing what we can do if you or anyone else fancies looking into it though!

On Fri, 10 Sep 2021 at 17:20, Vincent Mahnke @.***> wrote:

For a project I'm working on, we're using GameCI https://github.com/Studio-Lovelies/GG-JointJustice-Unity/blob/157252ff43beface4e45ac378ba1dfd2b2bfa192/.github/workflows/build.yml#L50-L95 to build out Unity project and also run automated PlayMode and EditMode tests @.***/manual/edit-mode-vs-play-mode-tests.html> . We're using version 1.0.2 of the ink-Unity integration.

Inside our PlayMode-assembly https://github.com/Studio-Lovelies/GG-JointJustice-Unity/blob/bafa73987f351247c7b6508bd0cb489e801f4fc0/Assets/Tests/PlayModeTests/PlayModeTests.asmdef, we're referencing our game code assembly https://github.com/Studio-Lovelies/GG-JointJustice-Unity/blob/bafa73987f351247c7b6508bd0cb489e801f4fc0/Assets/Scripts/GG-JointJustice.asmdef, which references the ink-Unity integration package.

The tests are executed using the following command: /opt/unity/Editor/Unity -batchmode -logFile /github/workspace/artifacts/editmode.log -projectPath /github/workspace/. -runTests -testPlatform playmode -testResults /github/workspace/artifacts/editmode-results.xml

Doing so, results in the following errors:

2021-09-09T23:13:10.0218254Z File path for ink file is null! The ink library requires rebuilding. 2021-09-09T23:13:10.0219901Z UnityEngine.StackTraceUtility:ExtractStackTrace () (at /home/bokken/buildslave/unity/build/Runtime/Export/Scripting/StackTrace.cs:37) 2021-09-09T23:13:10.0222413Z UnityEngine.DebugLogHandler:LogFormat (UnityEngine.LogType,UnityEngine.Object,string,object[]) 2021-09-09T23:13:10.0224488Z UnityEngine.Logger:Log (UnityEngine.LogType,object) 2021-09-09T23:13:10.0225692Z UnityEngine.Debug:Assert (bool,string) 2021-09-09T23:13:10.0227737Z Ink.UnityIntegration.InkFile:get_jsonPath () (at @./Editor/Core/Ink Library/InkFile.cs:54) 2021-09-09T23:13:10.0230551Z Ink.UnityIntegration.InkCompiler:DelayedComplete () (at @./Editor/Core/Compiler/InkCompiler.cs:455) 2021-09-09T23:13:10.0233678Z Ink.UnityIntegration.InkCompiler:Update () (at @./Editor/Core/Compiler/InkCompiler.cs:198) 2021-09-09T23:13:10.0331783Z UnityEditor.EditorApplication:Internal_CallUpdateFunctions () (at /home/bokken/buildslave/unity/build/Editor/Mono/EditorApplication.cs:327) 2021-09-09T23:13:10.0333446Z 2021-09-09T23:13:10.0335357Z (Filename: @./Editor/Core/Ink Library/InkFile.cs Line: 54) 2021-09-09T23:13:10.0336954Z 2021-09-09T23:13:10.0337721Z JSON folder not found for ink file at path 2021-09-09T23:13:10.0339168Z UnityEngine.StackTraceUtility:ExtractStackTrace () (at /home/bokken/buildslave/unity/build/Runtime/Export/Scripting/StackTrace.cs:37) 2021-09-09T23:13:10.0341459Z UnityEngine.DebugLogHandler:LogFormat (UnityEngine.LogType,UnityEngine.Object,string,object[]) 2021-09-09T23:13:10.0343521Z UnityEngine.Logger:Log (UnityEngine.LogType,object) 2021-09-09T23:13:10.0345062Z UnityEngine.Debug:Assert (bool,string) 2021-09-09T23:13:10.0347284Z Ink.UnityIntegration.InkFile:get_jsonPath () (at @./Editor/Core/Ink Library/InkFile.cs:72) 2021-09-09T23:13:10.0350702Z Ink.UnityIntegration.InkCompiler:DelayedComplete () (at @./Editor/Core/Compiler/InkCompiler.cs:455) 2021-09-09T23:13:10.0353747Z Ink.UnityIntegration.InkCompiler:Update () (at @./Editor/Core/Compiler/InkCompiler.cs:198) 2021-09-09T23:13:10.0356377Z UnityEditor.EditorApplication:Internal_CallUpdateFunctions () (at /home/bokken/buildslave/unity/build/Editor/Mono/EditorApplication.cs:327) 2021-09-09T23:13:10.0357659Z 2021-09-09T23:13:10.0359748Z (Filename: @./Editor/Core/Ink Library/InkFile.cs Line: 72) 2021-09-09T23:13:10.0360773Z 2021-09-09T23:13:10.0361450Z Assertion failed 2021-09-09T23:13:10.0362966Z UnityEngine.StackTraceUtility:ExtractStackTrace () (at /home/bokken/buildslave/unity/build/Runtime/Export/Scripting/StackTrace.cs:37) 2021-09-09T23:13:10.0367014Z UnityEngine.DebugLogHandler:LogFormat (UnityEngine.LogType,UnityEngine.Object,string,object[]) 2021-09-09T23:13:10.0369465Z UnityEngine.Logger:Log (UnityEngine.LogType,object) 2021-09-09T23:13:10.0371083Z UnityEngine.Debug:Assert (bool) 2021-09-09T23:13:10.0375154Z Ink.UnityIntegration.InkEditorUtils:CombinePaths (string,string) (at @./Editor/Core/InkEditorUtils.cs:249) 2021-09-09T23:13:10.0379235Z Ink.UnityIntegration.InkFile:get_jsonPath () (at @./Editor/Core/Ink Library/InkFile.cs:75) 2021-09-09T23:13:10.0383168Z Ink.UnityIntegration.InkCompiler:DelayedComplete () (at @./Editor/Core/Compiler/InkCompiler.cs:455) 2021-09-09T23:13:10.0386933Z Ink.UnityIntegration.InkCompiler:Update () (at @./Editor/Core/Compiler/InkCompiler.cs:198) 2021-09-09T23:13:10.0390636Z UnityEditor.EditorApplication:Internal_CallUpdateFunctions () (at /home/bokken/buildslave/unity/build/Editor/Mono/EditorApplication.cs:327) 2021-09-09T23:13:10.0392219Z 2021-09-09T23:13:10.0395027Z (Filename: @./Editor/Core/InkEditorUtils.cs Line: 249) 2021-09-09T23:13:10.0396149Z 2021-09-09T23:13:10.0397057Z ArgumentNullException: Value cannot be null. 2021-09-09T23:13:10.0398351Z Parameter name: path2 2021-09-09T23:13:10.0400430Z at System.IO.Path.Combine (System.String path1, System.String path2) [0x00011] in <695d1cc93cca45069c528c15c9fdd749>:0 2021-09-09T23:13:10.0403875Z at Ink.UnityIntegration.InkEditorUtils.CombinePaths (System.String firstPath, System.String secondPath) [0x00012] in @./Editor/Core/InkEditorUtils.cs:250 2021-09-09T23:13:10.0407785Z at Ink.UnityIntegration.InkFile.get_jsonPath () [0x00074] in @./Editor/Core/Ink Library/InkFile.cs:75 2021-09-09T23:13:10.0418238Z at Ink.UnityIntegration.InkCompiler.DelayedComplete () [0x00062] in @./Editor/Core/Compiler/InkCompiler.cs:455 2021-09-09T23:13:10.0421867Z at Ink.UnityIntegration.InkCompiler.Update () [0x000b6] in @./Editor/Core/Compiler/InkCompiler.cs:198 2021-09-09T23:13:10.0425306Z at (wrapper delegate-invoke) .invoke_void() 2021-09-09T23:13:10.0427546Z at UnityEditor.EditorApplication.Internal_CallUpdateFunctions () [0x00076] in /home/bokken/buildslave/unity/build/Editor/Mono/EditorApplication.cs:327 2021-09-09T23:13:10.0430820Z 2021-09-09T23:13:10.0432636Z (Filename: @./Editor/Core/InkEditorUtils.cs Line: 250)

These are thrown multiple thousand times and the GitHub action workflow doesn't stop for over 2 hours https://github.com/Studio-Lovelies/GG-JointJustice-Unity/runs/3561341174?check_suite_focus=true; I've attached the full log until the error simply gets repeated https://github.com/inkle/ink-unity-integration/files/7145118/excerpt.log .

How can we prevent this issue from occurring, as it blocks us from running automated tests inside our game on GitHub.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/inkle/ink-unity-integration/issues/159, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJR3UAVF3FLS5F42KWDCXDUBIV3LANCNFSM5DZVD4RQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

ViMaSter commented 3 years ago

Just a quick update: The issue only seems to occur, if caching is enabled for the GitHub action workflow.

We're using GameCI, which inside their documentation recommends caching the Library-folder between runs. Disabling caching results in the initial import taking place for every run of that workflow (which takes around 10 minutes for our project), but it also reliably prevents this problem from occurring.

Closing this issue, as the root cause isn't related to the Ink integration. Nevertheless, thank you @tomkail for the rapid initial response! :)