AXForum  
Вернуться   AXForum > Microsoft Dynamics NAV > NAV: Blogs
NAV
Забыли пароль?
Зарегистрироваться Правила Справка Пользователи Сообщения за день Поиск Все разделы прочитаны

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 28.11.2019, 19:12   #1  
Blog bot is offline
Blog bot
Участник
 
25,459 / 846 (79) +++++++
Регистрация: 28.10.2006
vanvugt: How-to: Test your Table Relations (2)
Источник: https://dynamicsuser.net/nav/b/vanvu...ns-2-263118752
==============



Having been working on a fully automated DTAP street for the past year using Azure DevOps, we are now getting in the phase of tightening the last nuts and bolts. This typically is about completing some part of the automation still, but mainly it's about getting all the sources in the right place. And with all the source I do mean all the sources. Any source that relates to some part of our solution and needs to be deployable in whatever part of our DTAP street, should become part of this automated street. This also includes add-on .fobs delivered by our vendors. So far, we had not included them all as typically these do not change regularly

The other day, however, we did get an update of one of the add-ons and needed to deploy them starting at the D-side of our DTAP street. My first reflex was the old-fashioned way of manually importing the .fob into the database. But wait ... which database? Of course first my D(evelopment) database. No problem. But here my mind did not stop asking: ."And then?" Indeed, T(est), being 3 databases, and A(cceptance), another 3 databases, and finally P(roduction), 2 more databases. Not even including the other D databases of my fellow developers and the updated end-user license. Having , at long last, our automated street in an almost good shape, we had agreed that any deployment should be done using the automation. No manual actions anymore. So, I found out that one of the nuts still needed to be tightened, was to get the add-on .fob included in the build and release pipelines. I was very pleased to find out that it was much simpler than I had thought. Praise to the way the build and release pipelines had initially been setup. Thanx, Richard!

The .fob and the update end-user license got deployed to the various databases quite easily, but then another issue came around, which brings us to the topic of this post. Once deployed our automated tests were triggered resulting in two failing test leading back to the add-on:
  • The type of Table xxxxxxxx in Field yy is incompatible with Table zzzzzzzz Field 1
  • Assert.RecordCount failed. Expected number of AllObj entries: 49. Actual: 42
Having been around with standard automated tests for a while already, as you might know, I could easily trace these back to the tests ValidateFieldRelationCompatibility in codeunit 134926 (Table Relation Test) and ShortcutDimensionsUpdatedOnDimSetIDValidation in codunit 134380 (ERM Dimension). The later I will leave for now and spend another post on it later. However, regarding the first issue I had to conclude to my dismay that our add-on vendor apparently had never read my first How-to: Test your Table Relations. Which made me immediately wonder if they do have test automation at all!

I reported the issue to vendor and, wow, did get a fix almost immediately returned which I checked into our source repository and got the whole DTAP street automation running. Ouch, a similar issue occurred on another table in the add-on. didn't they still run this test themselves? Shame on you! With the second bug report the "message" had been received as the next returned fix did contain all the fixed tables.

As I concluded the initial how-to post, that "... if, after all my previous posts on the test toolkit, you're still looking for reasons to start using it ... now you have surely one (more), be it a small, and very useful one." If you want to get your solution converted from C/AL to AL at least run this one test codeunit to be sure that all your table relations are OK. While not yet released as an AL extension you can still change data types like you might have been used to in C/AL. But once an extension has gone live you face the new world we are living in: fields can no longer be changed like you used. Basically, you're stuck with it for a while. And run the test form day one on each of your AL extensions, just to be sure table relations are healthy.

BTW: might a table relation be unhealthy for a valid reason your can exclude it from the test by adding it to the ExcludeKnownInvalidTableRelationsFromBeingChecked function subscribing to its OnAfterRemoveTableRelation publisher. Make that subscriber part of your extension so any time codeunit 134926 is run in an environment with your extension in it it will not fail.




Источник: https://dynamicsuser.net/nav/b/vanvu...ns-2-263118752
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
vanvugt: How-to: Test your Table Relations Blog bot NAV: Blogs 0 23.05.2018 02:26
vanvugt: Let's talk about Shared Fixture and how to profit from this with the Dynamics NAV Test Toolkit Blog bot NAV: Blogs 0 22.03.2018 22:13
saurav-nav: NAV 2018 - Lots of New Objects! Blog bot NAV: Blogs 0 04.12.2017 10:11
NAV Team: Test Automation and Test Data Blog bot Dynamics CRM: Blogs 0 01.10.2010 12:56
wiki.dynamicsbook: Changes Made in Navision Attain 3.60 Blog bot Dynamics CRM: Blogs 0 02.09.2008 13:23
Опции темы Поиск в этой теме
Поиск в этой теме:

Расширенный поиск
Опции просмотра
Комбинированный вид Комбинированный вид

Ваши права в разделе
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.
Быстрый переход

Рейтинг@Mail.ru
Часовой пояс GMT +3, время: 00:28.
Powered by vBulletin® v3.8.5. Перевод: zCarot
Контактная информация, Реклама.