openrewrite / openrewrite/rewrite-testing-frameworks

Testcontainers best practices recipes

Open
#438 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

recipe testcontainers
Dominant language
Java
Stars
100
Forks
105
Avg merge
2h 25m
Merged PRs (30d)
9

Description

Based on this nice article from @sivaprasadreddy
https://www.atomicjar.com/2023/11/testcontainers-best-practices/

What problem are you trying to solve?

Automate some of the best practices for testcontainers, such that users can adopt these with little effort, unlocking a move to testcontainers cloud in some areas.

  • Don’t rely on fixed ports for tests
  • Don’t hardcode the hostname
  • Don’t hardcode the container name
  • Copy files into containers instead of mounting them
  • Use the same container versions as in production
  • Use proper container lifecycle strategy
  • Leverage your framework’s integration for Testcontainers
  • User preconfigured technology-specific modules when possible
  • Use WaitStrategies to check the container is ready

Any additional context

In part also discussed on

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No implementation files, tests, or entry points are named; start by reviewing the repository structure and the linked discussion in rewrite-testing-frameworks/pull/433. The work would be complete when the agreed Testcontainers best practices are represented by maintainable recipes, with coverage for the checklist items in the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
testing-qa
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.