Skip to content

Instantly share code, notes, and snippets.

@vorce
Last active September 21, 2022 14:38
Show Gist options
  • Save vorce/2e9354f2d9a1a1c7cf0b55e0180f9f18 to your computer and use it in GitHub Desktop.
Save vorce/2e9354f2d9a1a1c7cf0b55e0180f9f18 to your computer and use it in GitHub Desktop.
Mermaid sequence diagram of ExUnit Runner

sequenceDiagram ExUnit.Runner->>+ExUnit.Server: {:take_async_modules, count} ExUnit.Server->>-ExUnit.Runner: [AsyncModule1Test, AsyncModule2Test, ...] ExUnit.Runner->>+ExUnit.EventManager: {:module_started, %ExUnit.TestModule{module: AsyncModule1Test}} ExUnit.EventManager->>+ExUnit.CLIFormatter: {:module_started, %ExUnit.TestModule{}} ExUnit.EventManager->>+CustomFormatter: {:module_started, %ExUnit.TestModule{}} loop Every test case ExUnit.Runner->>+ExUnit.EventManager: {:test_started, %ExUnit.Test{tags: t}} ExUnit.EventManager->>+ExUnit.CLIFormatter: {:test_started, %ExUnit.Test{tags: t}} ExUnit.EventManager->>+CustomFormatter: {:test_started, %ExUnit.Test{tags: t + c}} Note right of ExUnit.Runner: Test context c merged into tags ExUnit.Runner->>+ExUnit.EventManager: {:test_finished, %ExUnit.Test{tags: t + c}} ExUnit.EventManager->>+ExUnit.CLIFormatter: {:test_finished, %ExUnit.Test{tags: t + c}} ExUnit.EventManager->>+CustomFormatter: {:test_finished, %ExUnit.Test{tags: t + c}} end ExUnit.Runner->>+ExUnit.EventManager: {:module_finished, %ExUnit.TestModule{tests: [%ExUnit.Test{tags: t + c}, ...]}} ExUnit.EventManager->>+ExUnit.CLIFormatter: {:module_finished, %ExUnit.TestModule{tests: [%ExUnit.Test{tags: t + c}, ...]}} ExUnit.EventManager->>+CustomFormatter: {:module_finished, %ExUnit.TestModule{tests: [%ExUnit.Test{tags: t + c}, ...]}}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment