Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker image for running tests via CLI #197

Open
jnystad opened this issue Sep 1, 2022 · 1 comment
Open

Docker image for running tests via CLI #197

jnystad opened this issue Sep 1, 2022 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@jnystad
Copy link

jnystad commented Sep 1, 2022

Is your feature request related to a problem? Please describe.
The docker image provided is built to run the full TEAM Engine server, but this is not necessarily the easiest way for non-java developers to get access to this test suite.

Describe the solution you'd like
It would be great if you provided a docker image that was rigged for the CLI invocation only.

Additional context

A Dockerfile I created to make this image myself that tries to do some build phases for quicker development iteration:

FROM maven:3.8-openjdk-18

WORKDIR /build/

COPY pom.xml .

RUN mvn --version

# Pre-download all dependencies to increase caching in docker builds
RUN mvn dependency:resolve dependency:resolve-plugins dependency:copy-dependencies dependency:go-offline -Pdocker

# Copy actual source files
COPY ./src ./src

# Install offline to avoid triggering new dependency update
RUN mvn install -DskipTests -Dmaven.javadoc.skip

# TODO: Should get the version from build context
ARG VERSION=1.5-SNAPSHOT
ARG OUTPUT_DIR=/build/run/output
ARG TEST_RUN_PROPS=/build/run/test-run-props.xml

ENV VERSION=${VERSION}
ENV OUTPUT_DIR=${OUTPUT_DIR}
ENV TEST_RUN_PROPS=${TEST_RUN_PROPS}

CMD ["sh", "-c", "java -jar /build/target/ets-ogcapi-features10-${VERSION}-aio.jar -o ${OUTPUT_DIR} -h true ${TEST_RUN_PROPS}"]

I'm not a Java developer, so this may or may not be a good approach, but it works OK for me.

Invocation example:

docker container run --mount type=bind,source=/path/to/run,target=/build/run image-name

Note the required bound mount to pass test-run-props.xml in, and get the resulting output written to local directory.

It should probably be optimized to copy the built artifacts to a new runtime image to reduce the size of the produced image.

@dstenger dstenger added the enhancement New feature or request label Sep 1, 2022
@dstenger
Copy link
Contributor

dstenger commented Sep 1, 2022

Thank you for providing this feature request.

A similar idea was already documented here: opengeospatial/teamengine-docker#39

We will discuss this in the CITE team.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Needs discussion
Development

No branches or pull requests

4 participants