From caebc46d386ae1f9263bad723cd231a00e26743b Mon Sep 17 00:00:00 2001 From: "Michael A. Smith" Date: Sun, 15 Jun 2025 23:42:01 -0400 Subject: [PATCH 1/3] test(compose.yml): disable manual setup for more faithful tests --- docker/openemr/compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/openemr/compose.yml b/docker/openemr/compose.yml index 923b436a..72aba3b7 100644 --- a/docker/openemr/compose.yml +++ b/docker/openemr/compose.yml @@ -29,7 +29,7 @@ services: mysql: condition: service_healthy environment: - MANUAL_SETUP: 'yes' + MANUAL_SETUP: 'no' MYSQL_HOST: mysql MYSQL_PASS: openemr MYSQL_ROOT_PASS: root From a8209c8c83acd9db1f64ba882c2c2730232f0259 Mon Sep 17 00:00:00 2001 From: "Michael A. Smith" Date: Mon, 16 Jun 2025 00:01:12 -0400 Subject: [PATCH 2/3] test(compose.yml): run openemr.sh in -x mode when testing --- docker/openemr/compose.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docker/openemr/compose.yml b/docker/openemr/compose.yml index 72aba3b7..d55d13f8 100644 --- a/docker/openemr/compose.yml +++ b/docker/openemr/compose.yml @@ -28,6 +28,9 @@ services: depends_on: mysql: condition: service_healthy + entrypoint: + - /bin/sh + - -x environment: MANUAL_SETUP: 'no' MYSQL_HOST: mysql From 3e64cf73d8e8162af1a19f86b867267c6b58df9c Mon Sep 17 00:00:00 2001 From: "Michael A. Smith" Date: Sun, 15 Jun 2025 23:48:47 -0400 Subject: [PATCH 3/3] fix(test workflow): test file name --- .github/README.md | 24 ++++++++++++++---------- .github/workflows/test.yml | 4 ++-- 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/.github/README.md b/.github/README.md index 8a318bbb..ab94e567 100644 --- a/.github/README.md +++ b/.github/README.md @@ -1,10 +1,14 @@ # OpenEMR Docker Testing -## Workflow: Production Docker Test (test-prod.yml) +## Unified Docker Test Workflow -The `test-prod.yml` workflow verifies that the production OpenEMR Docker images can be built correctly and function with a database connection. These images have the OpenEMR code embedded within them and are identified by version numbers (e.g., 7.0.4). +The Docker test workflow combines both production and flex image testing into a single workflow file. -The workflow performs the following steps: +### Production Docker Tests + +This part of the workflow verifies that the production OpenEMR Docker images can be built correctly and function with a database connection. These images have the OpenEMR code embedded within them and are identified by version numbers (e.g., 7.0.4). + +The workflow performs the following steps for production images: 1. Builds OpenEMR Docker images defined in docker/openemr for numbered versions (e.g., 6.1.0, 7.0.4) 2. Sets up a test environment using Docker Compose with: @@ -14,17 +18,17 @@ The workflow performs the following steps: 4. Runs the OpenEMR installation process 5. Executes multiple test suites including unit, fixtures, services, validators, and controllers tests -### Triggers for Production Tests +#### Triggers for Production Tests -The workflow runs automatically when: +The production tests run automatically when: - Files in the `docker/openemr/[0-9]*.[0-9]*.[0-9]/**` directory are changed on the main branch - A pull request targeting the main branch changes files in the numbered version directories -## Workflow: Flex Docker Test (test-flex.yml) +### Flex Docker Tests -The `test-flex.yml` workflow tests the development-oriented "flex" Docker images. Unlike production images, flex builds don't embed the OpenEMR code within the image - they're designed for development purposes where the code is mounted separately. +This part of the workflow tests the development-oriented "flex" Docker images. Unlike production images, flex builds don't embed the OpenEMR code within the image - they're designed for development purposes where the code is mounted separately. -The workflow performs the following steps: +The workflow performs the following steps for flex images: 1. Checks out both the openemr-devops repository and the OpenEMR code repository 2. Builds the flex Docker images defined in docker/openemr @@ -33,8 +37,8 @@ The workflow performs the following steps: - OpenEMR container with mounted code 4. Verifies that the web server is responding correctly -### Triggers for Flex Tests +#### Triggers for Flex Tests -The workflow runs automatically when: +The flex tests run automatically when: - Files in the `docker/openemr/**` directory are changed on the main branch - A pull request targeting the main branch changes files in the docker/openemr directory diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 516f91d4..6bd6a9c1 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -5,14 +5,14 @@ on: branches: - master paths: - - '.github/workflows/test-prod.yml' + - '.github/workflows/test.yml' - 'docker/openemr/[0-9]*.[0-9]*.[0-9]/**' - 'docker/openemr/flex-*/**' pull_request: branches: - master paths: - - '.github/workflows/test-prod.yml' + - '.github/workflows/test.yml' - 'docker/openemr/[0-9]*.[0-9]*.[0-9]/**' - 'docker/openemr/flex-*/**'