Skip to content

Update Dockerfile and BATS tests for MailHog#25

Merged
tobybellwood merged 4 commits intomainfrom
bats-tests
Apr 13, 2026
Merged

Update Dockerfile and BATS tests for MailHog#25
tobybellwood merged 4 commits intomainfrom
bats-tests

Conversation

@tobybellwood
Copy link
Copy Markdown
Contributor

@tobybellwood tobybellwood commented Mar 18, 2026

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 Makefile to streamline local development and testing.

Build and Test Workflow Improvements:

  • Updated the GitHub Actions workflow in .github/workflows/build_and_test.yml to 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]
  • Enhanced the workflow to set and use a single image tag, perform find-and-replace in example files, and install required tools (bats-core, pygmy, dockerize) via Homebrew.
  • Added steps to pull required images and run new BATS-based image structure and runtime tests as part of the CI pipeline.

Testing Enhancements:

  • Introduced 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:

  • Added a Makefile that 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:

  • Updated the Dockerfile to use newer base images: golang:1.25-alpine3.23 for building and alpine:3.23 for the runtime image, ensuring up-to-date dependencies and security patches.

@tobybellwood tobybellwood marked this pull request as ready for review March 18, 2026 05:29
@tobybellwood tobybellwood requested a review from Copilot March 18, 2026 05:29
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread tests/runtime.bats Outdated
Comment thread tests/runtime.bats Outdated
Comment thread tests/runtime.bats Outdated
Comment thread tests/runtime.bats
@tobybellwood tobybellwood merged commit 9279719 into main Apr 13, 2026
2 checks passed
@tobybellwood tobybellwood deleted the bats-tests branch April 13, 2026 04:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants