diff --git a/.travis.yml b/.travis.yml index de930d6..4cc34ba 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,8 +8,12 @@ services: python: - "2.7" install: - - docker build -f tests/docker/Dockerfile -t txgio/anki-connect . + - docker build -f tests/docker/$ANKI_VERSION/Dockerfile -t txgio/anki-connect:$ANKI_VERSION . script: - - docker run -ti -d --rm -p 8888:8765 -e ANKICONNECT_BIND_ADDRESS=0.0.0.0 txgio/anki-connect + - docker run -ti -d --rm -p 8888:8765 -e ANKICONNECT_BIND_ADDRESS=0.0.0.0 txgio/anki-connect:$ANKI_VERSION - ./tests/scripts/wait-up.sh http://docker:8888 - - python -m unittest discover -s tests -v \ No newline at end of file + - python -m unittest discover -s tests -v + +env: + - ANKI_VERSION=2.0.x + - ANKI_VERSION=2.1.x \ No newline at end of file diff --git a/tests/docker/Dockerfile b/tests/docker/2.0.x/Dockerfile similarity index 100% rename from tests/docker/Dockerfile rename to tests/docker/2.0.x/Dockerfile diff --git a/tests/docker/entrypoint.sh b/tests/docker/2.0.x/entrypoint.sh similarity index 100% rename from tests/docker/entrypoint.sh rename to tests/docker/2.0.x/entrypoint.sh diff --git a/tests/docker/prefs.db b/tests/docker/2.0.x/prefs.db similarity index 100% rename from tests/docker/prefs.db rename to tests/docker/2.0.x/prefs.db diff --git a/tests/docker/2.1.x/Dockerfile b/tests/docker/2.1.x/Dockerfile new file mode 100644 index 0000000..58e9572 --- /dev/null +++ b/tests/docker/2.1.x/Dockerfile @@ -0,0 +1,14 @@ +FROM txgio/anki:2.1.0beta14 + +RUN apt-get update && \ + apt-get install -y xvfb + +COPY AnkiConnect.py /data/addons21/AnkiConnect.py + +COPY tests/docker/prefs21.db /data/prefs21.db + +ADD tests/docker/entrypoint.sh /entrypoint.sh + +ENTRYPOINT ["/entrypoint.sh"] + +CMD ["anki", "-b", "/data"] \ No newline at end of file diff --git a/tests/docker/2.1.x/entrypoint.sh b/tests/docker/2.1.x/entrypoint.sh new file mode 100755 index 0000000..8285fb9 --- /dev/null +++ b/tests/docker/2.1.x/entrypoint.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash +set -e + +# Start Xvfb +Xvfb -ac -screen scrn 1280x2000x24 :99.0 & +export DISPLAY=:99.0 + +exec "$@" \ No newline at end of file diff --git a/tests/docker/2.1.x/prefs21.db b/tests/docker/2.1.x/prefs21.db new file mode 100644 index 0000000..dc4d505 Binary files /dev/null and b/tests/docker/2.1.x/prefs21.db differ