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

test: Add cypress tests for Snowflake datasource functionalities #39029

Merged
merged 15 commits into from
Feb 7, 2025

Conversation

shadabbuchh
Copy link
Contributor

@shadabbuchh shadabbuchh commented Feb 5, 2025

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?

  • Yes
  • No

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features

    • Introduced streamlined support for Snowflake datasource integration, enabling users to easily enter Snowflake connection details and configuration settings directly within the application.
    • Added a new method for filling out Snowflake datasource forms, enhancing user experience in configuring Snowflake settings.
    • Expanded the list of available tags within the application to include Snowflake.
  • Tests

    • Rolled out comprehensive end-to-end tests that validate configuration, query execution, widget integration, deployment outcomes, deletion workflows, and error handling to ensure a robust experience with Snowflake integration.

Copy link
Contributor

coderabbitai bot commented Feb 5, 2025

Walkthrough

This 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

File(s) Change Summary
app/client/cypress/e2e/Regression/ServerSide/Datasources/Snowflake_Basic_Spec.ts Introduces an E2E test suite for the Snowflake datasource covering configuration validation, SQL query execution, widget binding, deletion, and error handling.
app/client/cypress/support/Objects/DataManager.ts, app/client/cypress/support/Pages/DataSources.ts Adds Snowflake-specific configuration properties and a new public method (FillSnowflakeDSForm) to automate Snowflake datasource form population.
app/client/cypress/tags.js Adds a new tag @tag.Snowflake to the Tag array for enhanced tagging capabilities.

Possibly related PRs

  • ci: snowflake envs for credentials #39065: The changes in the main PR, which involve adding comprehensive tests for the Snowflake datasource integration, are related to the retrieved PR that renames environment variables for Snowflake credentials, as both PRs focus on enhancing the functionality and configuration of Snowflake integration within the application.
  • ci: Adding snowflake env #39031: The changes in the main PR, which focus on end-to-end tests for the Snowflake datasource integration, are related to the retrieved PR that adds Snowflake environment variables for Cypress tests, as both involve the Snowflake integration and rely on the same credentials for testing.
  • ci: Update #39063: The changes in the main PR, which involve adding properties and methods for Snowflake datasource testing, are related to the modifications in the retrieved PR that rename environment variables for Snowflake credentials used in Cypress tests, as both PRs focus on the integration and configuration of Snowflake within the testing framework.

Suggested labels

Google Sheets, Query & JS Pod, Integrations Product, Integrations Pod General

Suggested reviewers

  • ApekshaBhosale
  • sagar-qa007
  • sharat87

Poem

In the realm of Snowflake, tests take flight,
Form fields dance with data so light.
Code and queries in perfect rhyme,
Making errors vanish over time.
A techy celebration with success in sight!
🚀 ❄️ Happy coding!


📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between dfd387a and 3adb00b.

