Skip to content

Conversation

@SkowronskiAndrew
Copy link
Collaborator

@SkowronskiAndrew SkowronskiAndrew commented Dec 18, 2025

Test Organization and Addressables BuildLayout Testing

This PR

  • improves the organization of the test suite
  • adds initial test coverage for the recently added Addressables BuildLayout analysis feature.
  • adds initial test coverage for how a Unity BuildReport file is analyzed

Test Suite Reorganization

Refactored UnityDataToolTests.cs into focused test classes:

Fixed WebBundle tests so they weren't repeating unncessarily. There is only one folder of reference files but because they were added to a class inheriting from AssetBundleTestFixture they were repeated redundantly 5 times because there are 5 reference folders inside Data/AssetBundles/

Adding some comments based on study of the test framework (which has some interesting features but I found hard to grasp in its entirely uncommented from)

Introduce SQL helper to aid in performing concise test lookups and assets with better syntax.

New Addressables BuildLayout Test Coverage

New AddressablesBuildLayoutTests.cs test for Addressables BuildLayout analysis
Initial test: Analyze_BuildLayout_ContainsExpectedSQLContent

This runs "analyze" on 2 Addressables BuildLayout JSON files that i extracted from builds of our "AudioExample" test project (made with Unity 6.2 and Addressables 2.2.2)

The test does sanity checks on some expected content in
addressables_builds, addressables_build_bundles and addressables_build_groups table

New BuildReport test coverage

  • Establish a BuildReport test which show the default analyze behavior
  • Add a small BuildReport file (in its binary format) as reference data for the tests. This was created using the TestProject from
    BuildReportInspector

This sets the baseline, we will add actual specialized build report support in followup work.
Also, because it is a simple serialized file it offers opportunity for more detailed testing of the exact expected content in the database compared to more complicated AssetBundles or Player build results.

Test Results

  • All tests pass locally
  • Tests passing using the github action (windows and OSX)

The UnityDataToolTests test class repeats the test through each folder in Data/AssetBundles, but webbundle tests are covering a file in Data/WebBundles and only need to run once.
The original developer created an interesting testing approach but I felt it needed some clues for how it works.
Using two buildlayout files from building the AudioExample project.

The test does some checks of hardcoded values across some of the main tables, to confirm that the database tables were populated as expected.
This is just a "sanity check", but demonstrates how anything can be checked in the the reference data.
Assert.AreEqual(33824, reader.GetInt32(5), "Unexpected size for specific AssetBundle in build 2");
Assert.AreEqual("PackSeparately", reader.GetString(6), "Unexpected packing_mode for group");
Assert.AreEqual(0, reader.GetInt32(7), "Expected no AssetBundles found in reference folder");
}
Copy link
Collaborator Author

@SkowronskiAndrew SkowronskiAndrew Dec 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file, and the new BuildReport test are the only new tests.

The rest of the changes are just shuffling existing tests into better structure and refactors.

-Refactoring to improve syntax for running many checks against the database.

-Establish a BuildReport test which show the default analyze behavior (before we add any special handling)

-Add a small BuildReport file (in its binary format) as reference data for the tests. This was created using the TestProject from
BuildReportInspector
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants