Skip to content

phoenixframework/phoenix

Back Split integration test suites into focused async modules (#6826)

Commit details

Split integration test suites into focused async modules (#6826)

Description

* Split integration test suites into focused async modules Previously, integration tests were bundled into 7 monolithic test files. Because ExUnit parallelizes test execution across *modules* while executing tests *serially* within each module, this structure created two major bottlenecks: 1. Low concurrency at startup: Only 7 worker processes could run at T=0, underutilizing runners configured with higher concurrency (e.g. 8 workers in GitHub Actions). 2. Idle worker tail: Faster modules (such as SQLite or basic generators) finished early, leaving most worker processes sitting completely idle while the suite's wall-clock time was bounded by the slowest monolithic modules (`AppWithScopesTest` and `UmbrellaAppWithDefaultsTest`). This splits the integration test suites into 33 focused, granular modules all marked with `async: true`: - Preserve all 53 tests. - Individual test modules should run under 3m00s. - Fix a missing `@tag database: :sqlite3` on `test "has a passing test suite (--no-live)"`. - File/module names follow the pattern `app_with_{postgres,mysql,mssql,sqlite3}_adapter{,_auth_{html,live},_html,_json,_live,_scopes}_test.exs` (and umbrella counterparts). - Postgres adapter test modules explicitly named for symmetry with the other database adapters (instead of "Default"). - Short, systematic app names per module to guarantee test database isolation when executing concurrently against PostgreSQL, MySQL, and MSSQL while ensuring all generated code strictly satisfies `mix format` line-length limits. - Update documentation in `integration_test/README.md` with rationale. * Format test execution timeline into compact concurrent worker lanes Previously, the Mermaid execution chart in SummaryFormatter rendered every test module on its own row, creating dozens of vertically stacked rows that consumed significant space in GitHub Step Summaries. This update: - Implements greedy interval scheduling to pack non-overlapping module executions into virtual worker lanes (corresponding to concurrent slots). - Configures Mermaid `displayMode: compact` so tasks within each lane render on a single horizontal row. - Disables Mermaid's default `todayMarker` to prevent a misplaced real-time vertical line across the relative mm:ss timeline. - Shortens module names for the Gantt timeline (e.g. `PostgresAuth` instead of `AppWithPostgresAdapterAuthTest`) to prevent SVG label collisions in compact boxes while retaining full names in the tables. - Highlights the single slowest module with `:crit` to clearly surface the primary test bottleneck. - Uses deterministic sorting with module name tie-breakers and efficient head-prepending in lane accumulation.

Metadata

Author
Rodolfo Carvalho rhcarvalho@gmail.com
Committed
Commit

Contributors

  • Rodolfo Carvalho rhcarvalho@gmail.com Author