ALAppExtensions icon indicating copy to clipboard operation
ALAppExtensions copied to clipboard

[Event Request] Application “Tests-TestLibraries”, Codeunit 131902 "Library - Service"

Open ttaeufer opened this issue 6 years ago • 10 comments

[Event Request] Application “Tests-TestLibraries”, Codeunit 131902 "Library - Service" Pic1

Could you please insert an event before the service order is posted? Pic2

ttaeufer avatar Dec 05 '19 14:12 ttaeufer

Why do you need this?

AlexanderYakunin avatar Dec 19 '19 12:12 AlexanderYakunin

For our branch solution we need to do some settings to run the standard tests posting service orders. We try to run all standard tests successfully. So we need the possibility to do this befor posting a service order.

JoergPernberg avatar Dec 19 '19 13:12 JoergPernberg

When you simply need to use your version of library?

AlexanderYakunin avatar Dec 19 '19 13:12 AlexanderYakunin

By this we always need to change your Test Library. In my understanding the way should be to use events and create our own extension to your Test Library. By this we can use your extension without any changes.

JoergPernberg avatar Dec 19 '19 14:12 JoergPernberg

No, you should not use events for libraries, you can use events in each of test codeunits instead. You have LibraryTestInitialization for that. We do not want such changes in libraries as they serve too many test cases and common change may be a problem or overhead for test execution.

AlexanderYakunin avatar Dec 19 '19 14:12 AlexanderYakunin

Sorry, but I don't understand this. Why will a new event change the behaviour of a library for standard tests, if there is no subscriber? The creator of the event subscriber will be responsible for misbehaviour. With the same argument a new event will also be a problem in the base application or the system application. The LibraryTestInitialization is not sufficient. At this point the service order is not created. So we cannot change values at the beginning of the test execution for an record that is not present at that time.

If our approach is not correct, we would gladfully change. But at the moment I didn't see how to do this.

JoergPernberg avatar Dec 19 '19 14:12 JoergPernberg

If you change behavior of Service module posting using your extension, you need to change tests to adopt you changes. Test library should not be aware about you special extensions, it only do basic posting and some data preparation, but you can adjust posting functionality in Application for your needs. If you do this trick for test library, you tests will be useless for some scenarios. This is my opinion. I add test experts to justify, anyway my team will not add events to test libraries, we are not responsible for that. And nobody else in partner channel ask for this trick, so probably you need to think why. @PredragMaricic @nikolakukrika

AlexanderYakunin avatar Dec 23 '19 10:12 AlexanderYakunin

We have added the events to the libraries and tests in the past. Partners have asked in the past to add the events to the tests and tests libraries, so they can adopt the built in tests. This also helps the partners to avoid the code merge on the test libraries.

@AlexanderYakunin If your team does not do this, please direct to this yammer group: https://www.yammer.com/dynamicsnavdev/#/threads/inGroup?type=in_group&feedId=13879726

You can notify me of the larger number of requests and I can implement these events, it does not take that much time anyhow.

nikolakukrika avatar Dec 23 '19 14:12 nikolakukrika

This is added now for wave 1

AndersLarsen65 avatar Jan 17 '20 11:01 AndersLarsen65

Thanks for reporting this. We agree, and we’ll publish a fix asap, either in an update for the current version or in the next major release. We will update this issue with information about availability.

bc-ghost avatar Jan 17 '20 11:01 bc-ghost