8000 test: add basic docker E2E which writes headers to DA network by chatton · Pull Request #2378 · rollkit/rollkit · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

test: add basic docker E2E which writes headers to DA network #2378

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

Merged
merged 14 commits into from
Jun 19, 2025

Conversation

chatton
Copy link
Contributor
@chatton chatton commented Jun 17, 2025

Overview

This PR adds a basic test which

  • spins up a celestia-app chain
  • spins up a bridge node
  • spins up a rollkit test app and verifies liveness.

Summary by CodeRabbit

  • New Features

    • Introduced comprehensive Docker-based end-to-end tests for blockchain components, enabling automated integration testing in multiple environments.
    • Added a dedicated test suite for validating Celestia and Rollkit node interactions within Docker containers.
  • Chores

    • Updated workflows to build and push multi-platform Docker images (linux/amd64 and linux/arm64).
    • Implemented a new workflow job to run Docker end-to-end tests automatically.
    • Updated .gitignore to exclude the vendor directory from version control.
  • Tests

    • Added new Makefile target for running Docker end-to-end tests with extended timeout.
    • Added new Go module and dependencies to support Docker-based testing.
    • Enhanced test scripts to allow exclusion of specific directories from test runs.

Copy link
Contributor
coderabbitai bot commented Jun 17, 2025

Walkthrough

This update introduces a comprehensive Docker-based end-to-end testing suite for blockchain components, specifically targeting Celestia and Rollkit chains. It adds new test infrastructure, updates the CI workflow to build multi-platform Docker images and run Docker E2E tests, and enhances test scripts to support directory exclusions and a new Docker E2E test target.

Changes

File(s) Change Summary
.github/workflows/test.yml Renamed and implemented the Docker E2E test job, updated Docker image build to support multi-platform (amd64, arm64), and 8000 adjusted workflow control flow.
.gitignore Added vendor directory to ignored paths.
scripts/test.mk Introduced test-docker-e2e Makefile target for running Docker E2E tests with extended timeout.
scripts/test_cover.go Added logic to exclude specified directories (including test/docker-e2e) from test execution and coverage collection.
test/docker-e2e/base_test.go Added TestBasicDockerE2E method to orchestrate and validate integration of Celestia and Rollkit nodes in Docker.
test/docker-e2e/docker_test.go Introduced a full Docker E2E testing suite, including provider and chain setup, node management, wallet funding, and configuration overrides.
test/docker-e2e/go.mod Created a dedicated Go module for Docker E2E tests with required dependencies and module replacements.

Sequence Diagram(s)

sequenceDiagram
    participant CI as CI Workflow
    participant Docker as Docker Build
    participant Test as Docker E2E Test Job
    participant Repo as Repository

    CI->>Repo: Checkout code
    CI->>Docker: Build and push multi-platform Docker image
    Docker-->>CI: Docker image tag
    CI->>Test: Run Docker E2E tests (make test-docker-e2e)
    Test->>Docker: Start Celestia and Rollkit nodes in containers
    Test->>Test: Orchestrate node startup, funding, and checks
    Test-->>CI: Test results
Loading

Possibly related PRs

Suggested reviewers

  • tac0turtle
  • alpe

Poem

In Docker fields where blockchains play,
New tests arise in a clever way.
Celestia and Rollkit, side by side,
Containers launched with code as guide.
Multi-platform builds, oh what a feat!
This bunny hops—E2E is sweet!
🐇✨

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 golangci-lint (1.64.8)

Error: you are using a configuration file for golangci-lint v2 with golangci-lint v1: please use golangci-lint v2
Failed executing command with error: you are using a configuration file for golangci-lint v2 with golangci-lint v1: please use golangci-lint v2


📜 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 688b877 and 612c424.

