Search Unity

  1. Calling all beginners! Join the FPS Beginners Mods Challenge until December 13.
    Dismiss Notice
  2. It's Cyber Week at the Asset Store!
    Dismiss Notice

Streaming Assets and PlayMode Tests

Discussion in 'Unity Cloud Build' started by AlexNanomonx, Nov 27, 2019.

  1. AlexNanomonx

    AlexNanomonx

    Joined:
    Jan 4, 2017
    Posts:
    18
    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.
    1. Setup
    2. Tests
    3. Build Asset Bundle
    4. Copy to StreamingAssets
    5. 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?
     
  2. AlexNanomonx

    AlexNanomonx

    Joined:
    Jan 4, 2017
    Posts:
    18
    Just finished my tests of this and this works:

    1. Create an EditMode test where no test are are actually performed
    2. From that test build the asset bundles that you need
    3. Copy those asset bundles to the streaming assets folder
    Unity cloud build will run the editmode "test", then the PlayMode tests and everything passes.
     
  3. victorw

    victorw

    Unity Technologies

    Joined:
    Sep 14, 2016
    Posts:
    182
    :eek:

    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.