AL icon indicating copy to clipboard operation
AL copied to clipboard

Run-TestsInBcContainer does not run any test after RAD publish

Open gntpet opened this issue 3 years ago • 10 comments

I do use Run-TestsInBcContainer to run my tests from powershell. When I publish my test app using Ctrl+F5, all works fine. It find tests and excutes them. Immediately, after running my tests, I republish my solution using RAD (Alt+F5). Then, if I execute Run-TestsInBcContainer, it does not do anything, seems like it does not find any tests to run.

I check AL Test Tool (page 130451), it's completely empty there. But, if I try to 'get test codeunits', I can select my codeunits and add them.

image

I'm using this command to run tests

Run-TestsInBcContainer -containerName base -companyName 'TNM Automated Test' -tenant default -credential (Get-StoredCredential gps) -extensionId "0c451cb7-84c8-4171-9a79-98c7f201ec6a" I'm using BcContainerHelper version 4.0.5

I'm not sure if it's an issue with AL (RAD) or bccontainerhelper issue. If, you need more info, please let me know.

Best Regards, Gintautas

gntpet avatar Oct 10 '22 14:10 gntpet

2 questions After running Run-Tests - what is the content of the AL Test Tool? Could you add -debugMode to your run-testsinBcContainer and paste the output here?

freddydk avatar Oct 14 '22 04:10 freddydk

when I publish with Ctrl+F5 & run tests, I can see tests & their results within AL Test Tool. then, I publish with RAD (Ctrl+Alt+F5). Tests & their results are still visible within AL Test Tool but then, if I run tests with Run-TestsInBcContainer, it does not execute any test and all previous test & their results dissapears from AL Test Tool

Here's the the 'debug' output, when running test after RAD publishing

Run-TestsInBcContainer -containerName base -companyName 'TNM Automated Test' -tenant default -credential (Get-StoredCredential gps) -extensionId "0c451cb7-84c8-4171-9a79-98c7f201ec6a"  -debugMode
Connecting to http://localhost:80/BC/cs?tenant=default&company=TNM%20Automated%20Test
Run-Tests, open page 130455
Show form 0001fd97-0000-0001-0c00-0000836bd2d2
Title: Command Line Test Tool Edit - Command Line Test Tool - DEFAULT
Setting Extension Id 0c451cb7-84c8-4171-9a79-98c7f201ec6a
Using new test-runner mechanism
Invoke RunNextTest
Result: 'All tests executed.'

gntpet avatar Oct 14 '22 09:10 gntpet

@nikolakukrika - do you know why there is a difference whether the app is installed using normal or RAD when running the PowerShell commands to run tests???

freddydk avatar Oct 14 '22 09:10 freddydk

I do have a repro of this. Will file a bug on the R&D team to get this fixed.

freddydk avatar Oct 30 '22 20:10 freddydk

The problem is that the AL Test Tool doesn't locate the tests when inserting the extensionid and pressing enter:

image

freddydk avatar Oct 30 '22 20:10 freddydk

I see the same case was reported in Yammer back in 2020. You even fixed something in navcontainerhelper for it. But, i don't think it was solved for RAD case. Check the discussion here: https://www.yammer.com/dynamicsnavdev/threads/647514850279424

gntpet avatar Oct 31 '22 12:10 gntpet

I think that fix was something for skipped tests in BC 16 - here: https://github.com/microsoft/navcontainerhelper/issues/981 Not related to the original problem in that Yammer thread.

freddydk avatar Oct 31 '22 12:10 freddydk

Will move this issue to the AL repo.

freddydk avatar Oct 31 '22 12:10 freddydk

This has slipped through the cracks because it wasn't labeled correctly for a long time, is the issue still occurring on the latest BC version?

I suspect it is because we haven't touched RAD in a while.

thloke avatar Sep 10 '24 01:09 thloke