Home / Companies / Aspect Build / Blog / Post Details
Content Deep Dive

Integration testing your container images with Bazel

Blog post from Aspect Build

Post Details
Company
Date Published
Author
Alex Eagle
Word Count
1,122
Language
English
Hacker News Points
-
Summary

Before Bazel, teams often used Docker Compose for managing test workflows that included building Docker images, launching containers, and executing test runners, but transitioning these processes to Bazel can be challenging. Two main approaches are outlined: "Bazel on the inside," which retains existing scripts while integrating Bazel commands, and "Bazel on the outside," which uses Bazel as the primary orchestrator, providing a more idiomatic solution that addresses several drawbacks of the former approach. The latter involves significant refactoring but offers benefits such as hermetic builds and improved portability, using tools like the testcontainers library to manage container lifecycles. Practical examples include using Bazel to test applications with mock AWS environments through localstack, avoiding real cloud interactions and enhancing test efficiency and reliability. The author expresses intentions to further develop related tools and invites collaboration for projects that could benefit from such advancements.