OpenMRS SDK tests in CI

At present, the OpenMRS SDK tests can’t pass in CI. I think that this is because the SDK “Integration Tests” run against the latest mvn installed version of the package. Until the mvn clean install runs successfully, this is the version corresponding to the last successful run. So it’s trying to run the latest-master tests against an old version.

I might be wrong, but that’s my best guess at the moment. It would seem surprising that this hasn’t been an issue (or hasn’t been noticed) before.

I don’t know what the best way to fix this is.

@ibacher @dkayiwa @mseaton @mogoodrich

There’s definitely something weird going on, since the same test works on GitHub Actions, but not Bamboo.

Unfortunately, I don’t think that’s it’s because mvn install isn’t installing the version, because the SDK Maven Plugin does get built and installed before the integration tests run. Since the log of one of the failed builds show the jar being installed as expected:

build	13-Jul-2021 11:28:49	[INFO] Installing /home/bamboo-agent/bamboo-agent/xml-data/build-dir/SDK-SDK-JOB1/maven-plugin/target/openmrs-sdk-maven-plugin-4.0.2-SNAPSHOT.jar to /home/bamboo-agent/.m2/repository/org/openmrs/maven/plugins/openmrs-sdk-maven-plugin/4.0.2-SNAPSHOT/openmrs-sdk-maven-plugin-4.0.2-SNAPSHOT.jar
build	13-Jul-2021 11:28:49	[INFO] Installing /home/bamboo-agent/bamboo-agent/xml-data/build-dir/SDK-SDK-JOB1/maven-plugin/pom.xml to /home/bamboo-agent/.m2/repository/org/openmrs/maven/plugins/openmrs-sdk-maven-plugin/4.0.2-SNAPSHOT/openmrs-sdk-maven-plugin-4.0.2-SNAPSHOT.pom

In any case, since I can’t reproduce the failure locally or on GitHub Actions, I’ve just rebuilt it without running the tests and will release that (as 4.1.0).

We’ve run into the same funky intermittent issues as this with our packager-maven-plugin, which also uses the maven-verifier project to test executing the maven goals. We ended up doing something similar to what @ibacher just did by temporarily disabling tests in CI in order to release it, and then ticketing the issue, but we have yet to get to the bottom of it. @mogoodrich FYI.

FWIW, the only tests failing on bamboo are the ones that expect files ending with /frontend/index.html

It is possible that (somehow) the integration tests are loading the 4.0.0 SDK plugin instead of the 4.0.2-SNAPSHOT version. I thought this was something I had seen before, but if it is, I can’t figure out what I did to resolve it.

Creating /frontend/index.html (and a few other files) in the primary change in the new version of the SDK…

Just to add more troubleshooting information, when i locally change this openmrs-sdk/pom.xml at master · openmrs/openmrs-sdk · GitHub to version 4.0.0, i end up with the exact three test failures as on bamboo.

1 Like

I confirmed that the integration tests load the correct sdk plugin on bamboo, and correctly create the frontend folder having all the expected files apart from index.html.

In other words, these assertions pass: openmrs-sdk/SetupIntegrationTest.java at openmrs-sdk-4.1.0 · openmrs/openmrs-sdk · GitHub

It is only this one with index.html that fails: openmrs-sdk/SetupIntegrationTest.java at openmrs-sdk-4.1.0 · openmrs/openmrs-sdk · GitHub

So, what is special about generating the index.html file on bamboo, that is different from all the other files?

2 Likes

And now that I’ve made another commit to the repo, the problem has resolved itself:

https://ci.openmrs.org/browse/SDK-SDK-JOB1-394/log

@dkayiwa , the frontend folder was full of files? Like directories for microfrontends, and a bunch of JS files? But no index.html? That seems extremely weird. I suppose it would happen if openmrs assemble was being run but not openmrs build (see the code). But I would have expected that if openmrs build failed, it would stop the execution. Very strange.