Skip to content

Add integration tests to CI#294

Open
mgaffigan wants to merge 5 commits into
OpenIntegrationEngine:mainfrom
mgaffigan:feat/smoketest
Open

Add integration tests to CI#294
mgaffigan wants to merge 5 commits into
OpenIntegrationEngine:mainfrom
mgaffigan:feat/smoketest

Conversation

@mgaffigan

Copy link
Copy Markdown
Contributor

Note: because #101 has not yet merged, this shows larger than it is. #101 needs to merge first, then this one.

Modifies CI to primarily build within docker. Uses that newfound docker capability to run message processing tests on alpine and Ubuntu, with back-ends for derby, mariadb, postgres, sqlserver.

Adds new file-based-tests. Procedure to add a test is:

  1. Create a test folder (ci/tests/110-hl7-no-op)
  2. Add any channels needed (ci/tests/110-hl7-no-op/channels/01-hl7-no-op/channel.xml) by exporting from a running instance
  3. Add messages (ci/tests/110-hl7-no-op/channels/01-hl7-no-op/messages/01-adt-a01/source)
  4. Add assertions (ci/tests/110-hl7-no-op/channels/01-hl7-no-op/messages/01-adt-a01/source_response)

See ci/README.md for more details on what assertions are available. There is a python escape hatch for fancy things and non-channel-based-testing. Integration tests produce ant-style results at ci/test-results.

Run tests locally by calling pwsh ci/runtests.ps1. For "inner loop troubleshooting" it is often worthwhile to skip unit tests and to specify a particular configuration with

pwsh ci/runtests.ps1 -DisableUnitTests -Configuration alpine-temurin21-mysql

Responsive to #11 and #98

@github-actions

github-actions Bot commented Apr 12, 2026

Copy link
Copy Markdown

Test Results

654 tests  ±0   653 ✅  - 1   3m 42s ⏱️ + 1m 6s
108 suites ±0     1 💤 +1 
108 files   ±0     0 ❌ ±0 

Results for commit 78d9b64. ± Comparison against base commit e72e766.

♻️ This comment has been updated with latest results.

@mgaffigan
mgaffigan force-pushed the feat/smoketest branch 2 times, most recently from c81c101 to a07f581 Compare April 12, 2026 04:50
Signed-off-by: Mitch Gaffigan <mitch.gaffigan@comcast.net>
Signed-off-by: Mitch Gaffigan <mitch.gaffigan@comcast.net>
Signed-off-by: Mitch Gaffigan <mitch.gaffigan@comcast.net>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR shifts CI toward Docker-based builds and adds a Dockerized integration-test runner that boots various docker-compose configurations and validates message processing using filesystem-discovered fixtures, publishing JUnit XML results as artifacts.

Changes:

  • Update GitHub Actions build pipeline to build/load Docker images, export build artifacts/test results from a Docker stage, and run matrix “docker smoke” integration tests per configuration.
  • Add a Python-based test runner container (ci/runner/) plus a PowerShell entrypoint for local execution (ci/runtests.ps1).
  • Introduce file-based integration test fixtures under ci/tests/ (RAW and HL7 no-op examples) and formalize the approach in ci/README.md.

Reviewed changes

Copilot reviewed 30 out of 30 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
tools/gen-dockerignore.py Adds generator to derive .dockerignore from .gitignore plus Docker-specific excludes.
server/src/test/java/com/mirth/connect/server/launcher/Log4jMigrationsTest.java Makes a migration test conditional when filesystem permission semantics don’t enforce non-writability.
Dockerfile Adds a scratch stage to export build artifacts/test-results for CI packaging and upload.
ci/tests/110-hl7-no-op/channels/01-hl7-no-op/messages/01-adt-a01/source_response Adds expected source ACK fixture for HL7 test.
ci/tests/110-hl7-no-op/channels/01-hl7-no-op/messages/01-adt-a01/source Adds HL7 ADT^A01 input message fixture.
ci/tests/110-hl7-no-op/channels/01-hl7-no-op/messages/01-adt-a01/dest01_metadata.yml Adds destination metadata assertions for HL7 test.
ci/tests/110-hl7-no-op/channels/01-hl7-no-op/channel.xml Adds exported HL7 channel fixture with metadata column mappings.
ci/tests/101-raw-no-op/channels/01-raw-no-op/messages/01-hello-world/source Adds RAW message input fixture.
ci/tests/101-raw-no-op/channels/01-raw-no-op/messages/01-hello-world/dest01 Adds RAW destination content assertion fixture.
ci/tests/101-raw-no-op/channels/01-raw-no-op/channel.xml Adds exported RAW channel fixture with metadata column mappings.
ci/runtests.ps1 Adds local test entrypoint that builds images and runs the runner container against configs.
ci/runner/run.py Adds runner entrypoint wrapper for calling main().
ci/runner/messagetests.py Implements message fixture discovery, message submission, polling, and assertions (with wildcard support).
ci/runner/main.py Implements runner CLI: boot compose, login, discover/run tests, write JUnit XML, teardown.
ci/runner/junitxml.py Adds minimal JUnit XML writer + helper to wrap steps as testcases.
ci/runner/Dockerfile Defines runner image (docker CLI + Python + lxml + yaml).
ci/runner/compose.py Implements docker compose up/down orchestration and per-run project naming.
ci/runner/channeltests.py Implements channel fixture discovery/deploy/cleanup, and optional test hooks with timeouts.
ci/runner/api.py Implements REST client for login, channel lifecycle, message submission/search, and XML parsing.
ci/README.md Documents the CI integration-test design, fixture format, and runner contract.
ci/configurations/ubuntu-temurin21-postgres.compose.yml Adds Ubuntu+Postgres compose configuration with healthchecks.
ci/configurations/ubuntu-temurin21-derby.compose.yml Adds Ubuntu+Derby compose configuration with healthchecks.
ci/configurations/alpine-temurin21-sqlserver.compose.yml Adds Alpine+SQL Server compose configuration with db-init and healthchecks.
ci/configurations/alpine-temurin21-postgres.compose.yml Adds Alpine+Postgres compose configuration with healthchecks.
ci/configurations/alpine-temurin21-mysql.compose.yml Adds Alpine+MariaDB compose configuration with healthchecks.
ci/configurations/alpine-temurin21-derby.compose.yml Adds Alpine+Derby compose configuration with healthchecks.
ci/.gitignore Ignores runner outputs (test-results/, __pycache__/).
.github/workflows/upload_test_results.yaml Expands test result upload patterns to include docker smoke artifacts.
.github/workflows/build.yaml Reworks CI to build/export via Docker, upload images, and run docker smoke matrix.
.dockerignore Replaces hand-maintained ignore with generated content aligned to .gitignore semantics.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread ci/runner/api.py
Comment thread ci/runner/messagetests.py
Comment thread ci/runner/channeltests.py
Comment thread ci/runtests.ps1
Signed-off-by: Mitch Gaffigan <mitch.gaffigan@comcast.net>
Signed-off-by: Mitch Gaffigan <mitch.gaffigan@comcast.net>
@mgaffigan
mgaffigan marked this pull request as ready for review July 24, 2026 18:03
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