CI/CD Test Job (and Unit Tests)

While we were working on the 3D house project, we needed to set up and add hundreds of items for the in-game store. This process was quite prone to human error, since it was pretty much inevitable that something would be entered incorrectly. For instance, occasionally an asset would make it onto a test server and not have a corresponding localisation key, meaning an incorrect or outdated display name would be shown for it.

To address this problem, I implemented some unit tests using the NUnit framework, which would check to see whether every item we were looking to release had a localisation key. I included a button for this on one of the existing scriptable objects we use to house the assets we’re looking to release:

This test can also be run from the TestRunner window:

To ensure this and other tests we’ve introduced are run, I reinstated the Test stage of our CI/CD pipeline, which means they are automatically run and that we can’t release unless the tests pass. As a result of these changes, we haven’t had this issue again and we’ve introduced further tests to check for other common asset errors (and other common human errors when preparing the app for release).