#1378 Allow to run tests in containers in parallel
Merged 4 years ago by mprahl. Opened 4 years ago by cqi.
cqi/fm-orchestrator run-tests-in-parallel  into  master

file modified
+1
@@ -11,6 +11,7 @@ 

      --setopt=tsflags=nodocs \

      bash \

      createrepo_c \

+     rsync \

      fedmsg \

      fedmsg-hub \

      gcc \

@@ -8,6 +8,7 @@ 

      --setopt=tsflags=nodocs \

      git-core \

      createrepo_c \

+     rsync \

      python3-fedmsg \

      python3-kobo-rpmlib \

      python3-rpm \

file modified
+6 -15
@@ -1,8 +1,12 @@ 

- #!/bin/bash

+ #!/bin/bash -ex

+ 

+ mkdir -p ~/mbs

+ rsync -a --exclude '.*' --exclude '*.pyc' $PWD ~/mbs

+ 

+ cd ~/mbs/src

  

  # Remove requirements not necessary for Python 3.7.

  # Also, prevent koji from being re-installed from PyPi.

- cp requirements.txt requirements.txt.orig.py3

  sed -i \

      -e '/enum34/d' \

      -e '/funcsigs/d' \
@@ -11,24 +15,11 @@ 

      requirements.txt

  

  # Run everything with Python 3

- cp tox.ini tox.ini.orig.py3

  sed -i \

      -e 's/py.test/py.test-3/g' \

      -e '/basepython/d' \

      tox.ini

  

- # Delete any leftover compiled Python files

- for dir in module_build_service tests; do

-     find ${dir} -type f \( -name '*.pyc' -or -name '*.pyc' \) -exec rm -f {} \;

- done

- 

  # Since tox seems to ignore `usedevelop` when we have `sitepackages` on, we have to run it manually

  python3 setup.py develop --no-deps

  /usr/bin/tox -e flake8,py3 "$@"

- rv=$?

- 

- # After running tox, we can revert back to the original files

- rm -f requirements.txt tox.ini

- mv requirements.txt.orig.py3 requirements.txt

- mv tox.ini.orig.py3 tox.ini

- exit $rv

file modified
+8 -11
@@ -1,21 +1,18 @@ 

- #!/bin/bash

+ #!/bin/bash -ex

+ 

+ mkdir -p ~/mbs

+ rsync -a --exclude '.*' --exclude '*.pyc' $PWD ~/mbs

+ 

+ cd ~/mbs/src

  

  # We install the python-koji RPM but it doesn't register as installed through pip.

  # This hacks keeps tox from install koji from PyPi.

- cp requirements.txt requirements.txt.orig

  sed -i '/koji/d' requirements.txt

- # Delete any leftover compiled Python files

- for dir in module_build_service tests; do

-     find ${dir} -type f \( -name '*.pyc' -or -name '*.pyc' \) -exec rm -f {} \;

- done

+ 

  # The python-virtualenv package bundles a very old version of pip,

  # which is incompatible with modern virtualenv.

  rm -f /usr/lib/python2.7/site-packages/virtualenv_support/pip-9*

+ 

  # Since tox seems to ignore `usedevelop` when we have `sitepackages` on, we have to run it manually

  python setup.py develop --no-deps

  /usr/bin/tox -e flake8,py27 "$@"

- rv=$?

- # After running tox, we can revert back to the original requirements.txt file

- rm -f requirements.txt

- mv requirements.txt.orig requirements.txt

- exit $rv