diff --git a/dev/containers/fedora-pip-py3 b/dev/containers/fedora-pip-py3 new file mode 100644 index 0000000..7d7b31a --- /dev/null +++ b/dev/containers/fedora-pip-py3 @@ -0,0 +1,27 @@ +FROM fedora:latest + +RUN dnf -y install \ + python3-setuptools \ + redhat-rpm-config \ + python3-devel \ + libgit2-devel \ + python3-tox + libffi-devel \ + m2crypto \ + zeromq-devel \ + gcc \ + redis \ + which \ + git + +RUN cd / \ + && git clone https://pagure.io/pagure.git + +# Install pygit2 manually, outside of the virtualenv since it is tightly coupled +# which the version of libgit2 installed on the system. +RUN pip3 install "pygit2 <= `rpm -q libgit2 --queryformat='%{version}'`" && \ + cd /pagure + +WORKDIR /pagure +ENTRYPOINT ["/pagure/dev/containers/tox_py3.sh"] +CMD [] diff --git a/dev/containers/tox_py3.sh b/dev/containers/tox_py3.sh new file mode 100644 index 0000000..d9c806d --- /dev/null +++ b/dev/containers/tox_py3.sh @@ -0,0 +1,25 @@ +#!/bin/bash + + +ls -l / + +echo "============== ENVIRONMENT =============" +/usr/bin/env +echo "============== END ENVIRONMENT =============" + +if [ -n "$REPO" -a -n "$BRANCH" ]; then +git remote rm proposed || true +git gc --auto +git remote add proposed "$REPO" +git fetch proposed +git checkout origin/master +git config --global user.email "you@example.com" +git config --global user.name "Your Name" +git merge --no-ff "proposed/$BRANCH" -m "Merge PR" + +echo "Running tests for branch $BRANCH of repo $REPO" +echo "Last commits:" +git log -2 +fi + +tox -v --sitepackages -e 'py34-flask100-ci' -- --results=results diff --git a/dev/run-tests-container.py b/dev/run-tests-container.py index 14dd8b3..b9bd36e 100644 --- a/dev/run-tests-container.py +++ b/dev/run-tests-container.py @@ -22,6 +22,11 @@ def setup_parser(): help="Run the tests in centos environment", ) parser.add_argument( + "--pip", + action="store_true", + help="Run the tests in a venv on a Fedora host", + ) + parser.add_argument( "--skip-build", dest="skip_build", action="store_false", @@ -48,9 +53,18 @@ if __name__ == "__main__": elif args.fedora is True: container_names = ["pagure-f29-rpms-py3"] container_files = ["f29-rpms-py3"] + elif args.pip is True: + container_names = ["pagure-fedora-pip-py3"] + container_files = ["fedora-pip-py3"] else: - container_names = ["pagure-f29-rpms-py3", "pagure-c7-rpms-py2"] - container_files = ["f29-rpms-py3", "centos7-rpms-py2"] + container_names = [ + "pagure-f29-rpms-py3", "pagure-c7-rpms-py2", + "pagure-fedora-pip-py3" + ] + container_files = [ + "f29-rpms-py3", "centos7-rpms-py2", + "fedora-pip-py3" + ] for idx, container_name in enumerate(container_names): if args.skip_build is not False: