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

fix(e2e): Added selection by PR created time to checking previous tests #17294

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

HajekOndrej
Copy link
Contributor

Description

Added selection by PR created time to checking previous tests as well as running e2e only on PRs not on drafts.

Related Issue

#17293

Screenshots:

Copy link

coderabbitai bot commented Feb 27, 2025

Walkthrough

The pull request introduces a new required input parameter, pr_created, which accepts the ISO 8601 timestamp of the pull request’s creation. In the action configuration, this parameter is stored in a variable (PR_CREATED_TIMESTAMP) and is used to filter previous test runs by including a created query parameter in the URL. Additionally, both the desktop and web end-to-end test workflows have been updated. The pull request event trigger now includes additional events—opened, ready_for_review, and synchronize—to initiate these workflows. The execution conditions for the test jobs have been modified to run only if the repository matches the expected value and the pull request is either not the triggering event or is not in draft status. In the workflows, the new pr_created value is passed to relevant steps, standardizing the handling of pull request timestamps across the configurations.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between cba9e02 and 7597818.

📒 Files selected for processing (1)
  • docs/tests/e2e-playwright-suite.md (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • docs/tests/e2e-playwright-suite.md
⏰ Context from checks skipped due to timeout of 90000ms (4)
  • GitHub Check: run-desktop-tests (@group=passphrase, trezor-user-env-unix)
  • GitHub Check: build-web
  • GitHub Check: Setup and Cache Dependencies
  • GitHub Check: Analyze with CodeQL (javascript)

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>, 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 generate docstrings to generate docstrings for this 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.

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.

Copy link

@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

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0598bb8 and a92f10d.

📒 Files selected for processing (3)
  • .github/actions/check-previous-test-runs/action.yml (3 hunks)
  • .github/workflows/test-suite-desktop-e2e.yml (3 hunks)
  • .github/workflows/test-suite-web-e2e-pw.yml (3 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (9)
  • GitHub Check: run-desktop-tests (@group=wallet, trezor-user-env-unix bitcoin-regtest)
  • GitHub Check: run-desktop-tests (@group=other, trezor-user-env-unix)
  • GitHub Check: run-desktop-tests (@group=passphrase, trezor-user-env-unix)
  • GitHub Check: run-desktop-tests (@group=settings, trezor-user-env-unix bitcoin-regtest)
  • GitHub Check: run-desktop-tests (@group=device-management, trezor-user-env-unix)
  • GitHub Check: Setup and Cache Dependencies
  • GitHub Check: run-desktop-tests (@group=suite, trezor-user-env-unix)
  • GitHub Check: build-web
  • GitHub Check: Analyze with CodeQL (javascript)
🔇 Additional comments (7)
.github/actions/check-previous-test-runs/action.yml (1)

10-12: Addition of the new input parameter pr_created
The new required input parameter captures the pull request’s creation timestamp in ISO 8601 format. This enhancement aligns with the PR objectives to filter previous test runs by creation time.

.github/workflows/test-suite-web-e2e-pw.yml (3)

11-14: Include additional PR event triggers
The introduction of the event types opened, ready_for_review, and synchronize broadens the triggers for pull request events. This is in line with the goal of initiating tests more proactively.


124-124: Update job condition to exclude draft PRs
The modified condition now ensures that the job runs only if the pull request is not a draft. This prevents unnecessary test executions on draft PRs and streamlines the workflow.


147-147: Pass the PR creation timestamp to the action
The new input parameter pr_created is correctly passed using ${{ github.event.pull_request.created_at }}, ensuring consistency with the action configuration and enabling proper filtering of previous workflow runs.

.github/workflows/test-suite-desktop-e2e.yml (3)

6-9: Enhance pull request trigger with additional event types
Adding the event types opened, ready_for_review, and synchronize ensures that the desktop e2e workflow is responsive to key pull request events. This incorporation is effective for triggering tests at the appropriate moments in the PR lifecycle.


35-35: Refine job condition to exclude draft PRs
The updated condition with (github.event_name != 'pull_request' || github.event.pull_request.draft == false) ensures that the desktop tests only execute for finalized PRs. This change helps avoid running tests on draft PRs, thereby improving the efficiency of the testing pipeline.


65-65: Integrate PR creation timestamp into the previous runs check
The addition of the pr_created parameter using ${{ github.event.pull_request.created_at }} in the "Check previous runs" step is consistent and necessary for filtering previous test runs accurately.

@HajekOndrej HajekOndrej force-pushed the fix-checking-passed-tests branch from a92f10d to cba9e02 Compare February 27, 2025 19:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant