Author: matthieu Date: Mon Oct 26 15:16:09 2015 New Revision: 1710624 URL: http://svn.apache.org/viewvc?rev=1710624&view=rev Log: JAMES-1628 Provide a docker entry point playing integration tests on a running James
Contributed by Antoine Duprat and Raphael Ouazana Added: james/project/trunk/dockerfiles/compilation/java-8/integration_tests.sh (with props) Modified: james/project/trunk/README.txt james/project/trunk/dockerfiles/compilation/java-8/Dockerfile Modified: james/project/trunk/README.txt URL: http://svn.apache.org/viewvc/james/project/trunk/README.txt?rev=1710624&r1=1710623&r2=1710624&view=diff ============================================================================== --- james/project/trunk/README.txt (original) +++ james/project/trunk/README.txt Mon Oct 26 15:16:09 2015 @@ -158,3 +158,26 @@ Where : - WORKDIR: is the absolute path to your james-parent workdir. Beware : you will have concurrency issues if multiple containers are running on this single volume. + + +Running deployement Tests +========================= + +We wrote some MPT (James' Mail Protocols Tests subproject) deployement tests to validate a James +deployement. + +It uses the External-James module, that uses environment variables to locate a remote +IMAP server and run integration tests against it. + +For that, the target James Server needs to be configured with a domain domain and a user imapuser +with password password. Read above documentation to see how you can do this. + +You have to run MPT tests inside docker. As you need to use maven, the simplest option is to +use james/parent image, and override the entry point ( as git and maven are already configured +there ) : +$ docker run -t --entrypoint="/root/integration_tests.sh" -v $PWD/.m2:/root/.m2 -v $PWD:/origin james/project JAMES_IP JAMES_PORT SHA1 + +Where : + - JAMES_IP: IP address or DNS entry for your James server + - JAMES_PORT: Port allocated to James' IMAP port (should be 143). + - SHA1(optional): Branch to use in order to build integration tests or trunk Modified: james/project/trunk/dockerfiles/compilation/java-8/Dockerfile URL: http://svn.apache.org/viewvc/james/project/trunk/dockerfiles/compilation/java-8/Dockerfile?rev=1710624&r1=1710623&r2=1710624&view=diff ============================================================================== --- james/project/trunk/dockerfiles/compilation/java-8/Dockerfile (original) +++ james/project/trunk/dockerfiles/compilation/java-8/Dockerfile Mon Oct 26 15:16:09 2015 @@ -18,6 +18,7 @@ RUN apt-get install -y git="$GIT_VERSION # Copy the script COPY compile.sh /root/compile.sh +COPY integration_tests.sh /root/integration_tests.sh # Define the entrypoint WORKDIR /james-project Added: james/project/trunk/dockerfiles/compilation/java-8/integration_tests.sh URL: http://svn.apache.org/viewvc/james/project/trunk/dockerfiles/compilation/java-8/integration_tests.sh?rev=1710624&view=auto ============================================================================== --- james/project/trunk/dockerfiles/compilation/java-8/integration_tests.sh (added) +++ james/project/trunk/dockerfiles/compilation/java-8/integration_tests.sh Mon Oct 26 15:16:09 2015 @@ -0,0 +1,55 @@ +#!/bin/sh -e + +printUsage() { + echo "Usage : " + echo "./integration_tests.sh URL BRANCH JAMES_IP JAMES_IMAP_PORT" + echo " JAMES_IP: IP of the James server to be tests" + echo " JAMES_IMAP_PORT: Exposed IMAP port of this James server" + echo " SHA1(optional): Branch to build or trunk if none" + exit 1 +} + +ORIGIN=/origin + +for arg in "$@" +do + case $arg in + -*) + echo "Invalid option: -$OPTARG" + printUsage + ;; + *) + if ! [ -z "$1" ]; then + JAMES_ADDRESS=$1 + fi + if ! [ -z "$2" ]; then + JAMES_IMAP_PORT=$2 + fi + if ! [ -z "$3" ]; then + SHA1=$3 + fi + ;; + esac +done + +if [ -z "$JAMES_ADDRESS" ]; then + echo "You must provide a JAMES_ADDRESS" + printUsage +fi + +if [ -z "$JAMES_IMAP_PORT" ]; then + echo "You must provide a JAMES_IMAP_PORT" + printUsage +fi + +if [ -z "$SHA1" ]; then + SHA1=trunk +fi + +export JAMES_ADDRESS=$JAMES_ADDRESS +export JAMES_IMAP_PORT=$JAMES_IMAP_PORT + +git clone $ORIGIN/. +git checkout $SHA1 + +mvn -Dtest=ExternalJamesTest -DfailIfNoTests=false -pl org.apache.james:apache-james-mpt-external-james -am test Propchange: james/project/trunk/dockerfiles/compilation/java-8/integration_tests.sh ------------------------------------------------------------------------------ svn:executable = * --------------------------------------------------------------------- To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org