Repository contains an .al extension suggestion to setup prebuilt, shared and (generic) fresh fixture to get standard MS tests run on your solution
ALMIT
Test Fixture Initializer
The standard Microsoft Dynamics 365 Business Central test collateral contains over 33,000 by now (January 2021) automated test that cover the most part of standard functional areas like G/L, Sales, Purchase, Manufacturing, etc. If your solution has been extending any of this it makes perfect sense to get these standard tests running on your solution. As described in various posts on my blog regarding testability it's not that difficult to get that going as in most cases it's all about data.
This repo contains three parts all to be found the TestFixtureInitializer folder.
an .al extension suggestion (in TestFixtureInitializer\App) to setup prebuilt, shared and (generic) fresh fixture to get standard MS tests run on your solution.
an .al extension (in TestFixtureInitializer\Test) that contains logic to setup a test suite DEFAULT containing the tests of the MS standard tests apps that have been deployed to the database
Azure DevOps pipelines definitions based on ALOps to deploy and run MS test app(s)
With respect to the first part this schema shows how the various parts relate to each other:
Find a more detailed description on my blog.
Feel free to make use of the code, and share your suggestions for improvements by means of an issue report.
The second and third part have been effectuated as Azure DevOps pipelines. You will find a pipeline per test extension, but also 6 batches of MS test apps that could be combine as at this very moment not all MS test apps can coexist in one test suite (see more detailed info below).
Notes
If a test app is marked as excluded this means that is can not be combined with the ones included as one or more tests do fail in that batch after it has been added.
Tests-Local for w1 does not contain any tests, so, has not been included in any of the batches
The following batches constitute out of those test apps that do not influence each others tests and only disable tests that needed to be disbled to run each test app without errors on its own. Below them 4 individual test apps are listed as these coud not be part of any batch for reasons already mentiond, or, as with ERM and SCM, they are to big already.
Batch 1
Including
Excluding
Tests-Cost Accounting
Tests-Bank
Tests-SMB
Tests-CRM integration
Tests-Dimension
Tests-VAT
Tests-Fixed Asset
Tests-Job
Tests-Workflow
Tests-General Journal
Tests-Misc
Tests-Rapid Start
Tests-Prepayment
Tests-Resource
Tests-Report
Tests-Reverse
Tests-User
Batch 2
Including
Excluding
Tests-Bank
Tests-Dimension
Tests-SMB
Tests-Data Exchange
Tests-Invoicing
Tests-User
Tests-Marketing
Tests-Misc
Tests-VAT
Tests-Permissions
Tests-Prepayment
Tests-Workflow
Tests-SMTP
Tests-Report
Batch 3
Including
Excluding
Tests-Invoicing
Tests-Dimension
Tests-Marketing
Tests-Prepayment
Tests-User
Tests-Job
Tests-Graph
Tests-Misc
Tests-Report
Tests-VAT
Tests-Upgrade
Tests-Integration
Tests-Permissions
Tests-SMB
Tests-Workflow
Batch 4
Including
Excluding
Tests-Dimension
Tests-Marketing
Tests-Workflow
Tests-Graph
Tests-Misc
Tests-Integration
Tests-Report
Tests-Monitoring Sensitive Fields
Tests-Prepayment
Tests-Physical Inventory
Tests-SMB
Tests-User
Tests-VAT
Batch 5
Including
Excluding
Tests-SMB
Tests-Misc
Tests-Report
Tests-Workflow
Tests-Prepayment
Tests-VAT
Notes
Tests-Report and Tests-Misc do not go together
Tests-Report and Tests-Workflow do not go together
Batch 6
Including
Excluding
Tests-Prepayment
Tests-Misc
Tests-Report
Tests-VAT
Notes
Tests-Report and Tests-Misc do not go together
Tests-Report and Tests-VAT do not go together
Cash Flow
Including
Tests-Cash Flow
Notes
no need for a separate batch .yml, DisabledTests.json and pipeline; these do already exist
contains 389 tests (of which 22 fail today when all Cash Flow tests are run in one stretch)
Tests-Cash Flow can not be combined with other MS test app as it messes up many tests of other MS test apps (tested for Tests-Dimension, Tests-Graph, Tests-Integration, Tests-Invoicing,Tests-Marketing, Tests-Misc,Tests-Permissions)
ERM
Including
Tests-ERM
Notes
no need for a separate batch .yml, DisabledTests.json and pipeline; these do already exist
Tests-ERM should not be combined with any other MS test app as it
messes up many tests of all other MS test apps
contains almost 9000 tests (of which almost 1200 fail today when all ERM tests are run in one stretch) and execution takes more than long enough to keep this separate (4h5m on Standard E4as_v4 (4 vcpus, 32 GiB memory) Azure VM)
Misc
Including
Tests-Misc
Notes
no need for a separate batch .yml, DisabledTests.json and pipeline; these do already exist
it seems wise not to combine Tests-SCM with any other test app as it contains almost 9300 test and execution takes more than long enough to keep this separate (4h20m on Standard E4as_v4 (4 vcpus, 32 GiB memory) Azure VM)
today almost 400 tests do fail when all SCM tests are run in one stretch
VAT
Including
Tests-VAT
Notes
no need for a separate batch .yml, DisabledTests.json and pipeline; these do already exist