Data Table Testing

In order to help ensure data related bugs are found and fixed prior to releasing updates we have added a new system with the ability to run sanity checks on datatables.

Usage

In Editor

The easiest way to run the tool is by going into the editor, and running it from the toolbar there (Edit > Exiles Tools > Commandlets > Check DataTables).

This will freeze the editor for a short time, then the results will be visible in the output log. You can filter by CheckDataTables to get the relevant lines.

You can enter the names of the tests you want to run as a comma separated list in the Arguments field to avoid running the whole test suite

Commandlet

The tool can also be run by launching a commandlet (CheckDataTables) this can be done by starting the editor with the commandline argument :

-run=CheckDataTables <potential commandline arguments>

This will run the commandlet which will run the tests and print out any errors it finds. The result will be saved into ConanSandbox.log.

Similar to data table checks, we can run checks on any blueprint as explained here: Public Blutilities w Example

How to define a Test to the system

The tests are defined entirely in blueprints, and can be created in 3 steps.

When creating the test functions there are a few key points to be aware of :

Now I will show the creation of some basic ItemTableTests. First we create the blueprint:

Now we need to define the row structure that we want our test to operate on, we do this by overriding the function “Get Row Structure“:

In this case we want to test the ItemTable, which has the structure type “ItemTableRow“, so our GetRowStructure function should look like this:

Now we create our new function, TestAttachReach, and make sure it has two input pins of the right types, and NO outputs:
- Item Table Row (or whichever row you defined in GetRowStructure)
- FName (Should contain the row name corresponding to the struct)

Now in our function we can define our test, and set an error message if the test fails:

Pre-computing some logic before running the tests

Some test classes might require to cache some data to make running tests more efficient. For instance, the test “TestXXRecipe” that makes sure that no visible recipe has the prefix “XX_” needs to go through the whole FeatTable to see if a feat is providing that recipe as a reward.

Instead of going through the whole table for every recipe row to test, we can use a pre-compute step where all the visible recipes will be cached in a set. It can be done by overriding PreTestActions in the event graph:

This function will be called before any test is run, but after the ModControllers have merged the DLC tables into their respective base tables.

Additional Helper Events

In case we need to even more control over the data table tests we have 2 more events, one triggering after the tests ( Post Test Action ) and one triggering for each datatable ( Per Asset Action )

Test Exclusion

In case we want to exclude some of the tests from the global run, we can toggle the IsExcludedFromRegularTest variable in the test blueprint

In that case the only way to run the test from this file is via argument

Current Tests

All current tests can be found under /Content/Dev/DataTableTests: