Skip to content

chore: Return failure results#36233

Merged
sagar-qa007 merged 1 commit intoreleasefrom
chore/failresultshow
Sep 11, 2024
Merged

chore: Return failure results#36233
sagar-qa007 merged 1 commit intoreleasefrom
chore/failresultshow

Conversation

@sagar-qa007
Copy link
Contributor

@sagar-qa007 sagar-qa007 commented Sep 10, 2024

Description

Problem: When running Cypress tests multiple times with the cypress-repeat-pro --force option, we only see success messages. This is because the --force option may override or mask failures, leading to misleading results.

Solution: To address this, we have added a step to check for specific failure indicators in the test summary file. If the summary indicates that there were any failed tests (i.e., Total Failed: 0 is not present), the GitHub Action step will fail. This ensures that failures are properly highlighted and reported in the PR comments.

Fixes #36232

Automation

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

🔍 Cypress test results

Tip

🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/10806403675
Commit: 3a04b01
Cypress dashboard.
Tags: @tag.Sanity
Spec:


Wed, 11 Sep 2024 07:01:29 UTC

Communication

Should the DevRel and Marketing teams inform users about this change?

  • Yes
  • No

Summary by CodeRabbit

  • New Features

    • Enhanced CI workflow to ensure GitHub Action fails if Cypress tests do not pass, improving reliability.
  • Bug Fixes

    • Implemented a conditional check for test failures, providing clearer feedback on test outcomes.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 10, 2024

Walkthrough

The pull request introduces a conditional check in the GitHub Actions workflow for Cypress tests. After executing the tests and generating a summary file, the workflow now verifies if the string "Total Failed: 0" is present. If the string is absent, indicating test failures, the workflow outputs a failure message and exits with a status code of 1. This change ensures that the GitHub Action accurately reflects the test results, enhancing the reliability of the continuous integration process.

Changes

File Path Change Summary
.github/workflows/ci-test-limited-with-count.yml Added conditional check for test failures in the workflow.

Assessment against linked issues

Objective Addressed Explanation
Update failure result on PR comment for cypress test fails (#36232)

🎉 In the land of code where tests do play,
A check was added to brighten the day.
If failures arise, the workflow will know,
With a message so clear, it will surely show!
So let’s celebrate this change with glee,
For a reliable CI is the key! 🚀

Tip

Announcements
  • The review status is no longer posted as a separate comment when there are no actionable or nitpick comments. In such cases, the review status is included in the walkthrough comment.
  • We have updated our review workflow to use the Anthropic's Claude family of models. Please share any feedback in the discussion post on our Discord.
  • Possibly related PRs: Walkthrough comment now includes a list of potentially related PRs to help you recall past context. Please share any feedback in the discussion post on our Discord.
  • Suggested labels: CodeRabbit can now suggest labels by learning from your past PRs in the walkthrough comment. You can also provide custom labeling instructions in the UI or configuration file.
  • Possibly related PRs, automatic label suggestions based on past PRs, learnings, and possibly related issues require data opt-in (enabled by default).

Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 294503b and 3a04b01.

Files selected for processing (1)
  • .github/workflows/ci-test-limited-with-count.yml (1 hunks)
Additional comments not posted (1)
.github/workflows/ci-test-limited-with-count.yml (1)

352-357: Great job enhancing the workflow to fail the GitHub Action when tests fail! 👍

The code changes in the "Run the cypress test" step are a valuable addition to the workflow. By checking the cy-repeat-summary.txt file for the presence of "Total Failed: 0" and failing the GitHub Action if the string is not found, you have ensured that the CI process accurately reflects the test results.

This improvement enhances the reliability of the CI process and helps quickly identify test failures. The changes are correctly implemented and serve the intended purpose effectively.


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 @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 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 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 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 the skip-changelog Adding this label to a PR prevents it from being listed in the changelog label Sep 10, 2024
@sagar-qa007 sagar-qa007 added the ok-to-test Required label for CI label Sep 11, 2024
@sagar-qa007 sagar-qa007 merged commit a182e74 into release Sep 11, 2024
@sagar-qa007 sagar-qa007 deleted the chore/failresultshow branch September 11, 2024 09:38
Shivam-z pushed a commit to Shivam-z/appsmith that referenced this pull request Sep 26, 2024
## Description

**Problem:** When running Cypress tests multiple times with the
cypress-repeat-pro --force option, we only see success messages. This is
because the `--force` option may override or mask failures, leading to
misleading results.

**Solution:** To address this, we have added a step to check for
specific failure indicators in the test summary file. If the summary
indicates that there were any failed tests (i.e., `Total Failed: 0` is
not present), the GitHub Action step will fail. This ensures that
failures are properly highlighted and reported in the PR comments.


Fixes #`36232`  

## Automation

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

### 🔍 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/10806403675>
> Commit: 3a04b01
> <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=10806403675&attempt=1"
target="_blank">Cypress dashboard</a>.
> Tags: `@tag.Sanity`
> Spec:
> <hr>Wed, 11 Sep 2024 07:01:29 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

- **New Features**
- Enhanced CI workflow to ensure GitHub Action fails if Cypress tests do
not pass, improving reliability.
  
- **Bug Fixes**
- Implemented a conditional check for test failures, providing clearer
feedback on test outcomes.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants