Update Dockerfile and BATS tests for MailHog#25
Merged
tobybellwood merged 4 commits intomainfrom Apr 13, 2026
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Adds automated structure and runtime verification for the MailHog Docker image (including Lagoon/ssmtp email-flow checks), and wires those tests into local workflows and CI while updating the build base images.
Changes:
- Add BATS-based image structure tests and runtime SMTP/HTTP/API + Lagoon ssmtp integration tests.
- Add a Makefile to build the image and run the BATS suites locally.
- Update the Dockerfile base images and refresh/pin GitHub Actions used in the build/test workflow.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
tests/runtime.bats |
New end-to-end runtime tests using a real MailHog container + Lagoon PHP ssmtp flows. |
tests/image_structure.bats |
New lightweight image metadata/binary/entrypoint/ports assertions. |
Makefile |
Local developer entrypoints for building and running the BATS suites. |
Dockerfile |
Updates builder/runtime base images for the MailHog image build. |
.github/workflows/build_and_test.yml |
Pins/updates actions and runs the new BATS tests in CI. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces several improvements to the build, test, and development workflow for the MailHog Docker image. The most significant changes include updating the Docker base images, enhancing the GitHub Actions workflow to use more secure and up-to-date actions with pinned SHAs, adding comprehensive BATS-based tests for image validation, and providing a new
Makefileto streamline local development and testing.Build and Test Workflow Improvements:
.github/workflows/build_and_test.ymlto use pinned SHA references for all actions, improving security and reproducibility. Also upgraded to the latest major versions of key Docker actions. [1] [2] [3] [4]bats-core,pygmy,dockerize) via Homebrew.Testing Enhancements:
tests/image_structure.bats, a BATS test suite that verifies the presence, executability, and configuration (ports, entrypoint, working directory) of the MailHog binary in the Docker image.Development Tooling:
Makefilethat provides targets for building the Docker image, running all or specific BATS tests, opening a shell in the container, and cleaning up local images. This simplifies local development and testing workflows.Docker Image Updates:
Dockerfileto use newer base images:golang:1.25-alpine3.23for building andalpine:3.23for the runtime image, ensuring up-to-date dependencies and security patches.