Overriding expression functions
Hi there 👋,
I would love to mock the implementation of the utcNow() function to make my tests deterministic.
Reading the docs, it should be possible via FunctionRepository.register. However, I am getting the error "type[FunctionsRepository]" has no attribute "register", which kinda makes sense because this class does not have a function called register. Searching this repository also does not yield any other results regarding this functionality.
Am I missing something?
Hi @MarvinSchenkel,
Thanks for reporting!
That makes a lot of sense and used to be possible with the FunctionRepository.register function. However, since we changed the framework's approach from a pure python implementation to leveraging the logic apps expression runtime nuget package, this is not possible anymore.
I think this is an important feature to have, let me get back to you later!
@MarvinSchenkel, we figured out a way how to mock the non-deterministic functions like utcnow and guid. @jayachithra and @LeonardHd are working on implementing it.
Great news! Thanks for the update
Hi @MarvinSchenkel,
I just wanted to share that we are still working on the mocking capabilities. We need to release another version of the underlying evaluation engine and make sure that the mocking API has a somewhat coherent, easy to use, and extensible API. We will update this issue once we have enough confidence to release the mocking capabilities.