Skip to content

ci: Update screenshots with CI pipeline#38243

Closed
sagar-qa007 wants to merge 4 commits intoreleasefrom
chore/runupdatescreenshot
Closed

ci: Update screenshots with CI pipeline#38243
sagar-qa007 wants to merge 4 commits intoreleasefrom
chore/runupdatescreenshot

Conversation

@sagar-qa007
Copy link
Contributor

@sagar-qa007 sagar-qa007 commented Dec 18, 2024

Description

Adding workflow for updating snapshot with github CI.

Fixes #Issue Number

Automation

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

🔍 Cypress test results

Caution

🔴 🔴 🔴 Some tests have failed.
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/12412775772
Commit: d77812a
Cypress dashboard.
Tags: @tag.IDE
Spec:
The following are new failures, please fix them before merging the PR:

  1. cypress/e2e/Regression/ClientSide/Anvil/AnvilAppNavigation_spec.ts
  2. cypress/e2e/Regression/ClientSide/AppNavigation/AppNavigationWithAutoLayout_spec.ts
  3. cypress/e2e/Regression/ClientSide/AppNavigation/AppNavigationWithMultiplePages_spec.ts
  4. cypress/e2e/Regression/ClientSide/ExplorerTests/DragAndDropWidget_spec.js
  5. cypress/e2e/Regression/ClientSide/IDE/Canvas_Context_Property_Pane_1_spec.js
  6. cypress/e2e/Regression/ClientSide/IDE/Canvas_Context_Property_Pane_2_spec.js
  7. cypress/e2e/Regression/ClientSide/IDE/Canvas_Context_Selected_Widgets_spec.js
  8. cypress/e2e/Regression/ClientSide/IDE/Canvas_View_mode.ts
  9. cypress/e2e/Regression/ClientSide/IDE/IDE_Add_Pane_Interactions_spec.ts
  10. cypress/e2e/Regression/ClientSide/OtherUIFeatures/Logs1_spec.js
  11. cypress/e2e/Regression/ClientSide/OtherUIFeatures/Logs2_spec.js
List of identified flaky tests.
Thu, 19 Dec 2024 13:02:19 UTC

Communication

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

  • Yes
  • No

Summary by CodeRabbit

  • New Features

    • Introduced new input parameters update_snapshot and specs_to_run for enhanced CI workflow configurability.
    • Added steps to handle snapshot uploads and conditional test execution based on user-defined inputs.
  • Bug Fixes

    • Improved handling of snapshot updates and execution of specified Cypress specs in CI processes.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 18, 2024

Walkthrough

The pull request modifies three GitHub workflow files to enhance the CI process parameterization. New input parameters update_snapshot and specs_to_run have been added across the workflows, allowing for more granular control over test execution and snapshot handling. Additionally, existing steps have been updated to utilize these parameters, improving the flexibility and configurability of the CI workflows. The changes focus on refining conditional logic for test runs and snapshot updates while maintaining the overall structure of the workflows.

Changes

File Change Summary
.github/workflows/build-client-server-count.yml Added job outputs update_snapshot and specs_to_run in file-check job; Updated inputs for ci-test-limited and ci-test-limited-existing-docker-image jobs.
.github/workflows/ci-test-limited-with-count.yml Added new inputs update_snapshot (boolean) and specs_to_run (string); Modified Cypress test execution to conditionally handle snapshot updates.
.github/workflows/ci-test-limited.yml Clarified previous-workflow-run-id input; Added steps for managing Docker image artifacts; Enhanced error handling and artifact uploads.

Possibly related PRs

  • chore: Ability to run PR automations every time PR updates #35476: This PR introduces new input parameters update_snapshot and specs_to_run in the .github/workflows/pr-automation.yml, which are similar to the new parameters added in the main PR for the file-check job in .github/workflows/build-client-server-count.yml.
  • test: Testing pipeline with build yaml and run_count #35524: This PR modifies the .github/workflows/build-client-server-count.yml to include a new input parameter run_count, which aligns with the changes made in the main PR regarding the handling of parameters in CI workflows.
  • Fix: Fix for GHSL-2024-277 #36836: This PR also adds a run_count input parameter to the .github/workflows/ci-test-limited-with-count.yml, which is directly related to the changes made in the main PR.
  • chore: Fix chrome version to 129 #38183: This PR updates the Chrome version in the CI workflow files, which is relevant as it may affect the execution of tests that utilize the parameters modified in the main PR.

Suggested labels

ok-to-test, Test

Suggested reviewers

  • sharat87
  • ApekshaBhosale
  • yatinappsmith

Poem

🤖 Workflows dance with new delight,
Parameters sparkling, testing's might!
Snapshots update, specs take flight,
CI's magic, pure and bright!
Automation's poetry takes wing! 🚀


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

@sagar-qa007 sagar-qa007 changed the title ci: First cut for record ci: Update screenshots with CI pipeline Dec 18, 2024
@sagar-qa007
Copy link
Contributor Author

/ci-test-limit-count run_count=1 update_snapshot=true specs_to_run=cypress/e2e/Regression/ClientSide/Anvil/Widgets/AnvilButtonWidgetSnapshot_spec.ts

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

🧹 Nitpick comments (1)
.github/workflows/ci-test-limited-with-count.yml (1)

22-31: LGTM! Input parameters are well-defined.

The new parameters update_snapshot and specs_to_run are properly configured with appropriate descriptions and default values.

Minor formatting: Consider fixing the indentation for the description fields to match the parent level (8 spaces instead of 10).

Also applies to: 48-56

🧰 Tools
🪛 yamllint (1.35.1)

[warning] 23-23: wrong indentation: expected 8 but found 10

(indentation)

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 836b544 and fb551da.

📒 Files selected for processing (2)
  • .github/workflows/build-client-server-count.yml (5 hunks)
  • .github/workflows/ci-test-limited-with-count.yml (5 hunks)
🧰 Additional context used
🪛 yamllint (1.35.1)
.github/workflows/ci-test-limited-with-count.yml

[warning] 23-23: wrong indentation: expected 8 but found 10

(indentation)


[warning] 49-49: wrong indentation: expected 8 but found 10

(indentation)


[error] 133-133: trailing spaces

(trailing-spaces)


[error] 144-144: trailing spaces

(trailing-spaces)


[error] 494-494: trailing spaces

(trailing-spaces)


[error] 501-501: trailing spaces

(trailing-spaces)

.github/workflows/build-client-server-count.yml

[error] 43-43: trailing spaces

(trailing-spaces)

🔇 Additional comments (4)
.github/workflows/ci-test-limited-with-count.yml (2)

134-140: Snapshot handling implementation is robust.

The implementation properly manages both existing and new snapshots:

  • Uploads existing snapshots before tests
  • Uploads new snapshots after tests
  • Uses always() condition to ensure snapshots are preserved regardless of test results

Also applies to: 495-501


379-391: Test execution logic is well-implemented.

The conditional handling of snapshot updates and spec selection is clean and effective:

  • Clear branching logic for snapshot updates
  • Consistent command structure in both branches
  • Proper usage of input parameters
.github/workflows/build-client-server-count.yml (2)

20-21: Parameter handling in file-check job is well-implemented.

The implementation:

  • Follows consistent patterns for argument parsing
  • Sets appropriate default values
  • Properly exports values as job outputs

Also applies to: 44-58


170-171: Job input updates are properly implemented.

The changes:

  • Consistently pass new parameters to both test jobs
  • Properly handle type conversion using fromJson for boolean values
  • Maintain workflow structure integrity

Also applies to: 185-186

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

🧹 Nitpick comments (2)
.github/workflows/ci-test-limited-with-count.yml (2)

22-31: Fix indentation in workflow inputs.

The update_snapshot input parameter has incorrect indentation. While functional, it should be consistent with other inputs.

Apply this diff to fix the indentation:

      update_snapshot:
-          description: 'Give option to update snapshot (true/false)'
-          required: false
-          type: boolean
-          default: false
+        description: 'Give option to update snapshot (true/false)'
+        required: false
+        type: boolean
+        default: false

