-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
test: Add cypress tests for Snowflake datasource functionalities #39029
Conversation
WalkthroughThis pull request adds a comprehensive set of end-to-end tests for the Snowflake datasource integration and extends configuration support. A new test file covers various operations such as configuration validation, query execution, widget binding and deployment, datasource deletion, and error handling. In addition, new Snowflake-specific configuration properties and a helper method to fill the datasource form have been introduced in the DataManager and DataSources classes. Changes
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: .coderabbit.yaml 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms (4)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
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.
Actionable comments posted: 4
🧹 Nitpick comments (1)
app/client/cypress/e2e/Regression/ServerSide/Datasources/Snowflake_Basic_Spec.ts (1)
65-68
: Move SQL queries to a separate constants file.Consider moving SQL queries to a separate constants file for better maintainability and reusability.
Example:
// constants/queries.ts export const SNOWFLAKE_QUERIES = { SELECT: "SELECT * FROM PUBLIC.DB1 LIMIT 10;", INSERT: "INSERT INTO PUBLIC.DB1 (SALARY, ID, NAME, POSITION) VALUES (87000, 3, 'Ada', 'Jr. Developer');", // ... other queries };
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (7)
.github/workflows/ci-test-custom-script.yml
(2 hunks).github/workflows/ci-test-hosted.yml
(1 hunks).github/workflows/ci-test-limited-with-count.yml
(6 hunks).github/workflows/ci-test-limited.yml
(2 hunks)app/client/cypress/e2e/Regression/ServerSide/Datasources/Snowflake_Basic_Spec.ts
(1 hunks)app/client/cypress/support/Objects/DataManager.ts
(1 hunks)app/client/cypress/support/Pages/DataSources.ts
(2 hunks)
✅ Files skipped from review due to trivial changes (1)
- .github/workflows/ci-test-limited-with-count.yml
🧰 Additional context used
📓 Path-based instructions (1)
`app/client/cypress/**/**.*`: Review the following e2e test ...
app/client/cypress/**/**.*
: Review the following e2e test code written using the Cypress test library. Ensure that:
- Follow best practices for Cypress code and e2e automation.
- Avoid using cy.wait in code.
- Avoid using cy.pause in code.
- Avoid using agHelper.sleep().
- Use locator variables for locators and do not use plain strings.
- Use data-* attributes for selectors.
- Avoid Xpaths, Attributes and CSS path.
- Avoid selectors like .btn.submit or button[type=submit].
- Perform logins via API with LoginFromAPI.
- Perform logout via API with LogOutviaAPI.
- Perform signup via API with SignupFromAPI.
- Avoid using it.only.
- Avoid using after and aftereach in test cases.
- Use multiple assertions for expect statements.
- Avoid using strings for assertions.
- Do not use duplicate filenames even with different paths.
- Avoid using agHelper.Sleep, this.Sleep in any file in code.
app/client/cypress/support/Objects/DataManager.ts
app/client/cypress/e2e/Regression/ServerSide/Datasources/Snowflake_Basic_Spec.ts
app/client/cypress/support/Pages/DataSources.ts
⏰ Context from checks skipped due to timeout of 90000ms (4)
- GitHub Check: client-unit-tests / client-unit-tests
- GitHub Check: client-lint / client-lint
- GitHub Check: client-build / client-build
- GitHub Check: client-prettier / prettier-check
🔇 Additional comments (8)
app/client/cypress/support/Objects/DataManager.ts (1)
112-118
: LGTM! Snowflake configuration looks good.The implementation correctly handles sensitive credentials via environment variables while using reasonable defaults for non-sensitive values.
app/client/cypress/support/Pages/DataSources.ts (1)
575-610
: LGTM! Snowflake form fill implementation looks good.The method follows the established pattern for datasource form filling and correctly handles all required fields including authentication.
.github/workflows/ci-test-hosted.yml (1)
247-249
: LGTM! Snowflake environment variables correctly configured.The environment variables are properly sourced from GitHub secrets, maintaining security best practices.
.github/workflows/ci-test-limited.yml (1)
341-343
: LGTM! Snowflake environment variables correctly configured.The environment variables are properly sourced from GitHub secrets, maintaining security best practices.
.github/workflows/ci-test-custom-script.yml (2)
371-373
: Add Snowflake Credentials for Cypress Tests.The new environment variables (
SNOWFLAKE_ACCOUNT_NAME
,SNOWFLAKE_USERNAME
,SNOWFLAKE_PASSWORD
) are correctly integrated using GitHub secrets. Ensure that these secrets are properly configured in your repository and that your Cypress tests and related DataManager updates correctly reference these values.
475-477
: Enhance YAML Consistency in Docker Logs Upload Step.The indentation adjustments for the artifact upload parameters (name, path, and overwrite) in the "Upload server docker logs bundle on failure" section improve the overall readability and maintainability of the workflow file.
app/client/cypress/e2e/Regression/ServerSide/Datasources/Snowflake_Basic_Spec.ts (2)
1-23
: LGTM! Clean imports and proper variable declarations.
24-27
: LGTM! Well-structured test suite with proper tags.
app/client/cypress/e2e/Regression/ServerSide/Datasources/Snowflake_Basic_Spec.ts
Outdated
Show resolved
Hide resolved
app/client/cypress/e2e/Regression/ServerSide/Datasources/Snowflake_Basic_Spec.ts
Outdated
Show resolved
Hide resolved
app/client/cypress/e2e/Regression/ServerSide/Datasources/Snowflake_Basic_Spec.ts
Outdated
Show resolved
Hide resolved
app/client/cypress/e2e/Regression/ServerSide/Datasources/Snowflake_Basic_Spec.ts
Outdated
Show resolved
Hide resolved
/ci-test-limit-count run_count=1 update_snapshot=true specs_to_run=cypress/e2e/Regression/ServerSide/Datasources/Snowflake_Basic_Spec.ts |
Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/13154415669. |
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/13154415669.
|
/ci-test-limit-count run_count=20 update_snapshot=false specs_to_run=cypress/e2e/Regression/ServerSide/Datasources/Snowflake_Basic_Spec.ts runId=13154415669 |
Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/13155660189. |
/ci-test-limit-count run_count=20 update_snapshot=false specs_to_run=cypress/e2e/Regression/ServerSide/Datasources/Snowflake_Basic_Spec.ts runId=13154415669 |
Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/13156087883. |
/ci-test-limit-count run_count=1 update_snapshot=true specs_to_run=cypress/e2e/Regression/ServerSide/Datasources/Snowflake_Basic_Spec.ts |
Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/13157488692. |
/ci-test-limit-count run_count=1 update_snapshot=false specs_to_run=cypress/e2e/Regression/ServerSide/Datasources/Snowflake_Basic_Spec.ts |
Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/13174192510. |
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/13174192510.
|
/ci-test-limit-count run_count=1 update_snapshot=false specs_to_run=cypress/e2e/Regression/ServerSide/Datasources/Snowflake_Basic_Spec.ts |
Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/13176223904. |
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/13176223904.
|
/ci-test-limit-count run_count=20 update_snapshot=false specs_to_run=cypress/e2e/Regression/ServerSide/Datasources/Snowflake_Basic_Spec.ts runId=13176223904 |
Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/13178360567. |
/ci-test-limit-count run_count=1 update_snapshot=false specs_to_run=cypress/e2e/Regression/ServerSide/Datasources/Snowflake_Basic_Spec.ts |
Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/13178586650. |
/ci-test-limit-count run_count=1 update_snapshot=false specs_to_run=cypress/e2e/Regression/ServerSide/Datasources/Snowflake_Basic_Spec.ts runId=13178586650 |
Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/13179149728. |
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/13179149728.
|
/ci-test-limit-count run_count=1 update_snapshot=false specs_to_run=cypress/e2e/Regression/ServerSide/Datasources/Snowflake_Basic_Spec.ts |
Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/13182681808. |
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/13182681808.
|
/ci-test-limit-count run_count=15 update_snapshot=false specs_to_run=cypress/e2e/Regression/ServerSide/Datasources/Snowflake_Basic_Spec.ts runId=13182681808 |
Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/13183219460. |
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/13183219460.
|
Description
This PR introduces cypress tests to ensure the functionality & reliability of the Snowflake datasource integration.
Automation
/ok-to-test tags="@tag.Datasource, @tag.Git, @tag.Sanity"
🔍 Cypress test results
Tip
🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/13192562126
Commit: 3adb00b
Cypress dashboard.
Tags:
@tag.Datasource, @tag.Git, @tag.Sanity
Spec:
Fri, 07 Feb 2025 05:31:43 UTC
Communication
Should the DevRel and Marketing teams inform users about this change?
Summary by CodeRabbit
Summary by CodeRabbit
New Features
Tests