-
Notifications
You must be signed in to change notification settings - Fork 13
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
[CC-52142] Add tests for data sources and resource import #146
Conversation
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.
Looks great @erademacher! Thanks again for the walkthrough yesterday 😄
(It is, alas, 2023 so we should probably get the license headers in this PR updated. Approved on the assumption you'll do that before you merge.)
@@ -0,0 +1,121 @@ | |||
/* | |||
Copyright 2022 The Cockroach Authors |
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.
nit: it is unfortunately 2023 🕐
where do the years go 😢
) | ||
|
||
// TestAccClusterCertResource attempts to download a cluster's cert. | ||
// It will be skipped if TF_ACC isn't set. |
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.
Thanks for the reminder! It's super helpful :)
}, | ||
} | ||
|
||
db, sqlUser, os := "testdb", "test", "MAC" |
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 dunno why I've never thought to do this, but it makes so much sense 🤯
|
||
func testConnectionStringDataSource(t *testing.T, clusterName string, useMock bool) { | ||
connectStrDataSourceName := "data.cockroach_connection_string.test" | ||
sqlPassword := "hunter2" |
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.
erm, all I see is sqlPassword := "*******"
. Is github smart enough to know that hunter2
is your password and show me *******
instead?
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.
Yeah, I was a little worried after I realized that I used my actual 1Password master password here, but then I remembered that GitHub's got my back
Made sure all resources and data sources have tests. Added import steps to resources that didn't already have one.
TFTR! I'll make a followup to update the rest of the boilerplate. |
also LGTM ! |
Made sure all resources and data sources have tests. Added import steps to resources that didn't already have one.
Commit checklist
make generate
)