Skip to content

Commit

Permalink
Try dockerizing the Windows tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lazka committed Jun 19, 2017
1 parent 4fcdf9e commit 640e876
Show file tree
Hide file tree
Showing 4 changed files with 84 additions and 4 deletions.
19 changes: 15 additions & 4 deletions .circleci/config.yml
Expand Up @@ -8,6 +8,7 @@ defaults: &defaults
- run: docker run --volume "$(pwd):/home/user/app" --workdir "/home/user/app/quodlibet" --tty --detach myimage bash > container_id
- run: docker exec "$(cat container_id)" $PYTHON $PYARGS ./setup.py test
- run: docker exec "$(cat container_id)" $PYTHON $PYARGS ./setup.py quality
- run: docker stop "$(cat container_id)"

version: 2
jobs:
Expand Down Expand Up @@ -35,12 +36,22 @@ jobs:
- PYTHON: "python3"
- DOCKER_FILE: ".travis/Dockerfile.ubuntu16.04.py3"
<<: *defaults
job.win32.py2:
environment:
- PYARGS: "-R"
- PYTHON: "python2"
- DOCKER_FILE: ".travis/Dockerfile.win32.py2"
<<: *defaults
job.win32.py3:
environment:
- PYARGS: "-R"
- PYTHON: "python3"
- DOCKER_FILE: ".travis/Dockerfile.win32.py3"
<<: *defaults

workflows:
version: 2
build_and_test:
jobs:
- job.debian8.py2
- job.debian8.py3
- job.ubuntu16.04.py2
- job.ubuntu16.04.py3
- job.win32.py2
- job.win32.py3
33 changes: 33 additions & 0 deletions .travis/Dockerfile.win32.py2
@@ -0,0 +1,33 @@
FROM debian:stretch

ENV LANG C.UTF-8
ENV PYTHONDONTWRITEBYTECODE 1
ENV CI true

RUN useradd -ms /bin/bash user

WORKDIR /home/user

RUN dpkg --add-architecture i386

RUN apt-get update

RUN apt-get install --no-install-recommends -y \
wine wine32 xvfb xauth \
wget ca-certificates \
p7zip-full

USER user

RUN wget https://bitbucket.org/lazka/quodlibet/downloads/quodlibet-latest-installer.exe -O win-inst.exe

RUN 7z x -o_win_inst win-inst.exe

ENV WINEPREFIX /home/user/_wineprefix
ENV WINEDEBUG -all

RUN echo '#!/bin/bash\n(rm -Rf "$WINEPREFIX" && xvfb-run -a wine /home/user/_win_inst/bin/python.exe "$@")' > python2

RUN chmod a+x python2

ENV PATH /home/user:$PATH
33 changes: 33 additions & 0 deletions .travis/Dockerfile.win32.py3
@@ -0,0 +1,33 @@
FROM debian:stretch

ENV LANG C.UTF-8
ENV PYTHONDONTWRITEBYTECODE 1
ENV CI true

RUN useradd -ms /bin/bash user

WORKDIR /home/user

RUN dpkg --add-architecture i386

RUN apt-get update

RUN apt-get install --no-install-recommends -y \
wine wine32 xvfb xauth \
wget ca-certificates \
p7zip-full

USER user

RUN wget https://bitbucket.org/lazka/quodlibet/downloads/quodlibet-latest-installer-py3.exe -O win-inst.exe

RUN 7z x -o_win_inst win-inst.exe

ENV WINEPREFIX /home/user/_wineprefix
ENV WINEDEBUG -all

RUN echo '#!/bin/bash\n(rm -Rf "$WINEPREFIX" && xvfb-run -a wine /home/user/_win_inst/bin/python3.exe "$@")' > python3

RUN chmod a+x python3

ENV PATH /home/user:$PATH
3 changes: 3 additions & 0 deletions quodlibet/tests/__init__.py
Expand Up @@ -256,6 +256,9 @@ def unit(run=[], suite=None, strict=False, exitfirst=False, network=True,

args = []

if is_ci():
args.extend(["-p", "no:cacheprovider"])

if run:
args.append("-k")
args.append(" or ".join(run))
Expand Down

0 comments on commit 640e876

Please sign in to comment.