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

Testcontainers cloud learning path #21146

Merged
merged 1 commit into from
Oct 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
50 changes: 50 additions & 0 deletions content/guides/testcontainers-cloud/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---
title: |
Mastering Testcontainers Cloud by Docker: streamlining integration testing with containers
linkTitle: Testcontainers Cloud by Docker
summary: |
Automate, scale, and optimize testing workflows with Testcontainers Cloud
description: |
Testcontainers Cloud by Docker streamlines integration testing by offloading container management to the cloud. It enables faster, consistent tests for containerized services like databases, improving performance and scalability in CI/CD pipelines without straining local or CI resources. Ideal for developers needing efficient, reliable testing environments.
levels: [Beginner]
products: [testcontainers]
params:
featured: true
image: images/learning-paths/testcontainers-cloud-learning-path.png
time: 12 minutes
resource_links:
- title: Testcontainers Guides
url: https://testcontainers.com/guides
- title: Testcontainers Best Practices
url: https://www.docker.com/blog/testcontainers-best-practices/
- title: Simple local development with Testcontainers Desktop
url: https://testcontainers.com/guides/simple-local-development-with-testcontainers-desktop/
- title: Streamlining Local Development with Dev Containers and Testcontainers Cloud
url: https://www.docker.com/blog/streamlining-local-development-with-dev-containers-and-testcontainers-cloud/
- title: Running Testcontainers Tests Using GitHub Actions and Testcontainers Cloud
url: https://www.docker.com/blog/running-testcontainers-tests-using-github-actions/
- title: Testcontainers Cloud on the Docker Blog
url: https://www.docker.com/search/?_sf_s=testcontainers%20cloud
---

Testcontainers Cloud is a cloud-based solution designed to streamline and enhance the process of running integration tests using Testcontainers. Testcontainers is the open source framework, which allows developers to easily spin up containerized dependencies such as databases, message brokers, and other services required for testing. By shifting the management of Testcontainers-based services to the cloud, Testcontainers Cloud optimizes performance, reduces resource constraints on local machines or CI servers, and ensures consistent test environments. This solution is particularly beneficial for teams working on complex, distributed systems, as it allows for scalable, isolated, and reliable testing without the typical overhead of managing containers locally.

Check failure on line 30 in content/guides/testcontainers-cloud/_index.md

View workflow job for this annotation

GitHub Actions / vale

[vale] reported by reviewdog 🐶 [Docker.Spacing] ' ' should have one space. Raw Output: {"message": "[Docker.Spacing] ' ' should have one space.", "location": {"path": "content/guides/testcontainers-cloud/_index.md", "range": {"start": {"line": 30, "column": 196}}}, "severity": "ERROR"}

Check warning on line 30 in content/guides/testcontainers-cloud/_index.md

View workflow job for this annotation

GitHub Actions / vale

[vale] reported by reviewdog 🐶 [Docker.RecommendedWords] Consider using 'lets' instead of 'allows' Raw Output: {"message": "[Docker.RecommendedWords] Consider using 'lets' instead of 'allows'", "location": {"path": "content/guides/testcontainers-cloud/_index.md", "range": {"start": {"line": 30, "column": 198}}}, "severity": "INFO"}

Check warning on line 30 in content/guides/testcontainers-cloud/_index.md

View workflow job for this annotation

GitHub Actions / vale

[vale] reported by reviewdog 🐶 [Docker.RecommendedWords] Consider using 'lets' instead of 'allows' Raw Output: {"message": "[Docker.RecommendedWords] Consider using 'lets' instead of 'allows'", "location": {"path": "content/guides/testcontainers-cloud/_index.md", "range": {"start": {"line": 30, "column": 658}}}, "severity": "INFO"}

## What you'll learn

- Understand the fundamentals of Docker Testcontainers Cloud and its role in integration testing.
- Learn how to set up and configure Docker Testcontainers Cloud for automated testing in various environments.
- Explore how Testcontainers Cloud integrates with CI/CD pipelines to streamline testing workflows.


## Tools integration

Works well with Docker Desktop, GitHub Actions, Jenkins, Kubernetes, and other CI solutions

Docker Pro, Team, and Business subscriptions come with Testcontainers Cloud runtime minutes, and additional minutes are available via consumption pricing.

## Who’s this for?

- Teams that build cloud-native applications and are already using Testcontainers open source.
- DevOps Teams that integrate automated container-based testing into CI/CD pipelines for continuous testing.
- QA Teams that seek scalable and consistent test environments for comprehensive integration and end-to-end testing.
- Developers who need reliable, containerized test environments for testing microservices and databases.
43 changes: 43 additions & 0 deletions content/guides/testcontainers-cloud/common-questions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
title: Common challenges and questions
description: Explore common challenges and questions related to Testcontainers Cloud by Docker.
weight: 40
---

<!-- vale Docker.HeadingLength = NO -->

### How is Testcontainers Cloud different from the open-source Testcontainers framework?

While the open-source Testcontainers is a library that provides a lightweight APIs for bootstrapping local development and test dependencies with real services wrapped in Docker containers, Testcontainers Cloud provides a cloud runtime for these containers. This reduces the resource strain on local environments and provides more scalability, especially in CI/CD workflows, that enables consistent Testcontainers experience across the organization.

### What types of containers can I run with Testcontainers Cloud?

Testcontainers Cloud supports any containers you would typically use with the Testcontainers framework, including databases (PostgreSQL, MySQL, MongoDB), message brokers (Kafka, RabbitMQ), and other services required for integration testing.

### Do I need to change my existing test code to use Testcontainers Cloud?

No, you don't need to change your existing test code. Testcontainers Cloud integrates seamlessly with the open-source Testcontainers framework. Once the cloud configuration is set up, it automatically manages the containers in the cloud without requiring code changes.

### How do I integrate Testcontainers Cloud into my project?

To integrate Testcontainers Cloud, you need to install the Testcontainers Desktop app and select run with Testcontainers Cloud option in the menu. In CI you’ll need to add a workflow step that downloads Testcontainers Cloud agent. No code changes are required beyond enabling Cloud runtime via the Testcontainers Desktop app locally or installing Testcontainers Cloud agent in CI.

### Can I use Testcontainers Cloud in a CI/CD pipeline?

Yes, Testcontainers Cloud is designed to work efficiently in CI/CD pipelines. It helps reduce build times and resource bottlenecks by offloading containers that you spin up with Testcontainers library to the cloud, making it a perfect fit for continuous testing environments.

### What are the benefits of using Testcontainers Cloud?

The key benefits include reduced resource usage on local machines and CI servers, scalability (run more containers without performance degradation), consistent testing environments, centralized monitoring, ease of CI configuration with removed security concerns of running Docker-in-Docker or a privileged daemon.

Check warning on line 31 in content/guides/testcontainers-cloud/common-questions.md

View workflow job for this annotation

GitHub Actions / vale

[vale] reported by reviewdog 🐶 [Docker.SentenceLength] Write short, concise sentences. (<=40 words) Raw Output: {"message": "[Docker.SentenceLength] Write short, concise sentences. (\u003c=40 words)", "location": {"path": "content/guides/testcontainers-cloud/common-questions.md", "range": {"start": {"line": 31, "column": 1}}}, "severity": "WARNING"}

### Does Testcontainers Cloud support all programming languages?

Testcontainers Cloud supports any language that works with the open-source Testcontainers libraries, including Java, Python, Node.js, Go, and others. As long as your project uses Testcontainers, it can be offloaded to Testcontainers Cloud.

### How is container cleanup handled in Testcontainers Cloud?

While Testcontainers library automatically handles container lifecycle management, Testcontainers Cloud manages the allocated cloud worker lifetime. This means that containers are spun up, monitored, and cleaned up after tests are completed by Testcontainers library, and the worker where these containers have being running will be removed automatically after the ~35 min idle period by Testcontainers Cloud. This approach frees developers from manually managing containers and assosiated cloud resources.

### Is there a free tier or pricing model for Testcontainers Cloud?

