Performing integration / acceptance tests for an elixir umbrella application

I have a project that consists of a Umbrella application. Children's applications under an umbrella consist of a main / main / domain application of a delivery application, a repository with database support and storage in the repository.

I would like to write some integration tests that send HTTP requests and check for changes in the database. Since these tests require coordination of several child applications, these tests belong to the umbrella application, and not in a separate childs test directory.

An umbrella project is not created by default using the test directory, so I'm not sure where they are.

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

+5
source share
1 answer

An umbrella project should be an umbrella tool; you cannot add code and tests for it. I see two options:

  • Add tests to the application that depend on everyone else (if any)

  • Create another application in applications where you will store all integration tests

In any case, remember that ExUnit has a tag concept, and you can mark all integration tests as such and use the tag system to include / exclude tests as desired. This should help you manage your tests as they grow.

+2
source

Source: https://habr.com/ru/post/1232464/


All Articles