Skip to content

Load-test new OCL exports on a real OpenMRS database - #783

Merged
mogoodrich merged 1 commit into
masterfrom
ocl-load-test
Nov 13, 2026
Merged

mogoodrich merged 1 commit into
masterfrom
ocl-load-test

Conversation

@mogoodrich

Copy link
Copy Markdown
Member

The "Update OCL export" Action now load-tests the new export on a real OpenMRS database before opening its PR. The release check only catches problems we already know about (like the 1.8.47–1.8.50 name UUID clash, UHM-9656). This runs the actual import.

What it does

New scripts/ocl-load-test.sh:

  1. Builds pihemr with the export in content/configuration/backend_configuration/ocl/ (mvn install).
  2. Clones zl-emr and openmrs-contrib-distro-tools, then creates a throwaway openmrs-docker instance, restores the nightly ZL seed image (partnersinhealth/zl-emr-seed-haiti, which already has master's export loaded), and runs start --build. So it's the same upgrade production servers go through.
  3. Checks that:
    • an OCL import ran in this instance (not just in the seed),
    • it finished with no openconceptlab_item errors. If there are any, it lists them with the database error,
    • Initializer recorded the new zip as loaded, and OpenMRS started.
  4. Exit 0 pass, 1 the export didn't load, 2 the test couldn't run. It also checks the built distribution really contains the new zip, since the build's mvn -U could otherwise use the published pihemr snapshot.

Action changes (update-ocl-export.yml):

  • New checkbox: Skip testing against a real OpenMRS database (takes about 15-30 minutes), separate from Skip the release check.
  • Runs the script after the release check, before the PR. The result goes into the PR description, and the OpenMRS log is uploaded as the ocl-load-test-openmrs-log artifact.
  • Logs in to Docker Hub as pihci (DOCKERHUB_PASSWORD, which this repo already gets: its jfrog build pushes with it) to avoid pull limits.
  • Job timeout 120 minutes (up to 20 of them waiting for OCL to build the export).

The PIH "ocl" Claude skill runs the same script before putting an export into the distro (PIH/claude-plugins PR to follow).

Tested locally

  • 1.8.56 (the seed already has 1.8.57, the latest release) → passed in about 10 minutes, import about 70 seconds: 9 added, 13842 updated, 3 retired, 41943 up to date.

  • 1.8.57 with a deliberately reused name UUID on concept 7228 → failed, exit 1:

    • CONCEPT /orgs/PIH/sources/PIH/concepts/7228/: Duplicate entry 'de3c24e7-fd2a-466f-bb05-f3729c63e12c' for key 'uuid'

    The broken concept needs a new version_url: the importer skips concepts whose version it has already imported, which is also why the test exercises exactly what a real upgrade would.

Not yet run on GitHub; the first real run of the Action will tell us the actual time on a runner.

🤖 Generated with Claude Code

Adds scripts/ocl-load-test.sh, which builds pihemr and the ZL EMR distribution
with the export in content/configuration/backend_configuration/ocl/, starts it
in a throwaway openmrs-docker instance restored from the nightly ZL seed image
(partnersinhealth/zl-emr-seed-haiti), and checks that the OCL import finished
with no item errors. Exit 0 pass, 1 import failed (lists the failing items),
2 couldn't run.

The "Update OCL export" Action runs it before opening the PR, with a new
"Skip testing against a real OpenMRS database" checkbox, uploads the OpenMRS
log as an artifact, and puts the result in the PR description. The PIH "ocl"
Claude skill runs the same script.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mogoodrich
mogoodrich merged commit 2ed2885 into master Nov 13, 2026
1 check passed
@mogoodrich
mogoodrich deleted the ocl-load-test branch November 13, 2026 15:20
@mogoodrich

Copy link
Copy Markdown
Member Author

Pushed a fix: the test build was tagged partnersinhealth/zl-emr:latest, so running it on a developer machine replaced their local copy of the published image. It now builds as ocl-load-test/zl-emr:<instance> and removes that image at the end. Retested locally with 1.8.56: passed, and partnersinhealth/zl-emr:latest was unchanged.

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.

1 participant