📒 Files selected for processing (1)
  • app/client/cypress/e2e/Regression/ServerSide/Datasources/Snowflake_Basic_Spec.ts (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • app/client/cypress/e2e/Regression/ServerSide/Datasources/Snowflake_Basic_Spec.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

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?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions github-actions bot added skip-changelog Adding this label to a PR prevents it from being listed in the changelog Test labels Feb 5, 2025
@shadabbuchh shadabbuchh removed the request for review from sharat87 February 5, 2025 09:28
Copy link
Contributor

@coderabbitai coderabbitai bot left a 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

📥 Commits

Reviewing files that changed from the base of the PR and between 44d2b7e and 8217c84.

📒 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.

@shadabbuchh
Copy link
Contributor Author

/ci-test-limit-count run_count=1 update_snapshot=true specs_to_run=cypress/e2e/Regression/ServerSide/Datasources/Snowflake_Basic_Spec.ts

Copy link

github-actions bot commented Feb 5, 2025

Copy link

github-actions bot commented Feb 5, 2025

Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/13154415669.
Cypress dashboard url: Click here!
All Cypress tests have passed 🎉🎉🎉

***** Repeat Run Summary ***** Total Tests with repeat: 6 Total Passed: 0 Total Failed: 6 Total Skipped: 0 *****************************

@shadabbuchh
Copy link
Contributor Author

/ci-test-limit-count run_count=20 update_snapshot=false specs_to_run=cypress/e2e/Regression/ServerSide/Datasources/Snowflake_Basic_Spec.ts runId=13154415669

Copy link

github-actions bot commented Feb 5, 2025

@shadabbuchh
Copy link
Contributor Author

/ci-test-limit-count run_count=20 update_snapshot=false specs_to_run=cypress/e2e/Regression/ServerSide/Datasources/Snowflake_Basic_Spec.ts runId=13154415669

Copy link

github-actions bot commented Feb 5, 2025

@shadabbuchh
Copy link
Contributor Author

/ci-test-limit-count run_count=1 update_snapshot=true specs_to_run=cypress/e2e/Regression/ServerSide/Datasources/Snowflake_Basic_Spec.ts

Copy link

github-actions bot commented Feb 5, 2025

@sagar-qa007 sagar-qa007 added ok-to-test Required label for CI and removed ok-to-test Required label for CI labels Feb 5, 2025
@shadabbuchh shadabbuchh removed the ok-to-test Required label for CI label Feb 6, 2025
@shadabbuchh
Copy link
Contributor Author

/ci-test-limit-count run_count=1 update_snapshot=false specs_to_run=cypress/e2e/Regression/ServerSide/Datasources/Snowflake_Basic_Spec.ts

Copy link

github-actions bot commented Feb 6, 2025

Copy link

github-actions bot commented Feb 6, 2025

Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/13174192510.
Cypress dashboard url: Click here!
All Cypress tests have passed 🎉🎉🎉

***** Repeat Run Summary ***** Total Tests with repeat: 6 Total Passed: 0 Total Failed: 1 Total Skipped: 0 *****************************

@shadabbuchh shadabbuchh added the ok-to-test Required label for CI label Feb 6, 2025
@shadabbuchh shadabbuchh removed the ok-to-test Required label for CI label Feb 6, 2025
@shadabbuchh
Copy link
Contributor Author

/ci-test-limit-count run_count=1 update_snapshot=false specs_to_run=cypress/e2e/Regression/ServerSide/Datasources/Snowflake_Basic_Spec.ts

Copy link

github-actions bot commented Feb 6, 2025

Copy link

github-actions bot commented Feb 6, 2025

Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/13176223904.
Cypress dashboard url: Click here!
All Cypress tests have passed 🎉🎉🎉

***** Repeat Run Summary ***** Total Tests with repeat: 6 Total Passed: 4 Total Failed: 2 Total Skipped: 0 *****************************

@shadabbuchh
Copy link
Contributor Author

/ci-test-limit-count run_count=20 update_snapshot=false specs_to_run=cypress/e2e/Regression/ServerSide/Datasources/Snowflake_Basic_Spec.ts runId=13176223904

Copy link

github-actions bot commented Feb 6, 2025

@shadabbuchh
Copy link
Contributor Author

/ci-test-limit-count run_count=1 update_snapshot=false specs_to_run=cypress/e2e/Regression/ServerSide/Datasources/Snowflake_Basic_Spec.ts

Copy link

github-actions bot commented Feb 6, 2025

@shadabbuchh
Copy link
Contributor Author

/ci-test-limit-count run_count=1 update_snapshot=false specs_to_run=cypress/e2e/Regression/ServerSide/Datasources/Snowflake_Basic_Spec.ts runId=13178586650

Copy link

github-actions bot commented Feb 6, 2025

Copy link

github-actions bot commented Feb 6, 2025

Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/13179149728.
Cypress dashboard url: Click here!
All cypress tests have passed 🎉🎉🎉

***** Repeat Run Summary ***** Total Tests with repeat: 6 Total Passed: 4 Total Failed: 2 Total Skipped: 0 *****************************

@shadabbuchh
Copy link
Contributor Author

/ci-test-limit-count run_count=1 update_snapshot=false specs_to_run=cypress/e2e/Regression/ServerSide/Datasources/Snowflake_Basic_Spec.ts

Copy link

github-actions bot commented Feb 6, 2025

Copy link

github-actions bot commented Feb 6, 2025

Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/13182681808.
Cypress dashboard: Click here!
The following are new failures, please fix them before merging the PR:
To know the list of identified flaky tests - Refer here

***** Repeat Run Summary ***** Total Tests with repeat: 6 Total Passed: 6 Total Failed: 0 Total Skipped: 0 *****************************

@shadabbuchh
Copy link
Contributor Author

/ci-test-limit-count run_count=15 update_snapshot=false specs_to_run=cypress/e2e/Regression/ServerSide/Datasources/Snowflake_Basic_Spec.ts runId=13182681808

Copy link

github-actions bot commented Feb 6, 2025

Copy link

github-actions bot commented Feb 6, 2025

Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/13183219460.
Cypress dashboard: Click here!
The following are new failures, please fix them before merging the PR:
To know the list of identified flaky tests - Refer here

***** Repeat Run Summary ***** Total Tests with repeat: 90 Total Passed: 90 Total Failed: 0 Total Skipped: 0 *****************************

@shadabbuchh shadabbuchh added the ok-to-test Required label for CI label Feb 7, 2025
@shadabbuchh shadabbuchh merged commit 341d734 into release Feb 7, 2025
50 checks passed
@shadabbuchh shadabbuchh deleted the test/snowflakeTestCases branch February 7, 2025 05:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ok-to-test Required label for CI skip-changelog Adding this label to a PR prevents it from being listed in the changelog Test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants