Cyclic dependency in test cases

I have three apps in umbrella project setup

  1. Datalayer
  2. ApiLayer
  3. OtherLayer Some Other layer(but mandatory)

Now I have dependencies defined like this in mix file
App ApiLayer has

{:OtherLayer, in_umbrella: true},
{:Datalayer, in_umbrella: true}

App Datalayer has no dependency of the umbrella apps
App OtherLayer has

{:Datalayer, in_umbrella: true}

But test cases which are being called from app ApiLayer needs to call context defined in Datalayer and context of Datalayer in turn needs to access some functionalities to OtherLayer but can’t. because if I add its dependency in Datalayer. This will be cyclic dependency case. I need to pass my test cases. is there some way to load some chunk of the code without creating cyclic dependency?
Any help will be appreciated. Thanks

I have tried some solutions like dynamically requiring that module but didn’t work and tried ensure_all_started option in test_helper but got
{:error, {:m, {:invalid_restart_type, :data_layer}}}