Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Running integration/acceptance tests for an umbrella app in elixir

I have a project that consists of an Umbrella App. The child apps under the umbrella consist of a core/main/domain application a delivery app, a database backed repository and an in memory repository.

I would like to write a few integration tests that send http requests and check the changes in the database. As these tests require the coordination of several of the child apps these tests belong in the umbrella app and not in an individual childs test directory.

The default umbrella project does not get created with a test directory so I am unsure where they belong.

I have created a test dir and added a test_helper.exs that calls ExUnit.start and a project_test.exs test. but when I run mix test from the umbrella directory it only finds test in the apps/component/test directory and not the tests in the test directory

like image 607
Peter Saxton Avatar asked Oct 31 '22 18:10

Peter Saxton


1 Answers

The umbrella project is meant to be an umbrella facility really, you can't add code nor tests to it. I can see two options:

  1. Add the tests to the application that depends on all others (if you have one)

  2. Create another application in apps that is where you will store all integration tests

In any case, remember that ExUnit has the concept of tags and you can tag all integration tests as such and use the tag system to include/exclude tests at will. This should help you manage tests as they grow in number.

like image 161
José Valim Avatar answered Nov 09 '22 17:11

José Valim