Skip to content

Latest commit

 

History

History
43 lines (31 loc) · 2.13 KB

File metadata and controls

43 lines (31 loc) · 2.13 KB

Kcov Coverage for OpenEMR Entrypoint Scripts

This directory contains code coverage reports generated by kcov for the OpenEMR entrypoint scripts.

How it works

  1. It can be configured to work with any flex or production docker.
  2. Currently configured to work with the flex-edge php 8.4 images (both development (ie. dev) mode (codebase via shared volume) and production (ie. prod) mode (codebase via git clone)) and the future production 7.0.4 image. See .github/workflows/test-flex-edge.yml and .github/workflows/test-production.yml for details respectively.
  3. The GitHub Actions workflow builds the pertinent Docker image with the kcov target, which includes the Kcov code coverage tool.
  4. The container runs with a wrapper script that executes the original openemr.sh entrypoint script under kcov monitoring.
  5. Kcov collects coverage data on which lines of code were executed in the entrypoint script.
  6. After tests complete, the coverage reports are uploaded as artifacts in the GitHub Actions workflow.

Accessing the coverage reports

  1. Go to the GitHub Actions run for your build.
  2. Click on the "Artifacts" section.
  3. Download the kcov-coverage-reports-production or kcov-coverage-reports-flex-dev or kcov-coverage-reports-flex-prod artifact(s).
  4. kcov-coverage-reports-production is currently produced by future production docker 7.0.4.
  5. kcov-coverage-reports-flex-dev is currently produced by flex-edge PHP 8.4 docker in dev mode.
  6. kcov-coverage-reports-flex-prod is currently produced by flex-edge PHP 8.4 docker in prod mode.
  7. Extract the archive and open index.html in your web browser.

Coverage report structure

The coverage reports include:

  • Line-by-line coverage information for the entrypoint scripts
  • Summary statistics showing coverage percentages
  • Visual indicators showing which code paths were executed

Local testing with coverage

To run the container locally with coverage enabled, use run-with-coverage.sh script.

cd docker/openemr
. run-with-coverage.sh

After running, you can view the coverage reports in docker/openemr/coverage-reports/.