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 and adds initial test coverage for the recently added Addressables BuildLayout analysis feature.

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)

Ne 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

Test Results

All tests pass locally and they passed on the github action.

Current stats:

  • ✅ 120 tests in UnityDataToolAssetBundleTests
  • ✅ 2 tests in UnityDataToolPlayerDataTests
  • ✅ 11 tests in WebBundleSupportTests
  • ✅ 1 test in AddressablesBuildLayoutTests

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

Choose a reason for hiding this comment

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

Above is the only new test code.

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

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