Skip to content

phoenixframework/phoenix

Back Write test-generated apps to installer/tmp and fix leak (#6833)

Commit details

Write test-generated apps to installer/tmp and fix leak (#6833)

Description

Consolidate all temporary Phoenix application generation across test suites into `installer/tmp/`, and fix the accumulation of empty directories created by integration tests. Git archaeology: - In 2014 (3db60a5ed), when `phoenix.new` was part of the root `phoenix` package, `tmp_path/0` resolved to `<repo_root>/tmp/`. - In 2015 (a049adba8), the installer was extracted into it's own package in `installer/`, and `/installer/tmp/` was added to `.gitignore`. However, because of a change in directory structure, the helper accidentally continued to resolve to `<repo_root>/tmp/`. This oversight probably went unnoticed because the root `/tmp/` was already gitignored. - In 2020 (83cb53ba0), `integration_test/` was introduced. It used `installer/tmp/` to satisfy the `phx.new --dev` requirement. However, `with_installer_tmp/3` only deleted the inner project path and left behind empty 10-character random directories. With this change: 1. Both `phx.new` (`installer/test/`) and `phx.gen.*` tests (`test/mix/tasks/`) now write to `installer/tmp/` instead of `<repo_root>/tmp/`. 2. Integration tests continue writing to `installer/tmp/`, and leave no dangling directories behind. This enables uniform `tmpfs` mounting in CI.

Metadata

Author
Rodolfo Carvalho rhcarvalho@gmail.com
Committed
Commit

Contributors

  • Rodolfo Carvalho rhcarvalho@gmail.com Author