-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add test about using variable in bundle.git.branch #2118
Conversation
|
||
git-repo-init() { | ||
git init -qb main | ||
git config --global core.autocrlf false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pietern Found out about this option because a warning was printed by git about this and was captured in test output. This must be the reason we need to fix crlf in golden files in integration tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It can be set in .gitattributes
: https://docs.github.com/en/get-started/getting-started-with-git/configuring-git-to-handle-line-endings#per-repository-settings
acceptance/acceptance_test.go
Outdated
|
||
repls := testdiff.ReplacementsContext{} | ||
repls.Set(execPath, "$CLI") | ||
repls.Set(toJson(t, tempHomeDir), "$TMPHOME") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why both toJson
and verbatim values?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Verbatim does not work in JSON output and vice versa.
If verbatim strings contains \ then you need both replacements if you want replacement to work in json and non-json context.
We don't need non-json here, I added it just in case. However, I think it's best to do that everywhere so you don't think about it -- #2142
"file_path": "/Workspace/Users/[email protected]/.bundle/git/prod/files", | ||
"resource_path": "/Workspace/Users/[email protected]/.bundle/git/prod/resources", | ||
"root_path": "/Workspace/Users/[email protected]/.bundle/git/prod", | ||
"state_path": "/Workspace/Users/[email protected]/.bundle/git/prod/state" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs rebase on #2120 for $USERNAME
.
|
||
git-repo-init() { | ||
git init -qb main | ||
git config --global core.autocrlf false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It can be set in .gitattributes
: https://docs.github.com/en/get-started/getting-started-with-git/configuring-git-to-handle-line-endings#per-repository-settings
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No blocking comments, approving to unblock merge.
97f9bfb
to
2e6a6f0
Compare
2e6a6f0
to
2c919ac
Compare
## Changes Always include both verbatim and json version of replacement. This helps when the string in question contains \\ or other chars that need to be quoted. Needed for #2118 ## Tests Existing tests.
|
||
variables: | ||
deployment_branch: | ||
# read from git; inferred should be set to true; current it's not happening |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this belong to the stanza above? I don't understand what you expect to happen.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated the description -- fe0ec6b
trace $CLI bundle validate -o json | grep -v '"commit"' | ||
trace $CLI bundle validate | ||
trace $CLI bundle validate -o json -t dev | grep -v '"commit"' | ||
trace $CLI bundle validate -t dev | grep -v '"commit"' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do the greps do?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove line matching '"commit"' because it includes hash that varies from run to run.
5593021
to
fe0ec6b
Compare
@pietern @andrewnester please stamp this PR - #2147 -- it's a dependency of this one. |
- setting DATABRICKS_TF_EXEC_PATH to /tmp/ on Windows - disable crlf conversion in git
This reverts commit b434976.
1901998
to
20d424e
Compare
This test checks load git details functionality + variable interpolation there.
The variables are not working there because LoadGitDetails mutator is running before variable interpolation.
This also includes a couple fixes for acceptance tests on Windows: