Skip to content

Conversation

@mkysel
Copy link
Collaborator

@mkysel mkysel commented Mar 21, 2025

Re-enable and Update Upgrade Tests with Container Configuration Changes

Re-enabled upgrade test workflow in GitHub Actions, modified container test configuration in docker_utils_test.go to expose port 5050/tcp and use testcontainers.CleanupContainer, and updated test versions in upgrade_test.go to use sha-94af7b1 instead of deprecated 0.2.X versions.

📍Where to Start

The GitHub Actions workflow configuration in upgrade-test.yml which defines the overall test execution setup.


Macroscope summarized e96f26b.

Summary by CodeRabbit

  • Chores
    • Upgraded the upgrade testing process to ensure active validation of system improvements.
  • Tests
    • Refined container management tests to enhance efficiency and reliability.
    • Updated compatibility checks to focus on a known stable development version for smoother upgrade transitions.

@mkysel mkysel requested a review from a team as a code owner March 21, 2025 16:39
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 21, 2025

Walkthrough

This pull request updates the upgrade testing configuration and test logic. In the GitHub Actions workflow file, a job was renamed from noop to test and its upgrade test steps were enabled. In the upgrade test files, the container setup function was adjusted to expose a specific port and to streamline error handling, and the set of version strings used in upgrade tests was changed. All modifications are aimed at activating and refining the upgrade test process.

Changes

File(s) Change Summary
.github/.../upgrade-test.yml Renamed the job from noop to test and uncommented/activated the upgrade test steps (repository checkout with submodules, Go environment setup, Docker command execution, Foundry toolchain installation, local deployment, node registration, and test execution with env vars).
pkg/upgrade/docker_utils_test.go and
pkg/upgrade/upgrade_test.go
In docker_utils_test.go: Updated the container creation by adding an ExposedPorts field for 5050/tcp, simplified the waiting log message, refactored variable naming, and streamlined error handling with testcontainers.CleanupContainer.
In upgrade_test.go: Removed older version strings and replaced them with "sha-94af7b1", reflecting a change in version compatibility.

Sequence Diagram(s)

sequenceDiagram
  participant Runner as GitHub Actions Runner
  participant Repo as Repository
  participant Docker as Docker Engine
  participant Foundry as Foundry Toolchain
  participant Node as Local Node

  Runner->>Repo: Checkout repository (with submodules)
  Runner->>Runner: Set up Go environment (using version file)
  Runner->>Docker: Execute Docker command
  Runner->>Foundry: Install Foundry toolchain
  Runner->>Node: Deploy contracts and register local node
  Runner->>Runner: Run upgrade tests (with specific env vars)
Loading

Possibly related PRs

  • Upgrade tests #483: Introduces a new test function that builds and runs upgrade tests, aligning with the current configuration changes.
  • Fix CI error #635: Modifies job configurations by removing a previous job and indicating upgrade tests are disabled, which contrasts with the activation in this PR.

Suggested reviewers

  • fbac
  • neekolas

📜 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 94af7b1 and 8606da5.

📒 Files selected for processing (3)
  • .github/workflows/upgrade-test.yml (1 hunks)
  • pkg/upgrade/docker_utils_test.go (1 hunks)
  • pkg/upgrade/upgrade_test.go (1 hunks)
🔇 Additional comments (8)
pkg/upgrade/upgrade_test.go (1)

14-18: Change from multiple versions to a single commit hash is appropriate.

The change from using multiple release versions to a single commit hash makes sense given that older 0.2.X versions are no longer compatible. Using a known stable development version (sha-94af7b1) is a pragmatic approach when no released versions work with the current codebase.

Consider documenting somewhere (e.g., README or documentation) the process for updating this hash when needed, as it will require manual updates in the future.

.github/workflows/upgrade-test.yml (4)

17-18: Successfully re-enabled the upgrade test workflow.

Renaming the job from noop to test and providing a descriptive name clarifies the purpose of this workflow.


21-26: Proper Git checkout configuration.

The checkout configuration with recursive submodules, fetch-tags, and appropriate fetch-depth ensures all necessary code is available for testing.


27-31: Appropriate Go setup.

Using the version specified in go.mod and caching dependencies will help with consistent builds and improved performance.


32-49: Complete test environment setup and execution.

The workflow properly sets up all required dependencies (Docker, Foundry), deploys necessary contracts, registers a local node, and runs the upgrade tests with the required environment variables.

Make sure that the ENABLE_UPGRADE_TESTS environment variable is documented somewhere as it's required for the tests to run (as seen in the skipIfNotEnabled function in the test code).

pkg/upgrade/docker_utils_test.go (3)

154-159: Port exposure for container connectivity.

Exposing port 5050/tcp is a good addition that ensures the GRPC server is accessible. This change is consistent with the PR objective to update container configuration.


163-165: Simplified log wait condition.

The simplification of the log wait condition from "replication.api\tserving grpc" to just "serving grpc" likely makes the test more robust to formatting changes in the log output.


168-179: Improved container management with testcontainers.

The refactored container creation and cleanup approach using testcontainers.CleanupContainer(t, xmtpContainer) is cleaner and follows testcontainers best practices. This approach ensures proper resource cleanup when tests finish or fail.

The direct error return also simplifies the code by removing redundant error handling.

✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ 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.

@macroscopeapp
Copy link

macroscopeapp bot commented Mar 21, 2025

Changes in 8606da5

  • Reformatted testcontainers.GenericContainer function call in upgrade tests by splitting parameters across multiple lines

Macroscope summarized 8606da5.

@mkysel mkysel merged commit eb9a385 into main Mar 21, 2025
8 of 9 checks passed
@mkysel mkysel deleted the mkysel/reenable-upgrade branch March 21, 2025 16:46
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.

3 participants