Business Central V17.1 fails your pipeline .. and that’s OK

A few days ago, we upgraded our product from 17.0 to 17.1. We had been looking forward to this release, because we usually never release a product or customer on an RTM release of Business Central. So .. finally 17.1, finally we could continue to upgrade the product and start releasing this to customers before the end of the year.
While this was just a minor upgrade .. things started to fail. We have quite some apps to build, and some of them had many failing tests.

All these failing tests for just a minor upgrade? That never happened before.
What happened? Well …

From Microsoft Dynamics 365 Business Central 17.1, Microsoft enabled upcoming features

You are probably aware of the new “feature” in Business Central, called “Feature Management“. A new functionality that lets users enable upcoming features ahead of time. It indicates which features are enabled, when they would be released, and it gives you the possibility to enable them in a certain database (usually a demo or sandbox to test the feature).
From 17.1, Microsoft enables 5 of these features out-of-the-box in the Cronus database that comes with the DVD or Docker Artifact.

Now, these features is business logic. So, by enabling them, you’re going to enable new business logic. New business logic in an upgraded database means: a difference in behavior. A difference in behavior in a database with a crapload of tests, usually means …

Failing tests

Exactly: DevOps will execute your tests against a new Cronus database where these features are enabled, so your tests will fail, your pullrequests will fail, … basically your developments will come to a halt :-).
This needs immediate attention, because before being able to continue development/testing/.. this needs to get fixed.

My first focus was looking at the cause of these failing tests: “a changed database with new business logic, features that are actually still not really released, just part of the database as an upcoming feature. So, how can I change my docker image to be a correct one with correct enabled features??”. Or in other words: I was looking at docker to solve this problem.

And I was wrong….

It was actually a remark from Nikola Kukrika (Microsoft) on my twitter thread that made me look at it from a different angle. Sure, my tests fail because of the enabled features. But this is actually good and useful information: they tell you the current business logic is not compatible with the upcoming feature, and I should also indicate that in code by disabling the feature during the tests. Doing so, I actually also give myself a “todo-list” and a deadline: all disabled features need to get enabled (or in other words: I need to make my software compatible with the upcoming version of the business logic) – and even more: it will fail again from the moment the features are actually released. So you kind of get warned twice. Looking at it from this angle: you WANT these failing tests during an upgrade.

Luckily, disabling the tests wasn’t so difficult. This is what we did:

And tests are working again :-)!

5.00 avg. rating (97% score) - 1 vote

Permanent link to this article: https://www.waldo.be/2020/11/13/business-central-v17-1-fails-your-pipeline-and-thats-ok/

3 comments

2 pings

  1. Indeed, failing test to the rescue. Something a lot of us have to get used to: to be happy with failing test (on the premiss that app and test where in bal;ance before)

    • Frédéric Vercaemst on November 13, 2020 at 9:24 am
    • Reply

    Wouldn’t it also make sense if your Add-on gets installed, to prevent consultants / users from enabling a feature (if they would have the required permissions) since the feature is not compatible (yet) with the add-on and might result in the same failures?

      • waldo on November 13, 2020 at 9:26 am
        Author

      Absolutely .. in fact, I’m doing that as we speak ..

  1. […] Business Central V17.1 fails your pipeline .. and that’s OK […]

  2. […] Source : Waldo’s Blog Read more… […]

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: