AL icon indicating copy to clipboard operation
AL copied to clipboard

Code Coverage ( page 9990 does not work as expexcted )

Open gregoral opened this issue 8 years ago • 4 comments

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

gregoral avatar Sep 18 '18 21:09 gregoral

Hi @gregoral, Could you try setting "ShowMyCode" in the app.json file, publish the app and try again.

thpeder avatar Sep 19 '18 07:09 thpeder

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 } }

gregoral avatar Sep 19 '18 07:09 gregoral

Are there any updates regarding this issue? Is any additional input needed?

gregoral avatar Oct 10 '18 06:10 gregoral

Code Coverage is not yet supported for AL. It is on our backlog with a relatively high priority.

StanislawStempin avatar Oct 25 '18 08:10 StanislawStempin