📒 Files selected for processing (1)
  • scripts/test_cover.go (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • scripts/test_cover.go
⏰ Context from checks skipped due to timeout of 90000ms (8)
  • GitHub Check: lint / golangci-lint
  • GitHub Check: lint / markdown-lint
  • GitHub Check: test / Run Integration Tests
  • GitHub Check: test / Run Unit Tests
  • GitHub Check: test / Build Docker Image
  • GitHub Check: test / Build All Rollkit Binaries
  • GitHub Check: Analyze (go)
  • GitHub Check: Summary
✨ 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.
    • Explain this complex logic.
    • 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 explain this code block.
    • @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 explain its main purpose.
    • @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.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

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 generate sequence diagram to generate a sequence diagram of the changes in 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.

@chatton chatton self-assigned this Jun 17, 2025
Copy link
github-actions bot commented Jun 17, 2025

The latest Buf updates on your PR. Results from workflow CI and Release / buf-check (pull_request).

BuildFormatLintBreakingUpdated (UTC)
✅ passed⏩ skipped✅ passed✅ passedJun 19, 2025, 9:59 AM

@chatton chatton changed the title [WIP] test: add basic docker E2E which writes headers to DA network test: add basic docker E2E which writes headers to DA network Jun 18, 2025
Comment on lines +104 to +105
Repository: "ghcr.io/celestiaorg/celestia-node",
Version: "pr-4283",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

has a fix which enables the signer type access wallets funded after initialization

Copy link
codecov bot commented Jun 18, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 71.69%. Comparing base (8b970af) to head (5d1501e).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2378   +/-   ##
=======================================
  Coverage   71.69%   71.69%           
=======================================
  Files          64       64           
  Lines        6306     6306           
=======================================
  Hits         4521     4521           
  Misses       1383     1383           
  Partials      402      402           
Flag Coverage Δ
combined 71.69% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@chatton chatton requested a review from tac0turtle June 18, 2025 12:33
@chatton chatton marked this pull request as ready for review June 18, 2025 12:33
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: 3

🧹 Nitpick comments (7)
.gitignore (1)

7-7: Addition is fine; consider whether you also want to ignore vendor/**

Plain vendor is usually sufficient, but some tooling (especially on Windows) can create nested vendor directories.
If you want to be fully safe, add a glob:

 vendor
+vendor/**
scripts/test_cover.go (1)

44-47: Formatting glitch in log string

The newline is inside the format string; the explanatory text appears on the next line with no prefix:

- fmt.Printf("--> Skipping tests in: %s\n as they are marked as excluded", modDir)
+ fmt.Printf("--> Skipping tests in: %s as it is in the exclude list\n", modDir)
scripts/test.mk (1)

41-45: Declare new target as .PHONY

Without the .PHONY declaration, a file named test-docker-e2e in the repo would prevent the rule from running.

 @cd test/docker-e2e && go test -mod=readonly -failfast -timeout=30m ./...
+.PHONY: test-docker-e2e
test/docker-e2e/base_test.go (1)

38-40: Use a context with timeout to prevent hanging CI

A stuck Docker container can block CI for 30 min. Wrap the root context:

ctx, cancel := context.WithTimeout(context.Background(), 25*time.Minute)
defer cancel()
.github/workflows/test.yml (1)

39-53: Add GHCR login (optional)
The Docker E2E tests will docker pull the freshly-pushed image from GHCR. Pulling anonymously can run into rate-limits; logging in (same as the build job) avoids that and keeps CI deterministic.

      - name: Log in to GHCR
        uses: docker/login-action@v3
        with:
          registry: ghcr.io
          username: ${{ github.actor }}
          password: ${{ secrets.GITHUB_TOKEN }}

Place this before the make test-docker-e2e step.

test/docker-e2e/docker_test.go (2)

210-228: Consider context timeouts when starting Rollkit nodes

rollkitNode.Init and rollkitNode.Start are called with the parent context; if the test hangs these calls can block indefinitely and stall CI. Wrapping the calls in context.WithTimeout (e.g. 5 min) makes failures surface earlier and releases runners.


232-248: Expose image repo via CI to avoid hard-coding

getRollkitImage falls back to ghcr.io/rollkit/rollkit. If the repo ever changes (e.g. forks, private images) the tests break silently. Pass ROLLKIT_IMAGE_REPO from the workflow (same place you set ROLLKIT_IMAGE_TAG) so the value is always explicit.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 6c5ab25 and 688b877.

⛔ Files ignored due to path filters (1)
  • test/docker-e2e/go.sum is excluded by !**/*.sum
📒 Files selected for processing (7)
  • .github/workflows/test.yml (1 hunks)
  • .gitignore (1 hunks)
  • scripts/test.mk (1 hunks)
  • scripts/test_cover.go (2 hunks)
  • test/docker-e2e/base_test.go (1 hunks)
  • test/docker-e2e/docker_test.go (1 hunks)
  • test/docker-e2e/go.mod (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Summary
🔇 Additional comments (3)
scripts/test_cover.go (1)

13-15: Importing standard‐library slices bumps the minimum Go version to 1.21

That’s OK, but please ensure go.mod in the root module declares go 1.21 (or higher) so the build will not fail on older builders.
If you need to stay < 1.21 you can fall back to golang.org/x/exp/slices.

test/docker-e2e/go.mod (1)

3-3: go 1.24.2 is not released yet

The highest released Go version is currently 1.22.x.
Using a future version will break all builders and CI runners that fetch toolchains automatically.

Change to the latest stable (e.g. go 1.22) unless you have a private toolchain.

-go 1.24.2
+go 1.22

Likely an incorrect or invalid review comment.

.github/workflows/test.yml (1)

36-36: Multi-platform build looks good – building for both amd64 + arm64 broadens compatibility without extra complexity.

Comment on lines 20 to 21
excludeDirs := []string{"test/docker-e2e"}

Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Hard-coded path separators break on Windows

excludeDirs is compared with modDir, which on Windows will contain back-slashes (\).
Use filepath.Clean + filepath.ToSlash (or the reverse) on both sides before comparison:

-    excludeDirs := []string{"test/docker-e2e"}
+    excludeDirs := []string{filepath.ToSlash("test/docker-e2e")}

and

-    if slices.Contains(excludeDirs, modDir) {
+    if slices.Contains(excludeDirs, filepath.ToSlash(modDir)) {
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
excludeDirs := []string{"test/docker-e2e"}
// Normalize the hard-coded path for excludeDirs
excludeDirs := []string{filepath.ToSlash("test/docker-e2e")}
// … later, when checking modDir against excludeDirs, normalize it too
if slices.Contains(excludeDirs, filepath.ToSlash(modDir)) {
// …
}
🤖 Prompt for AI Agents
In scripts/test_cover.go around lines 20 to 21, the excludeDirs slice contains
hard-coded path separators that will break on Windows because modDir uses
backslashes. To fix this, normalize both excludeDirs entries and modDir by
applying filepath.Clean followed by filepath.ToSlash before comparing them,
ensuring consistent path formats across platforms.

@tac0turtle tac0turtle enabled auto-merge June 19, 2025 09:59
@tac0turtle tac0turtle added this pull request to the merge queue Jun 19, 2025
Merged via the queue into main with commit 2cc7e0b Jun 19, 2025
24 checks passed
@tac0turtle tac0turtle deleted the cian/tastora-basic-test branch June 19, 2025 10:11
@github-project-automation github-project-automation bot moved this to Done in Rollkit Jun 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants
0