Pricing details for Testcontainers Cloud can be found on the [pricing page](https://testcontainers.com/cloud/pricing/).
23 changes: 23 additions & 0 deletions content/guides/testcontainers-cloud/demo-ci.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
title: Configuring Testcontainers Cloud in the CI Pipeline
description: Use Testcontainers Cloud with GitHub Workflows to automate testing in a CI pipeline.
weight: 30
---

{{< youtube-embed "https://youtu.be/NlZY9aumKJU" >}}

This demo shows how Testcontainers Cloud can be seamlessly integrated into a
Continuous Integration (CI) pipeline using GitHub Workflows, providing a
powerful solution for running containerized integration tests without
overloading local or CI runner resources. By leveraging GitHub Actions,
developers can automate the process of spinning up and managing containers for
testing in the cloud, ensuring faster and more reliable test execution. With
just a few configuration steps, including setting up Testcontainers Cloud
authentication and adding it to your workflow, you can offload container
orchestration to the cloud. This approach improves the scalability of your
pipeline, ensures consistency across tests, and simplifies resource management,
making it an ideal solution for modern, containerized development workflows.

- Understand how to set up a GitHub Actions workflow to automate the build and testing of a project.
- Learn how to configure Testcontainers Cloud within GitHub Actions to offload containerized testing to the cloud, improving efficiency and resource management.
- Explore how Testcontainers Cloud integrates with GitHub workflows to run integration tests that require containerized services, such as databases and message brokers.
19 changes: 19 additions & 0 deletions content/guides/testcontainers-cloud/demo-local.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
title: Setting up Testcontainers Cloud by Docker
description: Set up Testcontainers Cloud by Docker in a local development environment.
weight: 20
---

{{< youtube-embed "https://youtu.be/7c3xLAG560U" >}}

This demo shows the process of setting up Testcontainers Cloud by Docker to
work in your local development environment using the Testcontainers Desktop
application. By the end of this walkthrough, you'll have Testcontainers Cloud
by Docker up and running, ready to offload container management from your local
machine to the cloud for more efficient testing.

- Install and configure Testcontainers Cloud and the CLI to seamlessly integrate with your local development environment.
- Set up and configure the Testcontainers Desktop application to monitor and manage cloud-based containers during local tests.
- Create and run integration tests using Testcontainers that leverage cloud-based container resources.
- Monitor and manage containers efficiently, understanding how Testcontainers Cloud automates cleanup and ensures consistent testing environments.
- Review options for monitoring and troubleshooting in the Testcontainers Cloud Dashboard.
18 changes: 18 additions & 0 deletions content/guides/testcontainers-cloud/why.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
title: Why Testcontainers Cloud?
description: Learn how Testcontainers Cloud by Docker can help you optimize integration testing.
weight: 10
---

{{< youtube-embed "https://youtu.be/6dRRlk5Vd0E" >}}

Testcontainers Cloud is a powerful cloud-based solution designed to optimize integration testing with Testcontainers by offloading container management to the cloud. It helps developers and teams overcome the limitations of traditional local and CI-based testing, ensuring consistent environments, faster test execution, and scalable workflows. Whether you're new to Testcontainers or looking to enhance your existing setup, Testcontainers Cloud offers a seamless way to manage containerized tests, improving efficiency and reliability in your development pipeline.

Testcontainers Cloud provides several benefits:

- **Offloading to the Cloud:** Frees up local resources by shifting container management to the cloud, keeping your laptop responsive.
- **Consistent Testing Environments:** Ensures that tests run in isolated, reliable environments, reducing inconsistencies across platforms from Dev to CI.

Check failure on line 14 in content/guides/testcontainers-cloud/why.md

View workflow job for this annotation

GitHub Actions / vale

[vale] reported by reviewdog 🐶 [Vale.Spelling] Did you really mean 'Dev'? Raw Output: {"message": "[Vale.Spelling] Did you really mean 'Dev'?", "location": {"path": "content/guides/testcontainers-cloud/why.md", "range": {"start": {"line": 14, "column": 146}}}, "severity": "ERROR"}
- **Scalability:** Allows running large numbers of containers simultaneously without being limited by local or CI resources.

Check warning on line 15 in content/guides/testcontainers-cloud/why.md

View workflow job for this annotation

GitHub Actions / vale

[vale] reported by reviewdog 🐶 [Docker.RecommendedWords] Consider using 'lets' instead of 'Allows' Raw Output: {"message": "[Docker.RecommendedWords] Consider using 'lets' instead of 'Allows'", "location": {"path": "content/guides/testcontainers-cloud/why.md", "range": {"start": {"line": 15, "column": 20}}}, "severity": "INFO"}
- **Faster CI/CD Pipelines:** Reduces configuration bottlenecks and speeds up build times by offloading containers to multiple on-demand cloud workers with the Turbo-mode feature.

Testcontainers Cloud streamlines integration testing by offloading container management to the cloud, ensuring consistent environments and faster test execution resulting in reduced resource strain, making it an essential tool for improving the stability of your Testcontainers-based workflows.
Loading