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 XSpec CI tests #643

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

tgraham-antenna
Copy link
Member

This adds a test/docker directory with the files for creating a Docker image that contains all of the files needed to test an XSpec distribution. The Docker image currently does not contain the XSpec code. The XSpec distribution has to be mounted on the Docker container when the image is run:

docker run --rm -v /usr/local/src/xspec-9998:/xspec xspec/xspec-test:latest

Since Docker has to be run as 'root' (even though running ordinary things as 'root' is generally a bad idea), the Docker container is set to run its program as a user with a UID and GID of '9998'. This doesn't make any difference on Windows, but when run on Linux, it's simplest if the entire XSpec distribution is owned by the '9998' UID:

chown -R 9998:9998 xspec-9998

(What XSpec really needs is a command-line parameter for generating files in a location other than under the directory that contains the XSpec file.)

I added test/run-all-tests.sh because a Docker image is supposed to run a single command.

This is a work in progress. I'm still not sure whether or not it is a good idea, but I have multiple machines where I don't ordinarily have just the right versions of Saxon, etc., nor have a SAXON_JAR environment variable, so this is an attempt to have a set-up that will 'just work'. Prior to this, I couldn't get run-bats.sh to work properly under either Cygwin's bash or Git for Windows' bash.

@AirQuick
Copy link
Member

I remember @cirulls once worked on Docker in #126, though it doesn't seem to be for CI tests.

@AirQuick AirQuick added the test label Sep 23, 2019
@tgraham-antenna
Copy link
Member Author

Yes, I just found that on GitHub, after not finding any XSpec images on Docker Hub a few days ago. This complements that.

If you were desperate to prove that Docker is useful, I suppose that you could mount the files from the XSpec image on this image and run the tests, but that wasn't my aim. I just want to run the tests locally after I've made a change without having to worry about the test set-up.


Separately, it's possible to mount a Saxon-PE or Saxon-EE distribution (if you have them) onto /saxon in the container to run the tests that require those versions.


I haven't got as far as adding Jing to the image, since my first concern was running bats for testing #631.

@AirQuick
Copy link
Member

AirQuick commented Sep 25, 2019

I have multiple machines where I don't ordinarily have just the right versions of Saxon, etc., nor have a SAXON_JAR environment variable

#648 and some other changes have moved the setup commands from .travis.yml to external shell scripts. So now it's a little bit easier to set up the local testing environment. See Wiki.

I couldn't get run-bats.sh to work properly under either Cygwin's bash or Git for Windows' bash.

That scenario has never been tested.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants