Skip to content

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

Merged
SteffenDE merged 1 commit into
phoenixframework:mainfrom
praialabs:test-tmp-dir
Sep 4, 2026
Merged

Write test-generated apps to installer/tmp and fix leak#6833
SteffenDE merged 1 commit into
phoenixframework:mainfrom
praialabs:test-tmp-dir

Conversation

@rhcarvalho

Copy link
Copy Markdown
Contributor

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 (3db60a5), when phoenix.new was part of the root phoenix package, tmp_path/0 resolved to <repo_root>/tmp/.
  • In 2015 (a049adb), 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 (83cb53b), 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 (#6831 (comment)).

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 (3db60a5), when `phoenix.new` was part of the root `phoenix`
  package, `tmp_path/0` resolved to `<repo_root>/tmp/`.
- In 2015 (a049adb), 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 (83cb53b), `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.
@SteffenDE
SteffenDE merged commit aecf5c7 into phoenixframework:main Sep 4, 2026
9 checks passed
@rhcarvalho
rhcarvalho deleted the test-tmp-dir branch September 4, 2026 12:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants