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

[Task]: Snowflake JUnit test cases #34692

Closed
sneha122 opened this issue Jul 4, 2024 · 2 comments · Fixed by #34810
Closed

[Task]: Snowflake JUnit test cases #34692

sneha122 opened this issue Jul 4, 2024 · 2 comments · Fixed by #34810
Assignees
Labels
Integrations Product Issues related to a specific integration Query & JS Pod Issues related to the query & JS Pod snowflake Issues related to the snowflake Integration Task A simple Todo

Comments

@sneha122
Copy link
Contributor

sneha122 commented Jul 4, 2024

SubTasks

This task is to add test cases for snowflake key pair authentication mechanism that we have newly added

@sneha122 sneha122 added Task A simple Todo snowflake Issues related to the snowflake Integration labels Jul 4, 2024
@github-actions github-actions bot added the Integrations Product Issues related to a specific integration label Jul 4, 2024
@sneha122 sneha122 self-assigned this Jul 4, 2024
@sneha122
Copy link
Contributor Author

sneha122 commented Jul 5, 2024

This may get delayed as release blocker was prioritised

@sneha122
Copy link
Contributor Author

sneha122 commented Jul 8, 2024

This is taking time due to known issue of mocking static methods, updating the estimate.

Shivam-z pushed a commit to Shivam-z/appsmith that referenced this issue Jul 10, 2024
…g#34810)

## Description
This PR adds JUnit test cases for snowflake Key auth pair feature added.
Following cases have been added:
- For basic authentication mechanism, when we do datasource create ->
hikari config should have non empty username and password and datasource
object inside hikari config should be null
- For key pair authentication mechanism with valid private key -> hikari
config should have datasource object which is of type
SnowflakeBasicDatasource and username, password should be null.
- For key pair authentication mechanism with invalid private key ->
error should be thrown with appropriate error message
- For key pair authentication mechanism with valid private key ->
SnowflakeKeyUtils.readEncryptedPrivateKey should return valid instance
of PrivateKey class.

Note: Valid private key generated for above test cases is unencrypted
private key (i.e. without passphrase). Adding test cases with private
key having passphrase was a little complex than anticipated, hence will
create a separate task and tackle it separately.


Fixes appsmithorg#34692
_or_  
Fixes `Issue URL`
> [!WARNING]  
> _If no issue exists, please create an issue first, and check with the
maintainers if the issue is valid._

## Automation

/ok-to-test tags="@tag.Perf"

### 🔍 Cypress test results
<!-- This is an auto-generated comment: Cypress test results  -->
> [!TIP]
> 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
> Workflow run:
<https://github.com/appsmithorg/appsmith/actions/runs/9856542221>
> Commit: 87074a7
> <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=9856542221&attempt=1"
target="_blank">Cypress dashboard</a>.
> Tags: `@tag.Perf`
> Spec:
> <hr>Tue, 09 Jul 2024 12:20:08 UTC
<!-- end of auto-generated comment: Cypress test results  -->


## Communication
Should the DevRel and Marketing teams inform users about this change?
- [ ] Yes
- [x] No


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- **Tests**
- Implemented new tests for key pair authentication with both valid and
invalid private keys.
  - Added tests for basic authentication.
  - Introduced tests for reading an encrypted private key.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: “sneha122” <“sneha@appsmith.com”>
@Nikhil-Nandagopal Nikhil-Nandagopal added the Query & JS Pod Issues related to the query & JS Pod label Aug 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Integrations Product Issues related to a specific integration Query & JS Pod Issues related to the query & JS Pod snowflake Issues related to the snowflake Integration Task A simple Todo
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants