-
Notifications
You must be signed in to change notification settings - Fork 86
e2e tests CDAP-19055 - Override service account details #1002
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
e2e tests CDAP-19055 - Override service account details #1002
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). For more information, open the CLA check for this pull request. |
|
Conflicts resolved. |
| if (serviceAccountType.equalsIgnoreCase("FilePath")) { | ||
| String serviceAccountFilePath = System.getenv("SERVICE_ACCOUNT_FILE_PATH"); | ||
| if (!(serviceAccountFilePath == null) && !serviceAccountFilePath.equalsIgnoreCase("auto-detect")) { | ||
| PluginPropertyUtils.addPluginProp("serviceAccountFilePath", serviceAccountFilePath); |
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 is this step needed if we are reading directly from env variables?
https://github.com/cdapio/cdap-e2e-tests/blob/develop/src/main/java/io/cdap/e2e/pages/actions/CdfPluginPropertiesActions.java#L591
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.
This is required for macro runtime arguments.
| Then Enter runtime argument value "serviceAccountFilePath" for key "gcsServiceAccount" |
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 think the macro scenario needs to be modified, what if service account type is set as "JSON" instead of "filePath". It will fail, right?
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.
We have separate macro tests with Service Account Type as macro param
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 about the existing macro tests? They will fail if serviceAccountType is set as JSON in environment variable, right?
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 macro tests.
itsankit-google
left a comment
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.
The clients used to setup input data should also be created using the given credentials. Are we taking care of this as well?
|
Also there is one GCS sink test failure, please ensure |
Clients use projectId - which needs to be updated in pluginParameters.properties file as per config. |
If we don't set credentials while creating GCP API clients, they internally use the credentials from GCE VM which will be similar to auto-detect. If we want to create the clients in different projects you will need to set the service credentials which have permissions on the given project. See this for example, https://github.com/data-integrations/google-cloud/blob/develop/src/main/java/io/cdap/plugin/gcp/common/GCPUtils.java#L186 |
We can achieve this by setting env variable |
All tests passed in build |
itsankit-google
left a comment
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.
LGTM, please squash commits.
Squashed commits. |
This PR depends on cdapio/cdap-e2e-tests#83
@rmstar @itsankit-google Please review.