-
-
Notifications
You must be signed in to change notification settings - Fork 583
chore(weaviate): use Run function #3442
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
chore(weaviate): use Run function #3442
Conversation
This commit migrates the weaviate module to use the new testcontainers.Run() API. The main changes are: - Use testcontainers.Run() instead of testcontainers.GenericContainer() - Convert to moduleOpts pattern with functional options - Use WithCmd, WithExposedPorts, WithEnv, WithWaitStrategy - Multiple wait strategies for HTTP and gRPC ports Tests: 7 tests, 78.6% coverage Ref: testcontainers#3174 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
✅ Deploy Preview for testcontainers-go ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Summary by CodeRabbit
WalkthroughRefactors the Weaviate module to construct container configuration using functional options and invokes testcontainers.Run. Removes manual GenericContainerRequest/GenericContainer usage, updates error text, preserves wait strategy, and adapts container handling to the Run return value. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor Caller
participant Weaviate as Weaviate Module
participant TC as testcontainers.Run
participant Runtime as Container Runtime
Caller->>Weaviate: Run(ctx, image, opts...)
Weaviate->>Weaviate: Build moduleOpts (WithCmd, WithExposedPorts, WithEnv, WithWaitStrategy)
Weaviate->>Weaviate: Append user-provided opts
Weaviate->>TC: Run(ctx, image, moduleOpts...)
TC->>Runtime: Create & start container
Runtime-->>TC: Container handle or error
alt success
TC-->>Weaviate: ctr
Weaviate->>Weaviate: Map ctr -> WeaviateContainer
Weaviate-->>Caller: WeaviateContainer
else failure
TC-->>Weaviate: error
Note right of Weaviate: Return error "run weaviate: %w"
Weaviate-->>Caller: error
end
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🧰 Additional context used🧬 Code graph analysis (1)modules/weaviate/weaviate.go (3)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
🔇 Additional comments (3)
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. Comment |
What does this PR do?
Use the Run function in weaviate
Why is it important?
Migrate modules to the new API, improving consistency and leveraging the latest testcontainers functionality.
Related issues