The Initializer Validator is a standalone fatjar to make dry runs of your OpenMRS configs and to report on any errors. This enables developers and implementers to be warned well ahead of time that a config would fail when loaded on real OpenMRS instances.
The Initializer Validator replays OpenMRS configs in a Spring context-sensitive test environment, very much like any OpenMRS Spring context-sensitive test. This means that the data (or metadata in this case) is loaded in a real database, in fact an instance of MariaDB. This ensures that the dry run occurs in an environment that is very close to the real app runtime setup.
- Build Initializer with the
validator
profile
mvn clean package -P validator
- Locate a config that you want to validate, eg. at /Users/mksd/repos/openmrs-config-acme/configuration.
- Run it (use absolute paths for arguments):
java -jar ./validator/target/initializer-validator-2.2.0.jar \
--config-dir=/Users/mksd/repos/openmrs-config-acme/configuration
- That's it! The dry run will either pass or fail.
In case of failures all the relevant logs can be analysed at ./validator/target/initializer.log.
java -jar ./validator/target/initializer-validator-2.2.0.jar \
--config-dir=/Users/mksd/repos/openmrs-config-acme/configuration \
--ciel-file=/Users/mksd/Downloads/openmrs_concepts_2.2_20200927.sql
java -jar validator/target/initializer-validator-2.2.0.jar \
--config-dir=/Users/mksd/repos/openmrs-config-acme/configuration \
--domains='!metadatasharing,privileges,roles'
java -jar validator/target/initializer-validator-2.2.0.jar \
--config-dir=/Users/mksd/repos/openmrs-config-acme/configuration \
--domains='concepts,locations'
java -jar validator/target/initializer-validator-2.2.0.jar \
--config-dir=/Users/mksd/repos/openmrs-config-acme/configuration \
--exclude.concepts='*diags*,*interventions*'
In the above example all 'concepts' domain files matching the wildcard patterns *diags*
and *interventions*
will be filtered out.
java -jar ./validator/target/initializer-validator-2.2.0.jar \
--config-dir=/Users/mksd/repos/openmrs-config-acme/configuration --unsafe
The unsafe mode will break as soon as the first loading error occurs, triggering the validation to stop short. This mode is particularly suitable for CI processes that just need to fail early.
Just run the fatjar with no arguments (or with the --help
argument) to get a list of all possible options:
java -jar validator/target/initializer-validator-2.2.0.jar
"dyld: Library not loaded: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib"
This will only clearly come out when runnnig the Initializer Validator in --verbose
mode.
Try the following commands (assuming you are using Homebrew):
- Uninstall openssl:
brew uninstall --ignore-dependencies openssl
- Install openssl 1.0.x:
brew tap-new company/team; brew extract --version 1.0.2t openssl company/team; brew install company/team/[email protected]
- Link it to the expected path:
ln -s /usr/local/Cellar/[email protected]/1.0.2t /usr/local/opt/openssl
This replaces the openssl vesion currently installed with version 1.0.2t. To undo this, just upgrade openssl: brew upgrade openssl
.
- 'Mac OS X MariaDB 10.3.13 binaries status unclear - working or not? If NOK, how to fix?'
- Specifically here.
- 'macOS OpenSSL version issue - Homebrew moved it from v1.0 to v1.1 - initial fix'
mysql: /tmp/MariaDB4j/base/bin/mysql:
error while loading shared libraries: libncurses.so.5: cannot open shared object file: No such file or directory
This will only clearly come out when runnnig the Initializer Validator in --verbose
mode.
Try this suggested solution from Stack Overflow: 'error while loading shared libraries: libncurses.so.5:'