appsmith
appsmith copied to clipboard
fix: adding new test cases for git auto-commit
Description
Adds cypress test for checking auto-commit functionality
Fixes #33964
/test
cypress/e2e/Regression/ClientSide/Git/GitAutocommit_spec.ts
Automation
:mag: Cypress test results
[!CAUTION] 🔴 🔴 🔴 Some tests have failed. Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/10572583465 Commit: 9e3eac1c65f5ff72bdc616c3b483ef500b8d0d0e Cypress dashboard. Tags: Spec: cypress/e2e/Regression/ClientSide/Git/GitAutocommit_spec.ts
The following are new failures, please fix them before merging the PR:
List of identified flaky tests.
- cypress/e2e/Regression/ClientSide/Git/GitAutocommit_spec.ts
Tue, 27 Aug 2024 06:26:24 UTC
Communication
Should the DevRel and Marketing teams inform users about this change?
- [ ] Yes
- [ ] No
Walkthrough
The changes introduce a Cypress end-to-end test suite for the Git autocommit feature, enhancing the testing framework. Key modifications include the addition of a new property for tracking autocommit status, adjustments to logging levels in the server implementation, and the removal of feature flag checks in tests, indicating a shift towards always enabling auto-commit checks.
Changes
| Files | Change Summary |
|---|---|
app/client/cypress/e2e/Regression/ClientSide/Git/GitAutocommit_spec.ts |
Added a Cypress test suite for Git autocommit, validating UI and API interactions. |
app/client/cypress/support/Pages/GitSync.ts |
Introduced _autocommitStatusbar property for tracking autocommit status. |
app/client/src/pages/Editor/gitSync/QuickGitActions/AutocommitStatusbar.tsx |
Added data-testid attribute to StatusbarWrapper for improved testability. |
app/server/appsmith-server/src/main/java/com/appsmith/server/git/autocommit/helpers/AutoCommitEligibilityHelperImpl.java |
Removed @FeatureFlagged annotation from methods, making auto-commit checks always active. |
app/server/appsmith-server/src/main/java/com/appsmith/server/git/autocommit/helpers/GitAutoCommitHelperFallbackImpl.java |
Added @Slf4j annotation for enhanced logging capabilities. |
app/server/appsmith-server/src/main/java/com/appsmith/server/git/autocommit/helpers/GitAutoCommitHelperImpl.java |
Adjusted logging levels from debug to info for key auto-commit messages. |
app/server/appsmith-server/src/test/java/com/appsmith/server/git/autocommit/AutoCommitServiceTest.java |
Modified mocking behavior for auto-commit eligibility checks, introducing AutoCommitTriggerDTO. |
app/server/appsmith-server/src/test/java/com/appsmith/server/git/autocommit/helpers/AutoCommitEligibilityHelperTest.java |
Removed feature flag checks from tests, streamlining the test setup. |
Sequence Diagram(s)
sequenceDiagram
participant User
participant Cypress
participant GitSync
participant Server
User->>Cypress: Trigger autocommit test
Cypress->>GitSync: Enable autocommit feature
GitSync->>Server: POST request to trigger autocommit
Server-->>GitSync: Response with status 200
GitSync->>Cypress: Show autocommit status bar
Cypress->>Server: GET request for autocommit progress
Server-->>Cypress: Response with progress status
Assessment against linked issues
| Objective | Addressed | Explanation |
|---|---|---|
| Import an old repo > go to application > check for auto-commit status bar ( #33964 ) | ✅ | |
| Import an old repo > go to application > check for auto-commit trigger and progress api ( #33964 ) | ✅ | |
| Import an old repo > go to application > change branch when auto-commit is done ( #33964 ) | ❌ | No direct implementation for branch change handling. |
Poem
In the realm of code, new tests arise,
Autocommit's journey, a seamless surprise.
With logs that now sing at an info's embrace,
The feature shines bright, in its rightful place.
So here's to the changes, both bold and grand,
A future of commits, all perfectly planned! 🎉
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?
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>.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
@coderabbitaiin 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
@coderabbitaiin 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 generate interesting stats about this repository and render them as a table.@coderabbitai show all the console.log statements in this repository.@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 pauseto pause the reviews on a PR.@coderabbitai resumeto resume the paused reviews.@coderabbitai reviewto trigger an incremental review. This is useful when automatic reviews are disabled for the repository.@coderabbitai full reviewto do a full review from scratch and review all the files again.@coderabbitai summaryto regenerate the summary of the PR.@coderabbitai resolveresolve all the CodeRabbit review comments.@coderabbitai configurationto show the current CodeRabbit configuration for the repository.@coderabbitai helpto get help.
Other keywords and placeholders
- Add
@coderabbitai ignoreanywhere in the PR description to prevent this PR from being reviewed. - Add
@coderabbitai summaryto generate the high-level summary at a specific location in the PR description. - Add
@coderabbitaianywhere 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.
Can we please have react testing library test for this change ?
cc : @ApekshaBhosale @yatinappsmith @sagar-qa007
This PR has not seen activitiy for a while. It will be closed in 7 days unless further activity is detected.
Can we please have react testing library test for this change ?
@rajatagrawal can you please elaborate?
react-testing-library is good for testing components in isolation, that is not the use case here.
The intention is to test the flow for auto-commit in it's entirety. Hence, the Cypress approach
Failed server tests
- com.appsmith.server.solutions.ce.ActionExecutionSolutionCETest#suggestWidget_ArrayListData_SuggestTableTextChartDropDownWidget
/build-deploy-preview skip-tests=true
Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/10687815563.
Workflow: On demand build Docker image and deploy preview.
skip-tests: true.
env: ``.
PR: 34913.
recreate: .
Deploy-Preview-URL: https://ce-34913.dp.appsmith.com
@brayn003 spec changes LGTM