Skip to content
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

Data Warehouse acceptance tests for catalog, hive #173

Merged
merged 2 commits into from
Nov 7, 2024
Merged

Data Warehouse acceptance tests for catalog, hive #173

merged 2 commits into from
Nov 7, 2024

Conversation

tevesz
Copy link
Contributor

@tevesz tevesz commented Oct 31, 2024

Cover the dw environment, db catalog and hive virtual warehouse creations and deletions as part of acceptance testing.

@tevesz tevesz requested a review from a team as a code owner October 31, 2024 20:51
Copy link

github-actions bot commented Oct 31, 2024

Go test coverage: 33.4% for commit 0e7569e
⚠️ 2 of 14 packages have zero coverage.
  • github.com/cloudera/terraform-provider-cdp/resources/de
  • github.com/cloudera/terraform-provider-cdp/resources/ml
View coverage for all packages
# Package Name                                                                  | Coverage
+ github.com/cloudera/terraform-provider-cdp/cdpacctest                         |    14.3%
+ github.com/cloudera/terraform-provider-cdp/provider                           |    78.7%
+ github.com/cloudera/terraform-provider-cdp/resources/datahub                  |    36.3%
+ github.com/cloudera/terraform-provider-cdp/resources/datalake                 |     8.4%
- github.com/cloudera/terraform-provider-cdp/resources/de                       |     0.0%
+ github.com/cloudera/terraform-provider-cdp/resources/dw/cluster/aws           |    72.4%
+ github.com/cloudera/terraform-provider-cdp/resources/dw/databasecatalog       |    66.7%
+ github.com/cloudera/terraform-provider-cdp/resources/dw/virtualwarehouse/hive |    74.3%
+ github.com/cloudera/terraform-provider-cdp/resources/environments             |    44.1%
+ github.com/cloudera/terraform-provider-cdp/resources/iam                      |     2.8%
- github.com/cloudera/terraform-provider-cdp/resources/ml                       |     0.0%
+ github.com/cloudera/terraform-provider-cdp/resources/opdb                     |    25.3%
+ github.com/cloudera/terraform-provider-cdp/utils                              |    55.3%
+ github.com/cloudera/terraform-provider-cdp/utils/test                         |    68.8%

gregito
gregito previously approved these changes Nov 2, 2024
gregito
gregito previously approved these changes Nov 5, 2024
vcsomor
vcsomor previously approved these changes Nov 5, 2024
cdpacctest/acctest.go Outdated Show resolved Hide resolved
cdpacctest/acctest.go Outdated Show resolved Hide resolved
cdpacctest/acctest.go Outdated Show resolved Hide resolved
cdpacctest/acctest.go Outdated Show resolved Hide resolved
resources/dw/resource_dw_acc_test.go Outdated Show resolved Hide resolved
resources/dw/resource_dw_acc_test.go Outdated Show resolved Hide resolved
resources/dw/resource_dw_acc_test.go Show resolved Hide resolved
@tevesz tevesz dismissed stale reviews from vcsomor and gregito via d91d495 November 5, 2024 17:25
@tevesz tevesz force-pushed the DWX-18779 branch 2 times, most recently from d91d495 to b670f8c Compare November 5, 2024 21:51
@tevesz
Copy link
Contributor Author

tevesz commented Nov 5, 2024

I think I've addressed all comments @vcsomor and @gregito , thanks for the review! There is one thing I want to make sure about, the Aws Profile (or other aws cred variable) will be needed for the DW acceptance runs, to deploy the roles and policies, is there any change that I should add for this? Like support secret access keys?

vcsomor
vcsomor previously approved these changes Nov 6, 2024
cdpacctest/acctest.go Outdated Show resolved Hide resolved
cdpacctest/acctest.go Outdated Show resolved Hide resolved
@vcsomor
Copy link
Contributor

vcsomor commented Nov 6, 2024

There is one thing I want to make sure about, the Aws Profile (or other aws cred variable) will be needed for the DW acceptance runs, to deploy the roles and policies, is there any change that I should add for this? Like support secret access keys?

I don't know if I got this right. We can add further possibilities once they are required.
In general, the underlying AWS SDK knows the best how to initialize the client. The best way is to assign roles to the APP/TEST/CONTAINER/VM trying to access the AWS API and the SDK just initializes with the LoadDefaultConfig.
The next least good solution is to go with profiles, the most insecure is the accesskey/secretkey pair.

@tevesz
Copy link
Contributor Author

tevesz commented Nov 6, 2024

@vcsomor this is a question because the acc test is run by a jenkins job, and that most probably already has a couple of options to handle the secrets. Technically my question is what kind of secrets are required or provided by the jenkins infra.

Cover the dw environment, db catalog and hive vw creations and
deletions as part of acceptance testing.
Use the default role to create an environment and DW cluster. The AWS
policy is queried via CLI.
@tevesz tevesz merged commit 388f577 into main Nov 7, 2024
9 checks passed
@tevesz tevesz deleted the DWX-18779 branch November 7, 2024 15:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants