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

CI: Add Repeat for ci-testlimited #33480

Closed
wants to merge 2 commits into from
Closed

CI: Add Repeat for ci-testlimited #33480

wants to merge 2 commits into from

Conversation

yatinappsmith
Copy link
Contributor

Add Repeat for ci-testlimited

Copy link
Contributor

coderabbitai bot commented May 15, 2024

Walkthrough

Walkthrough

The changes enhance the CI workflow by introducing a new repeat input parameter, enabling Cypress tests to be rerun until they pass. This improvement includes installing cypress-repeat and adjusting the test command to utilize this new functionality, thereby increasing the reliability of the test suite.

Changes

File Path Change Summary
.github/workflows/ci-test-limited.yml Added repeat input parameter with default value 1. Installed cypress-repeat and updated Cypress test command to npx cypress-repeat run -n ${{ inputs.repeat }} --until-passes.

Recent Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between 2b49f78 and c926905.
Files selected for processing (1)
  • .github/workflows/ci-test-limited.yml (3 hunks)
Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/ci-test-limited.yml

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

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 as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

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.

@yatinappsmith
Copy link
Contributor Author

/ci-test-limit runId=9091878910 repeat=2

Copy link

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: 3

Comment on lines +22 to +26
repeat:
description: "Repeat test count"
required: false
type: number
default: 1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add repeat input parameter to workflow_call section.

The repeat input parameter is added to the workflow_dispatch section but is missing from the workflow_call section. To ensure consistency and functionality when the workflow is called, add the repeat parameter to the workflow_call section as well.

workflow_call:
  inputs:
    pr:
      description: "This is the PR number in case the workflow is being called in a pull request"
      required: false
      type: number
    previous-workflow-run-id:
      description: "This is the PR number in case the workflow is being called in a pull request"
      required: false
      type: number
      default: 0
    matrix:
      description: "This is the matrix job number"
      required: false
      type: string
      default: "[0, 1, 2]"
    repeat:
      description: "Repeat test count"
      required: false
      type: number
      default: 1

@@ -231,6 +236,7 @@
working-directory: app/client
run: |
yarn install --immutable
yarn add -D cypress-repeat
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tip

Codebase Verification

Ensure cypress-repeat is added to devDependencies.

The cypress-repeat package is not currently listed in the devDependencies section of the package.json file. Please add it to ensure it is correctly managed by Yarn.

Analysis chain

Ensure cypress-repeat is added to devDependencies.

Verify that cypress-repeat is added to the devDependencies in the package.json file to ensure it is correctly managed by Yarn.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify `cypress-repeat` is added to `devDependencies` in `package.json`.

# Test: Search for `cypress-repeat` in `devDependencies`. Expect: Entry exists.
rg --type json '"cypress-repeat"' app/client/package.json

Length of output: 59



Script:

#!/bin/bash
# Description: List the `devDependencies` section of `package.json` to verify the presence of `cypress-repeat`.

# Test: Output the `devDependencies` section.
jq '.devDependencies' app/client/package.json

Length of output: 4422

@@ -359,6 +365,7 @@
spec: ${{ env.specs_to_run }}
working-directory: app/client
env: "NODE_ENV=development"
command: npx cypress-repeat run -n ${{ inputs.repeat }} --until-passes
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tip

Codebase Verification

The cypress-repeat command may not work as expected because the cypress-repeat package is not found in the package.json files, indicating it is not installed as a dependency.

  • Ensure that cypress-repeat is added as a dependency in the appropriate package.json file(s).
Analysis chain

Ensure cypress-repeat command works as expected.

Verify that the cypress-repeat command works as expected by running a test workflow with different repeat values to ensure it correctly repeats the tests until they pass.


To verify the correctness of the cypress-repeat command, we need to ensure that the cypress-repeat package is correctly installed and used in the codebase. We will search for references to cypress-repeat in the repository to confirm its presence and usage.


To further verify the presence of cypress-repeat, we will check the package.json file to see if it is listed as a dependency. This will help us confirm whether the package is installed and available for use.


To locate the package.json file and verify the presence of cypress-repeat as a dependency, we will first search for the package.json file in the repository and then check its contents.


To verify the presence of cypress-repeat as a dependency, we will check the contents of the located package.json files.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify `cypress-repeat` command works as expected.

# Test: Run a test workflow with different `repeat` values. Expect: Tests repeat until they pass.
gh workflow run ci-test-limited.yml -f repeat=3

Length of output: 230



Script:

#!/bin/bash
# Search for references to `cypress-repeat` in the repository to verify its presence and usage.
rg 'cypress-repeat'

Length of output: 19



Script:

#!/bin/bash
# Check the package.json file for the presence of `cypress-repeat` as a dependency.
rg 'cypress-repeat' package.json

Length of output: 85



Script:

#!/bin/bash
# Locate the package.json file in the repository.
fd package.json

Length of output: 508



Script:

#!/bin/bash
# Check the contents of the located package.json files for the presence of `cypress-repeat` as a dependency.
rg 'cypress-repeat' deploy/docker/fs/opt/appsmith/utils/package.json app/client/package.json app/client/packages/ast/package.json app/client/packages/storybook/package.json app/client/packages/rts/package.json app/client/packages/design-system/theming/package.json app/client/packages/design-system/widgets/package.json app/client/packages/icons/package.json app/client/packages/design-system/widgets-old/package.json app/client/packages/design-system/headless/package.json app/client/packages/dsl/package.json

Length of output: 510

@yatinappsmith
Copy link
Contributor Author

/ci-test-limit runId=9091746568repeat=2

Copy link

Copy link

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

@yatinappsmith
Copy link
Contributor Author

/ci-test-limit runId=9091746568 repeat=2

Copy link

Copy link

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

Copy link
Member

@sharat87 sharat87 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion for a minor cleanup, otherwise looks okay.

Comment on lines 365 to +368
spec: ${{ env.specs_to_run }}
working-directory: app/client
env: "NODE_ENV=development"
command: npx cypress-repeat run -n ${{ inputs.repeat }} --until-passes --browser ${{ env.BROWSER_PATH }} --config-file cypress_ci_custom.config.ts --spec ${{ env.specs_to_run }} --env "NODE_ENV=development"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like a lot of the configuration under with is duplicated in CLI arguments here. Should we remove them under with, if they are no longer effective, since we're using a custom command?

Copy link

This PR has not seen activitiy for a while. It will be closed in 7 days unless further activity is detected.

@github-actions github-actions bot added the Stale label May 23, 2024
Copy link

This PR has been closed because of inactivity.

@github-actions github-actions bot closed this May 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants