How is the Test Pyramid applied?
Unit Tests
Unit tests focus on the business logic. This is the core of the application and should be fast and easy to test.
The business logic of the Arnold Subdiv Manager is, for example, to check if the MtoA Plugin should be loaded or not. All tests for the business logic are unit tests and can be executed outside of Maya to make them fast. This is achieved through the encapsulation and abstraction of the Maya API.
Integration tests
Some tests require to run inside Maya, for example, code that tests the correct selection of meshes in Maya.
They are marked with @maya_only
, so they are skipped when the tests are executed outside of Maya.
To ensure that SubDivManager
and MayaAbstractionImplementation
and Arnold work correctly together, there is an integration test.
This test activates and deactivates rendering as a subdivision surface on a cube and renders an image.
The image is compared to reference images to ensure correct results.
Integration tests like this can be flaky.
The test will fail if no Arnold License is available.
Integration tests should not be used to validate every tiny detail of every component.
They only should ensure that different components work together correctly.
UI Tests
The Arnold Subdiv Manager has a UI which has to be tested as well. In this case, the UI is quite simple, so it’s only verified that the business logic’s correct methods are called. Details can be found in section SubDivUi. The UI tests are not run inside Maya because the tests are run in Maya’s batch mode, where no UI is available.