Flexiana / framework

Our framework
93 stars 11 forks source link

Remove testing utilities from production code #175

Open petervlk opened 2 years ago

petervlk commented 2 years ago

Function docker-postgres! defined in namespace framework.db.core is only being used in test namespaces, whether we look at the framework codebase, its examples or the Frankie project. I doubt that I will ever be used in any production environment and for this reason I propose that it should be removed from production code.

It also invites developers to expand configuration of their projects in a manner that I personally don't consider correct.

I agree that the function is valuable for testing purposes, but if we insist on keeping and maintaining it, we should move it to a separate project which can be later used strictly as a test dependency and not to be part of a production code.

soulflyer commented 2 years ago

Move to a separate namespace that is not included in the prod uberjar.

petervlk commented 2 years ago

Move to a separate namespace that is not included in the prod uberjar.

this is a breaking change, because some some clients might be using this function. I am fine with this, since docker-postgres! is just destructuring xiana cinfig and simply building testcontainer docker instance. maybe we can move it into examples, so anyone who will need it can copy paste it

petervlk commented 2 years ago

but it is necessary to remove it if we dont want to force clients to depend on testcontiners in their production artifacts.

g-krisztian commented 2 years ago

New PR https://github.com/Flexiana/framework/pull/233