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 option to run e2e twice #3262

Draft
wants to merge 1 commit into
base: develop
Choose a base branch
from
Draft

ci: add option to run e2e twice #3262

wants to merge 1 commit into from

Conversation

gartnera
Copy link
Member

@gartnera gartnera commented Dec 9, 2024

Add option to run default e2e tests twice in CI. Always run twice in merge queue.

We want to ensure that the default e2e tests are never dependent on the system state.

Adds ~8 minutes to mergequeue times.

Summary by CodeRabbit

  • New Features

    • Introduced a new output variable TWICE_TESTS to conditionally run tests multiple times based on pull request labels.
    • Added a new input parameter run-twice to the reusable E2E testing workflow, allowing for a second execution of tests.
    • Implemented additional steps for a second test run and log monitoring based on the run-twice input.
  • Bug Fixes

    • Enhanced the conditional execution logic for tests in the E2E workflow.

@gartnera gartnera added no-changelog Skip changelog CI check TWICE_TESTS Run default e2e tests twice labels Dec 9, 2024
Copy link
Contributor

coderabbitai bot commented Dec 9, 2024

📝 Walkthrough

Walkthrough

The pull request introduces modifications to the GitHub Actions workflows in .github/workflows/e2e.yml and .github/workflows/reusable-e2e.yml. A new output variable TWICE_TESTS is added to the matrix-conditionals job, determining whether tests should run twice based on a label or default value. The e2e job is updated to utilize this output. Additionally, the reusable E2E workflow now includes a run-twice input parameter, enabling an optional second execution of tests. New steps for this second run are conditionally executed based on the input's value.

Changes

File Change Summary
.github/workflows/e2e.yml Added output variable TWICE_TESTS in job matrix-conditionals and utilized it in job e2e for conditional test execution.
.github/workflows/reusable-e2e.yml Introduced input parameter run-twice (boolean) to E2E workflow; added steps for conditional second test run.

Possibly related PRs

Suggested reviewers

  • lumtis
  • skosito
  • morde08
  • julianrubino

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. (Experiment)
  • @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 ci Changes to CI pipeline or github actions label Dec 9, 2024
Copy link

codecov bot commented Dec 9, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 61.78%. Comparing base (bc1d8ae) to head (a3bf34a).
Report is 3 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #3262      +/-   ##
===========================================
+ Coverage    61.74%   61.78%   +0.03%     
===========================================
  Files          431      431              
  Lines        30772    30786      +14     
===========================================
+ Hits         19001    19021      +20     
+ Misses       10914    10909       -5     
+ Partials       857      856       -1     

see 9 files with indirect coverage changes

@gartnera gartnera marked this pull request as ready for review December 10, 2024 00:42
@gartnera gartnera requested a review from a team as a code owner December 10, 2024 00:42
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

🧹 Outside diff range and nitpick comments (1)
.github/workflows/reusable-e2e.yml (1)

87-90: Fix potential word splitting in container ID assignment

The current shell script might be susceptible to word splitting issues.

Apply this diff to make the script more robust:

         run: |
-          container_id=$(docker ps --filter "ancestor=orchestrator:latest" --format "{{.ID}}")
+          container_id="$(docker ps --filter "ancestor=orchestrator:latest" --format '{{.ID}}')"
           docker logs --since -10s -f "${container_id}" &
           exit $(docker wait "${container_id}")
🧰 Tools
🪛 actionlint (1.7.4)

87-87: shellcheck reported issue in this script: SC2046:warning:3:6: Quote this to prevent word splitting

(shellcheck)

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 1329066 and a3bf34a.

📒 Files selected for processing (2)
  • .github/workflows/e2e.yml (4 hunks)
  • .github/workflows/reusable-e2e.yml (2 hunks)
🧰 Additional context used
🪛 actionlint (1.7.4)
.github/workflows/reusable-e2e.yml

87-87: shellcheck reported issue in this script: SC2046:warning:3:6: Quote this to prevent word splitting

(shellcheck)

🔇 Additional comments (1)
.github/workflows/e2e.yml (1)

126-126: LGTM! Implementation aligns with PR objectives

The changes effectively implement the requirement to run e2e tests twice:

  • Configurable via PR label "TWICE_TESTS"
  • Automatically enabled for merge queue
  • Selectively applied to default e2e tests only

Also applies to: 160-160, 164-164, 230-230, 277-277

.github/workflows/reusable-e2e.yml Show resolved Hide resolved
Copy link
Contributor

@skosito skosito left a comment

Choose a reason for hiding this comment

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

lgtm but would be nice to add more context in PR description

Copy link
Member

@lumtis lumtis left a comment

Choose a reason for hiding this comment

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

Adds ~8 minutes to mergequeue times.

Can't we run these concurrently instead of sequentially?

Copy link
Contributor

@kingpinXD kingpinXD left a comment

Choose a reason for hiding this comment

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

Can we just add the TSS MIGRATION test when merging instead ?
It might take a bit more that just running e2e twice , but it would also cover more use cases .

@gartnera
Copy link
Member Author

gartnera commented Dec 10, 2024

Can't we run these concurrently instead of sequentially?

No since the point of the second run is to ensure that the tests work given the state leftover from the first run.

Can we just add the TSS MIGRATION test when merging instead ?

Yeah we could do that but it would take a bit longer (looks like +5 minutes)

Copy link
Member

@lumtis lumtis left a comment

Choose a reason for hiding this comment

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

No since the point of the second run is to ensure that the tests work given the state leftover from the second run.

I see. I'm in if it can catch edge cases

@kingpinXD
Copy link
Contributor

kingpinXD commented Dec 11, 2024

Yeah we could do that but it would take a bit longer (looks like +5 minutes)

Just curious, is 5 minutes a significant delay here? It does provide the value of testing the TSS migration as well. And reuse exiting code

@gartnera
Copy link
Member Author

Just curious, is 5 minutes a significant delay here? It does provide the value of testing the TSS migration as well. And reuse exiting code

Yeah maybe an extra 5 minutes isn't very significant. And I think the tss migrations tests may be stable enough to run in the mergequeue now too.

@gartnera gartnera marked this pull request as draft December 12, 2024 23:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci Changes to CI pipeline or github actions no-changelog Skip changelog CI check TWICE_TESTS Run default e2e tests twice
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants