This fixture is a small real Mix project used by ArchTest integration tests. It is compiled before the root test suite runs, then ArchTest reads its BEAM files from:
test/support/fixture_app/_build/dev/lib/fixture_app/ebin
The app intentionally contains both valid and invalid architecture edges so the tests can prove success and failure paths.
FixtureApp.Ordersis the public Orders API.FixtureApp.Accountsis the public Accounts API.FixtureApp.Inventoryis the public Inventory API.FixtureApp.Repois persistence infrastructure.FixtureApp.Webis the web-facing layer.
Intentional violations:
FixtureApp.Orders.CheckoutcallsFixtureApp.Inventory.Repo.FixtureApp.Orders.OrderServicecallsFixtureApp.Repo.OrderRepo.FixtureApp.Web.ControllercallsFixtureApp.Repo.OrderRepo.FixtureApp.Domain.CycleAandFixtureApp.Domain.CycleBform a cycle.
docs/components.puml documents the current known slice dependencies:
@startuml
[Orders] --> [Accounts]
[Orders] --> [Inventory]
[Orders] --> [Repo]
[Web] --> [Repo]
@endumlThe test suite checks this diagram with:
ArchTest.PlantUML.enforce("test/support/fixture_app/docs/components.puml",
graph: graph,
slices: [
accounts: "FixtureApp.Accounts",
inventory: "FixtureApp.Inventory",
orders: "FixtureApp.Orders",
repo: "FixtureApp.Repo",
web: "FixtureApp.Web"
])If the compiled code adds a new cross-slice dependency that is missing from the diagram, the PlantUML test fails.
See test/arch_test/fixture_app_examples_test.exs for executable examples of:
- PlantUML conformance against a real
.pumlfile. define_slices_by/2using the real fixture modules.ArchTest.Collector.calls_from_path/2with real file and line metadata.ArchTest.Rulewith ignore filters on real dependency violations.- New metrics such as
afferent/2,efferent/2, anddependency_depth/2.