Make functional test suite not depend on git #1536
Merged
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.
The functional test suite depended on a Git repo being present solely to find the repo root. This means .git also needs to be included in the docker images, which is actually unnecessary. (I'd call it wasteful, but really it's just a blip compared to all the compilers included in the docker image. But having the entire repo history there doesn't serve any useful purpose and might lead to details inadvertently being published if these docker images are pushed to dockerhub.)
Instead, I made the test suite not depend on the repo root existing at all; all files and executables are found relative to the installation (i.e. virtualenv) root.
Then I added .git to .dockerignore to take advantage of this. I also added .jj there, it's the VCS I use and it effectively serves the same purpose as .git.
Also, I tweaked the shell scripts in docker/ a bit: When the git repo is in a detached HEAD state (which it always is when using jj), GIT_BRANCH_NAME became "HEAD", which docker does not like as a project name. So I lowercased it and added a cms- in front for good measure.