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: Adding feature to run a spec file with count #35282

Merged
merged 2 commits into from
Jul 30, 2024

Conversation

sagar-qa007
Copy link
Contributor

@sagar-qa007 sagar-qa007 commented Jul 30, 2024

Description

It is for running a spec file with given run_count

Fixes #34956

Automation

/ok-to-test tags=""

🔍 Cypress test results

Caution

If you modify the content in this section, you are likely to disrupt the CI result for your PR.

Communication

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

  • Yes
  • No

Summary by CodeRabbit

  • New Features

    • Introduced a new GitHub Actions CI workflow for running limited tests, enhancing the flexibility and management of the testing process.
    • Added a new dependency for improved Cypress testing capabilities, allowing for more efficient test execution.
  • Improvements

    • Enhanced artifact management for test runs and results within the CI workflow for a more robust development lifecycle.

Copy link
Contributor

coderabbitai bot commented Jul 30, 2024

Walkthrough

The recent changes introduce a new GitHub Actions workflow for the Appsmith application, enhancing the continuous integration process by allowing for repeatable limited test runs. Additionally, a new Cypress dependency has been added to improve testing capabilities. Together, these updates aim to streamline testing, improve artifact management, and contribute to a more robust development lifecycle.

Changes

Files Change Summary
.github/workflows/ci-test-limited-with-count.yml Added a new CI workflow for limited test executions, supporting manual triggers and input parameters for flexibility.
app/client/package.json Introduced a new dependency "cypress-repeat-updated": "^1.0.1" to enhance Cypress testing capabilities.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant GitHub Actions
    participant Docker Hub
    participant Testing Environment
    participant Cypress

    User->>GitHub Actions: Trigger CI Workflow
    GitHub Actions->>Docker Hub: Setup Docker Services
    GitHub Actions->>Testing Environment: Checkout Code
    Testing Environment->>Testing Environment: Install Dependencies
    Testing Environment->>Cypress: Run Tests
    Cypress-->>Testing Environment: Return Test Results
    Testing Environment-->>GitHub Actions: Save Artifacts
    GitHub Actions-->>User: Communicate Status
Loading

Poem

In the land of code, where the tests do play,
A new workflow blooms, lighting up the way.
Cypress now dances, with features anew,
Enhancing our journey, making testing true.
With each pull request, let our confidence rise,
Cheers to the changes, beneath open skies! 🌟


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

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

CodeRabbit Configuration 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.

@github-actions github-actions bot added skip-changelog Adding this label to a PR prevents it from being listed in the changelog Test labels Jul 30, 2024
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: 0

Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between d1a586e and 1f03402.

Files ignored due to path filters (1)
  • app/client/yarn.lock is excluded by !**/yarn.lock, !**/*.lock
Files selected for processing (2)
  • .github/workflows/ci-test-limited-with-count.yml (1 hunks)
  • app/client/package.json (1 hunks)
Additional comments not posted (39)
app/client/package.json (1)

121-121: Great job adding the cypress-repeat-updated dependency!

This addition will enhance the testing capabilities by allowing repeatable test runs. Ensure that this new dependency is compatible with the existing Cypress setup and verify if any additional configuration is needed.

.github/workflows/ci-test-limited-with-count.yml (38)

1-5: Well-defined workflow name and triggers!

The workflow name is clear, and the workflow_dispatch trigger allows for manual triggering, which is useful for testing purposes.


6-21: Good job defining the inputs for the workflow!

The inputs for PR number, previous workflow run ID, and run count are well-defined with appropriate descriptions and default values. This makes the workflow flexible and easy to use.


39-41: Great job specifying the job and runner!

The job ci-test-limited runs on ubuntu-latest, which is a good choice for a CI environment.


42-47: Nice conditional logic for job execution!

The if condition ensures that the job runs only under specific events, which helps in controlling the workflow execution.


48-50: Good use of defaults for the shell!

Specifying bash as the shell ensures consistency across steps.


52-64: Well-configured service containers!

The Redis and MongoDB services are correctly defined with appropriate Docker images and port mappings.


66-69: Good job setting up the Depot CLI!

Using the depot/setup-action@v1 action ensures that the Depot CLI is correctly set up.


70-74: Secure DockerHub login!

Using secrets for DockerHub credentials ensures secure access.


76-81: Correct handling of fork-based PRs!

Checking out the merge commit for fork-based PRs ensures that the correct code is tested.


83-87: Good handling of branch push events!

Checking out the head commit of the branch ensures that the latest code is tested.


88-90: Nice use of timestamps for cache keys!

Using timestamps helps in creating unique cache keys.


92-102: Efficient cache restoration!

Restoring the previous run result from the cache can save time and resources.


103-113: Smart handling of previous run results!

Using the previous run result to determine whether to rerun tests is efficient.


115-130: Good job retrieving specs to run!

Reading the specs from a file and excluding commented lines ensures that only the relevant tests are run.


131-138: Efficient artifact download!

Downloading the Docker image artifact from the previous run can save time.


139-146: Correct handling of current run artifacts!

Downloading the Docker image artifact for the current run ensures that the correct image is used.


147-150: Proper Docker image loading!

Loading the Docker image from a tar file is a good practice.


152-157: Good practice creating necessary folders!

Creating required folders ensures that the environment is correctly set up.


158-202: Comprehensive Docker setup!

Running the necessary Docker containers with the required configurations ensures that the tests have the correct environment.


204-207: Correct Node.js setup!

Using actions/setup-node@v4 to set up Node.js ensures that the correct version is used.


209-219: Efficient Yarn cache restoration!

Restoring the Yarn cache manually ensures that dependencies are installed quickly.


221-225: Proper dependency installation!

Installing dependencies with yarn install --immutable ensures that the correct versions are used.


227-234: Good setup for Cypress tests!

Setting up Cypress tests correctly ensures that the tests run smoothly.


235-240: Correct Chrome setup!

Using browser-actions/setup-chrome@latest ensures that the correct version of Chrome is used for the tests.


241-255: Nice handling of Git values!

Saving and displaying Git values helps in debugging and tracking the workflow.


266-280: Dynamic commit message setting!

Setting the commit message based on the event and inputs ensures clarity in logs.


282-352: Comprehensive Cypress test execution!

Running Cypress tests with the necessary environment variables and repeating the tests as specified ensures thorough testing.


353-357: Efficient log file management!

Trimming the number of Cypress log files helps in managing storage and keeping only the relevant logs.


358-365: Good practice uploading Cypress logs!

Uploading Cypress logs as artifacts ensures that they are available for debugging if needed.


366-373: Proper snapshot handling!

Uploading Cypress snapshots as artifacts ensures that visual test results are available for review.


374-380: Thorough log collection!

Collecting CI container logs helps in debugging and understanding the test environment.


381-389: Good practice uploading server logs!

Uploading server logs as artifacts ensures that they are available for debugging if needed.


390-395: Efficient report management!

Renaming and moving reports ensures that they are organized and easy to find.


396-403: Proper report handling!

Uploading Cypress reports as artifacts ensures that test results are available for review.


404-409: Smart status handling!

Setting the status to failedtest if there are test failures helps in tracking the workflow status.


410-418: Efficient caching of run results!

Storing the previous run result in the cache ensures that the workflow can efficiently handle retries.


419-426: Good practice uploading server logs!

Uploading server logs as artifacts ensures that they are available for debugging if needed.


428-432: Correct handling of successful runs!

Setting the status to success if the run is successful ensures that the workflow status is accurately tracked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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