-
Notifications
You must be signed in to change notification settings - Fork 71
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
Include acceptance tests in integration tests #2242
Conversation
b6fee09
to
3284091
Compare
… utf8 (#2244) ## Changes - Do not start replacement / comparison if file is too large or not valid utf-8. - This helps to prevent replacements if there is accidentally a large binary (e.g. terraform). ## Tests Found this problem when working on #2242 -- the tests tried to applied replacements on terraform binary and crashed. With this change, an error is reported instead.
## Changes - If CLOUD_ENV is set to do not override with dummy value. This allows running acceptance tests as integration tests. - Needed for #2242 ## Tests Manually run the test suite against dogfood. `CLOUD_ENV=aws go test ./acceptance`
53cbbee
to
18e71cb
Compare
18e71cb
to
d4003d7
Compare
d4003d7
to
6b9be38
Compare
It uses workspace.profile, which is used before variables are interpolated, which breaks when this test is run against cloud. Needed for #2242
This does not work when this test is run against cloud. Needed for #2242
This does not work when this test is run against cloud. Needed for #2242
6392550
to
8ad39c9
Compare
This does not work when this test is run against cloud. Needed for #2242
@@ -0,0 +1,12 @@ | |||
[[Repls]] | |||
Old = '- (user_name|service_principal_name): \$USERNAME' | |||
New = '- user_name_OR_service_principal_name: $$USERNAME' |
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.
Can you include a comment explaining why these replacements need to happen? Good for posterity.
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.
Good idea. For now, I've disabled bundle/templates in cloud env as there are many differences that deserve their own PR.
65c44cc
to
9971970
Compare
134072a
to
c05f339
Compare
c96ffb2
to
5c62de0
Compare
@@ -37,7 +37,7 @@ commands will detect it and remind you to do so if necessary. | |||
|
|||
>>> $TERRAFORM plan -no-color | |||
data.databricks_current_user.me: Reading... | |||
data.databricks_current_user.me: Read complete after 0s [id=$USER.Id] | |||
data.databricks_current_user.me: Read complete after (redacted) [id=$USER.Id] |
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.
Unrelated to this PR: why is there a test that runs TF directly?
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.
Well it tests that terraform installation works. By manually adding TF_LOG you can also see that local provider is read.
cloudEnv := os.Getenv("CLOUD_ENV") | ||
if config.LocalOnly && cloudEnv != "" { | ||
t.Skipf("Disabled via LocalOnly setting in %s (CLOUD_ENV=%s)", configPath, cloudEnv) | ||
} |
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.
I suspect that the presence of config.Server
implies the local-only mode?
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.
Interesting thought. I'd rather each option to be independent, even if in practice they correlate.
However, in case of Server & LocalOnly I don't see that -- you might need some stubs to run it locally but it already works with cloud.
Changes
Tests
Existing tests.