Code Coverage ( page 9990 does not work as expexcted )
One of the requirement for extension submission is that tests cover 90% of the code. Quote: "The test package must include at least 90% code coverage."
We have written some test functions and they pass, how can we check if we have achieved 90% code coverage, or what have we missed.
I was trying to use page 9990, which does show some code in our codeunits. If I try to filter by object ID range that we were assigned, then I get 0 lines.
Please provide examples / documentation, how can we check if we meet this requirement.
- AL Extension Version: 2.0.42188
- Server Version: W1 13.0 (24284)
Thanks, Gregor
Hi @gregoral, Could you try setting "ShowMyCode" in the app.json file, publish the app and try again.
Hi. I have ShowMyCode set to true. I do get functions in my test codeunit, but no pages show in code-coverage. Might this be because tests actually use TestPage instead of Page variables?
Thanks.
This is my app.json: { "id": "*********************************", "name": "Adriatic Localization for Business Central", "publisher": "Adriatic.org", "brief": "", "description": "", "version": "1.0.0.0", "privacyStatement": "", "EULA": "", "help": "", "url": "", "logo": "", "capabilities": [], "dependencies": [], "screenshots": [], "platform": "13.0.0.0", "application": "13.0.0.0", "test": "13.0.0.0", "features": [ "TranslationFile" ], "helpBaseUrl": "https://docs.microsoft.com/{0}/dynamics365/business-central/", "supportedLocales": [ "en-US","hr-HR","sr-Latn-RS","sl-SI" ], "showMyCode": true, "idRange": { "from": 13062525, "to": 13063524 } }
Are there any updates regarding this issue? Is any additional input needed?
Code Coverage is not yet supported for AL. It is on our backlog with a relatively high priority.