Files
fm-orchestrator/Dockerfile-tests

54 lines
1.8 KiB
Plaintext

FROM centos:7
WORKDIR /build
RUN yum -y update
RUN yum -y install epel-release
RUN yum -y install \
--setopt=deltarpm=0 \
--setopt=install_weak_deps=false \
--setopt=tsflags=nodocs \
createrepo_c \
fedmsg \
fedmsg-hub \
git \
kobo \
kobo-rpmlib \
https://kojipkgs.fedoraproject.org//packages/libmodulemd/1.1.3/1.fc27/x86_64/libmodulemd-1.1.3-1.fc27.x86_64.rpm \
pdc-client \
https://kojipkgs.fedoraproject.org/repos-dist/epel7Server-infra-stg/latest/x86_64/l/libsolv-0.6.33-1.el7.x86_64.rpm \
python-backports-ssl_match_hostname \
python-dogpile-cache \
python-enum34 \
python-fedora \
python-flask \
python-flask-migrate \
python-flask-sqlalchemy \
python-funcsigs \
python-futures \
python-koji \
python-ldap3 \
python-mock \
python-pip \
python-six \
https://kojipkgs.fedoraproject.org/repos-dist/epel7Server-infra-stg/latest/x86_64/p/python2-solv-0.6.33-1.el7.x86_64.rpm \
python-sqlalchemy \
python-tabulate \
# Test-only dependencies
python-flake8 \
python-mock \
python-tox \
rpm-build \
&& yum clean all
# We currently require a newer versions of these Python packages for the tests
RUN pip install --upgrade flask-sqlalchemy pytest flake8
# TODO: Consider making this a volume instead
COPY . .
# We install the python-koji RPM but it doesn't register as installed through pip.
# This hacks keeps tox from install koji from PyPi.
RUN sed -i '/koji/d' requirements.txt
# Delete any leftover compiled Python files
RUN find . -type f \( -name '*.pyc' -or -name '*.pyc' -or -name '__pycache__' \) -exec rm -rf {} \;
# Since tox seems to ignore `usedevelop` when we have `sitepackages` on, we have to run it manually
RUN python setup.py develop
CMD ["/usr/bin/tox", "-e", "flake8,py27"]