Closed marknitek closed 4 years ago
I am not sure that the test framework supports this and every test also needs to be very carefully architected in a way that it doesn't encounter locks from other tests. If you have a lot of tests, you could spin up 2 or 3 containers and ask every container to execute some of them. Azure DevOps does (as far as I know) support to run multiple steps side by side and this solution would be safe.
Well the testframework seem to support it since its working when executed manually. I understand that it might not be something that is easy to fix or of any priority.
But to be honest i expected a discussion about that topic since it is a important topic. We need to do tests and tests are slow in BC so i thought about ways to improve it. Another idea was to implement TIA (test impact analysis) to selectivly execute only affected tests.
Running multiple containers to achieve parallel testing is a resource waste in my opinion. BC already needs so much resources to run... I dont think that test architecture is a major problem in that scenario. When running in different companies table locks are nearly impossible and tests should not affect each other. Iam a bit disapointed about the lack of discussion but maybe this is the wrong plattform
So, I can see that you are running every test in a different company, then there wouldn't be any data collision. I still think that the way the AL Test Tool is created, it doesn't take this scenario into account, but I must admit that I haven't tried. The AL Test Tool is a temporary solution and spending a lot of time in optimizing this is not a good use of my time, sorry. In the end, the modern dev. team will create a replacement, where tests can be executed through the dev. endpoint, code coverage can be achieved etc. etc. This will allow us to check which tests are covering the code we are changing and only run the tests that actually are necessary. It might also allow for parallel execution of tests. I do not have a date for this.
To improve automated tests execution time in the builds i am experimenting with different common techniques. One of them was to execute the tests in parallel by creating copies of the cronus company beforehand and then splitting the codeunits in a test suite and executing them on the different companies in parallel by using powershell jobs.
This would potentially enable a much faster build execution when having multiple tests.
When i do this i get an internal server error (500) and other errors for any job but the first one. So i guess the implementation that executes the tests in
Run-Test
does not support concurrent sessions at the moment?Since i can execute the test manually by running multiple sessions in the webclient i think it should be doable.
Can the
Run-Test
function be changed so support this scenario?Here the code i'am using for testing this (for simplicity i just want to execute the same test codeunit in all 5 companies)
Errors
Eventlog
and