Closed ralf-escher closed 5 years ago
What other parameters are you using?
Hent Outlook til iOShttps://aka.ms/o0ukef
Fra: Ralf Escher notifications@github.com Sendt: Friday, October 11, 2019 9:12:37 AM Til: microsoft/navcontainerhelper navcontainerhelper@noreply.github.com Cc: Freddy Kristiansen Freddy.Kristiansen@microsoft.com; Mention mention@noreply.github.com Emne: [microsoft/navcontainerhelper] Run-TestsInBCContainer -returnTrueIfAllPassed (#660)
I am using Run-TestsInBCContainer to test my integration test functions and I am a little confused about the -returnTrueIfAllPassed parameter
If I use the Run-TestsInBCContainer without that parameter it shows no output (if I assign XUnitResultFileName I can check the result file)
If I now add the -returnTrueIfAllPassed parameter it shows the executed codeunits with success/failure and if all functions have passed true at the very end.
I would have expected that the routine shows the executed codeunits without the -returnTrueIfAllPassed parameter and with the parameter only "true" if all functions have passed. Or I am wrong?
my example:
Standard Passed (no output)
Standard Passed with -returnTrueIfAllPassed
Codeunit 5043082 Automotive Test Sales Success (115.742 seconds) True
Standard Failed (no output)
Standard Failed with -returnTrueIfAllPassed
Codeunit 5043083 Automotive Test Purchase Failure (10.322 seconds) Testfunction InboundPurchaseInvoice Failure (4.127 seconds)
navcontainerhelper 0.6.4.9 docker image mcr.microsoft.com/businesscentral/onprem:1910-de-ltsc2019
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fmicrosoft%2Fnavcontainerhelper%2Fissues%2F660%3Femail_source%3Dnotifications%26email_token%3DACSGUA4I5GF5NRBSMNOGNM3QOAROLA5CNFSM4I7V63WKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HRECCHQ&data=02%7C01%7Cfreddy.kristiansen%40microsoft.com%7Cb9e06c2141f640f2208308d74e1a65cd%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637063747593239558&sdata=TzhZQGiZXnV5KIKJLIoKk%2FJHljp7oFJZJdLqL4%2F0d9E%3D&reserved=0, or unsubscribehttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FACSGUA6G7X3T3Y3MDQJCES3QOAROLANCNFSM4I7V63WA&data=02%7C01%7Cfreddy.kristiansen%40microsoft.com%7Cb9e06c2141f640f2208308d74e1a65cd%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637063747593249557&sdata=odVIwgEDA%2FKFA1fu6l%2FvCNqeQ6ftq7vVMtMhkw%2B5XD0%3D&reserved=0.
Reason for asking is, that the returntrueifallpassed will only affect one thing - and that is the return value from the function. So you must have an error in the script - please include your full command, then I can maybe see what you do wrong?
Run-TestsInBCContainer `
-containerName $containerName `
-companyName $companyName `
-testCodeunit $codeunitID `
-returnTrueIfAllPassed
PS C:\> Run-TestsInBCContainer -containerName Industry27 -companyName TESTMANDANT -testCodeunit 5043081
PS C:\> Run-TestsInBCContainer -containerName Industry27 -companyName TESTMANDANT -testCodeunit 5043081 -returnTrueIfAllPassed
Codeunit 5043081 Automotive Test Basic Success (0.225 seconds)
True
PS C:\> Run-TestsInBCContainer -containerName Industry27 -companyName TESTMANDANT -testCodeunit 5043083
PS C:\> Run-TestsInBCContainer -containerName Industry27 -companyName TESTMANDANT -testCodeunit 5043083 -returnTrueIfAllPassed
Codeunit 5043083 Automotive Test Purchase Failure (7.553 seconds)
Testfunction InboundPurchaseInvoice Failure (2.993 seconds)
Going to use -XUnitResultFileName
which doesn't change the behavior.
Are you running as administrator?
No.
Now as administrator:
PS C:\BE-terna\PowerShell> Run-TestsInBCContainer -containerName Industry27 -companyName TESTMANDANT -testCodeunit 5043081
Codeunit 5043081 Automotive Test Basic Success (0.237 seconds)
PS C:\BE-terna\PowerShell> Run-TestsInBCContainer -containerName Industry27 -companyName TESTMANDANT -testCodeunit 5043081 -returnTrueIfAllPassed
Codeunit 5043081 Automotive Test Basic Success (0.205 seconds)
True
Got it - that is a bug. Not that it doesn't display it - but the return value will actually be an array if you use -returntrue and run as non-admin
Fix included in 0.6.4.10
Hello @freddydk,
I am using
Run-TestsInBCContainer
to test my integration test functions and I am a little confused about the-returnTrueIfAllPassed
parameterIf I use the
Run-TestsInBCContainer
without that parameter it shows no output (if I assignXUnitResultFileName
I can check the result file)If I now add the
-returnTrueIfAllPassed
parameter it shows the executed codeunits with success/failure and if all functions have passedtrue
at the very end.I would have expected that the routine shows the executed codeunits without the
-returnTrueIfAllPassed
parameter and with the parameter only "true" if all functions have passed. Or I am wrong?my example:
navcontainerhelper 0.6.4.9 docker image mcr.microsoft.com/businesscentral/onprem:1910-de-ltsc2019