Merged
Conversation
| 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"); | ||
| } |
Collaborator
Author
There was a problem hiding this comment.
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.
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.
-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
6b5f8f7 to
3bdaf74
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Test Organization and Addressables BuildLayout Testing
This PR
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
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