Also applies to: 48-56

🧰 Tools
🪛 yamllint (1.35.1)

[warning] 23-23: wrong indentation: expected 8 but found 10

(indentation)


133-133: Remove trailing spaces.

There are trailing spaces at the end of several lines that should be removed for consistency.

Also applies to: 144-144, 494-494, 501-501

🧰 Tools
🪛 yamllint (1.35.1)

[error] 133-133: trailing spaces

(trailing-spaces)

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between fb551da and 3e1b532.

📒 Files selected for processing (2)
  • .github/workflows/ci-test-limited-with-count.yml (5 hunks)
  • .github/workflows/ci-test-limited.yml (1 hunks)
🧰 Additional context used
🪛 yamllint (1.35.1)
.github/workflows/ci-test-limited-with-count.yml

[warning] 23-23: wrong indentation: expected 8 but found 10

(indentation)


[warning] 49-49: wrong indentation: expected 8 but found 10

(indentation)


[error] 133-133: trailing spaces

(trailing-spaces)


[error] 144-144: trailing spaces

(trailing-spaces)


[error] 494-494: trailing spaces

(trailing-spaces)


[error] 501-501: trailing spaces

(trailing-spaces)

🔇 Additional comments (3)
.github/workflows/ci-test-limited.yml (1)

421-421: LGTM: Using workspace-relative path for server logs.

Using ${{ github.workspace }} ensures consistent path resolution across different CI environments.

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

133-140: LGTM: Improved snapshot comparison workflow.

Good addition of separate steps for uploading existing and new snapshots, enabling better comparison and debugging of visual changes.

Also applies to: 494-501

🧰 Tools
🪛 yamllint (1.35.1)

[error] 133-133: trailing spaces

(trailing-spaces)


144-144: LGTM: Enhanced spec selection logic.

The condition now properly handles both user-specified specs and default specs from the limited-tests file.

🧰 Tools
🪛 yamllint (1.35.1)

[error] 144-144: trailing spaces

(trailing-spaces)

Comment on lines +379 to +391
if [[ "${{ inputs.update_snapshot }}" == "true" ]]; then
echo "Running Cypress with snapshot updates..."
CYPRESS_updateSnapshots=true npx cypress-repeat-pro run -n "${{ inputs.run_count }}" --force \
--spec "${{ inputs.specs_to_run }}" \
--config-file "cypress_ci_custom.config.ts" \
--browser ${{ env.BROWSER_PATH }}
--browser "${{ env.BROWSER_PATH }}"
else
echo "Running Cypress tests without snapshot updates..."
npx cypress-repeat-pro run -n "${{ inputs.run_count }}" --force \
--spec "${{ env.specs_to_run }}" \
--config-file "cypress_ci_custom.config.ts" \
--browser "${{ env.BROWSER_PATH }}"
fi
Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Codebase verification

Inconsistent spec path usage needs to be fixed

The workflow shows that specs_to_run is set as an environment variable when no specific specs are provided via input. The inconsistency in using inputs.specs_to_run vs env.specs_to_run could lead to test execution issues.

  • Line 380: Update mode uses ${{ inputs.specs_to_run }}
  • Line 388: Non-update mode uses ${{ env.specs_to_run }}

Both modes should consistently use either the input parameter or environment variable to ensure the same specs are run regardless of snapshot update mode.

🔗 Analysis chain

LGTM: Flexible snapshot update handling.

Good implementation of conditional snapshot updates based on the input parameter. The code clearly distinguishes between update and non-update modes.

However, there's a minor inconsistency in spec selection:

  • Update mode uses ${{ inputs.specs_to_run }}
  • Non-update mode uses ${{ env.specs_to_run }}

Let's verify if this difference is intentional:

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check if specs_to_run is used consistently across the workflow
rg -A 2 'specs_to_run' .github/workflows/ci-test-limited-with-count.yml

Length of output: 1359

@sagar-qa007 sagar-qa007 added the ok-to-test Required label for CI label Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

1 participant