Closed horstoeko closed 1 year ago
I normally argue against using test suites and instead run tests using the extension id. That is a more future safe way of running tests - IMO. At some point in time in the future, I think test suites will be history (might be a long time), but I think people should use the new (and more stable) way of running tests.
If you still want to use a test suite - you can override the RunTestsInBcContainer scriptblock parameter in Run-AlPipeline and modify the parameters before calling Run-TestsInBcContiainer.
Thank you for your comprehensive answer. I will do it for now so that we will create our own ScriptBlock and use it as you suggested. We will then perspectively adapt our approach in this regard to the future circumstances.
Many, many thanks
Hi @freddydk ,
I would like to ask one more question in this context: We spent some time last night detaching the test suites and starting the tests via the AppID.
Run-ALPipeline
finds our TestApp, as you can see in the following picture:
However, no tests are started, as you can see in the following image:
If we use our own ScriptBlock (with calling the tests via the corresponding TestSuites) the tests are run correctly.
We use the following call for Run-ALPipeline
:
Run-AlPipeline `
-containerName $buildSettings.ContainerName `
-artifact $DockerContainerBCArtifact `
-baseFolder $baseFolder `
-appFolders $appFolderList `
-testFolders $testFolderList `
-enablePerTenantExtensionCop `
-appVersion ($newVersion.Major.ToString() + "." + $newVersion.Minor.ToString()) `
-appBuild $newVersion.Build `
-appRevision $newVersion.Revision `
-buildArtifactFolder $artifactsDirectory `
-azureDevOps `
-installPerformanceToolkit `
-installTestFramework `
-installTestLibraries `
-installTestRunner `
-testResultsFormat "JUnit" `
-testResultsFile "testresults"
What are we possibly doing wrong or where is our thinking error?
Many thanks for your support in advance...
Hard to say, but you can compare with this: https://github.com/BusinessCentralApps/BingMaps.PTE/tree/main/BingMaps.Test
Which is a test app containing a number of tests. Do you still have your install codeunit, which creates the test suite? (That might throw things off)
Hi,
I dove a little deeper into the BcContainerHelper code yesterday and realized the "problem". If you don't specify a TestSuite, then DEFAULT is assumed to be the TestSuite apparently (see Get-Tests
in PsTestFunctions.ps1) . This test suite was empty in my case. Now that I had added all our tests to the DEFAULT TestSuite, our tests were also run. So obviously no problem from the BcContainerHelper.
Thanks again for the support and the wonderful and great work on the BcContainerHelper.
Regards
Hi,
we would like to specify one ore more TestSuites when using
Run-ALPipeline
. Unfortunately, currently only the specification of an AppId is possible. We have an install code unit in our TestApp (which contains all our tests) that creates several TestSuites automatically. The names (codes) are known to us. We would imagine the specification similar toRun-TestsInBCContainer
:The parameter should be either a string or an array of TestSuite codes.
Do you see any way to implement this?
Thank you in advance.