Write test-generated apps to installer/tmp and fix leak - #6833
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
phoenix.newwas part of the rootphoenixpackage,tmp_path/0resolved to<repo_root>/tmp/.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.integration_test/was introduced. It usedinstaller/tmp/to satisfy thephx.new --devrequirement. However,with_installer_tmp/3only deleted the inner project path and left behind empty 10-character random directories.With this change:
phx.new(installer/test/) andphx.gen.*tests (test/mix/tasks/) now write toinstaller/tmp/instead of<repo_root>/tmp/.installer/tmp/, and leave no dangling directories behind.This enables uniform
tmpfsmounting in CI (#6831 (comment)).