So we’ve been trying to add some tests to our project, to increase stability, prevent regression etc. etc. We also use Asset Bundles and specifically Streaming Assets. At the moment the order of operations in CloudBuild is, as far as I can work out.
Setup
Tests
Build Asset Bundle
Copy to StreamingAssets
Build project
In our project if the StreamingAssets aren’t present then play mode cannot run, consequently our PlayMode tests can’t run. Is there a way to make the tests run later or resolve this issue?
I had the idea of creating an edit mode test, which secretly just builds and copies the StreamingAssets, which you can’t do in PlayMode.
Can anyone who understands the CloudBuild properly think of a less hacky way to do this?
I mean that works I guess? And it’s probably the best approach right now, but you absolutely should not have to do that. The order of operations for the build is mostly like that for historical reasons and there’s not really any easy way for us to alter it to support this use case without dramatically slowing down the build or doing a major rewrite of build code. That said I’ll make sure we have work logged to do that major rewrite and I’ll link this forum thread in the ticket, because yeah this should be supported without having to take such a hacky approach.
I have some PlayMode tests that rely on StreamingAssets, and the tests fail.
However, those some test scenarios work fine within a scene.
Are PlayMode tests able to access the StreamingAssets directory?
You can use the approach that @AlexNanomonx mentioned to build StreamingAssets before the tests are run. We are working with the Editor team and have prioritized the rework of the build systems so hopefully later this year it will be possible to support this scenario without any workarounds.