hapifhir / hapi-fhir

🔥 HAPI FHIR - Java API for HL7 FHIR Clients and Servers
http://hapifhir.io
Apache License 2.0
2.04k stars 1.33k forks source link

Problem running all the tests for DSTU3 in a docker container #1762

Closed caetanopaulo closed 4 years ago

caetanopaulo commented 4 years ago

Issue We are trying to run the unit tests just for DSTU3 in a docker container (using builtKit for .M2 caching purposes). But we keep seeing 4 tests failing:

- FhirResourceDaoR4SearchWithElasticSearchTest.testExpandVsWithMultiInclude_All ? IllegalState
- FhirResourceDaoR4SearchWithElasticSearchTest.testExpandVsWithMultiInclude_Some ? IllegalState
- FhirResourceDaoR4SearchWithElasticSearchTest.testExpandWithIsAInExternalValueSet ? IllegalState
- FhirResourceDaoR4SearchWithElasticSearchTest.testResourceTextSearch ? IllegalState

Environment:

Additional context

We are building the build image with this command from TFS (our CI server): docker build --tag ph3-dev/hapi-fhir-build:4.3.0-238348-Quick-HAPI-Build.1 --target build-hapi -m 4g .

Here's the docker file:

FROM hapiproject/hapi:base as build-hapi
ENV MAVEN_OPTS="-Xmx2048M -Xss128M -XX:MetaspaceSize=512M -XX:MaxMetaspaceSize=1024M -XX:+CMSClassUnloadingEnabled -XX:+UseConcMarkSweepGC"

RUN mkdir -p /tmp/hapi-fhir/
COPY ./hapi-fhir /tmp/hapi-fhir
WORKDIR /tmp/hapi-fhir/
RUN --mount=type=cache,target=/root/.m2 /tmp/apache-maven-3.6.2/bin/mvn clean
RUN --mount=type=cache,target=/root/.m2 /tmp/apache-maven-3.6.2/bin/mvn dependency:resolve
RUN --mount=type=cache,target=/root/.m2 /tmp/apache-maven-3.6.2/bin/mvn -P STU3SERVER,NOPARALLEL,NOUNITTESTS install

WORKDIR /tmp
RUN mkdir -p /tmp/hapi-fhir-jpaserver-starter
COPY ./pom.xml /tmp/hapi-fhir-jpaserver-starter
COPY ./src /tmp/hapi-fhir-jpaserver-starter/src

WORKDIR /tmp/hapi-fhir-jpaserver-starter
RUN --mount=type=cache,target=/root/.m2 /tmp/apache-maven-3.6.2/bin/mvn install -DskipTests

FROM tomcat:9-jre11

RUN mkdir -p /data/hapi/lucenefiles && chmod 775 /data/hapi/lucenefiles
COPY --from=build-hapi /tmp/hapi-fhir-jpaserver-starter/target/*.war /usr/local/tomcat/webapps/

EXPOSE 8080

CMD ["catalina.sh", "run"]

Here's how the configure the STU3SERVER profile:

<profile>
    <id>STU3SERVER</id>
    <modules>
            <module>hapi-fhir-bom</module>
        <module>hapi-deployable-pom</module>
        <module>hapi-fhir-base</module>
        <module>hapi-fhir-docs</module>
        <module>hapi-fhir-test-utilities</module>
        <module>hapi-fhir-server</module>
        <module>hapi-fhir-converter</module>
        <module>hapi-fhir-validation</module>
        <module>hapi-fhir-structures-dstu3</module>
             <module>hapi-fhir-validation-resources-dstu3</module>
        <module>hapi-fhir-jpaserver-model</module>
        <module>hapi-fhir-jpaserver-searchparam</module>
        <module>hapi-fhir-jpaserver-subscription</module>
        <module>hapi-fhir-jpaserver-base</module>
        <module>hapi-fhir-jpaserver-migrate</module>
        <module>hapi-fhir-dist</module>
        <module>tests/hapi-fhir-base-test-mindeps-server</module>
        <module>hapi-fhir-spring-boot</module>
    </modules>
</profile>

We are running the tests with this command:

run --rm -v "$PWD"/target:/usr/src/app/target -w /tmp/hapi-fhir/ ph3-dev/hapi-fhir-build:4.3.0-238348-Quick-HAPI-Build.1 /tmp/apache-maven-3.6.2/bin/mvn -P STU3SERVER test

What are we missing?

Thanks in advance.

jamesagnew commented 4 years ago

The tests are passing in CI, so I'm not really clear what we could do about this issue? It seems liek it's probably specific to your environment..

caetanopaulo commented 4 years ago

Thanks for the feedback @jamesagnew Keep up the good work.