diff options
author | Tom Rini <trini@konsulko.com> | 2019-10-24 11:59:27 -0400 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2019-10-30 17:48:47 -0400 |
commit | 085b8978b997a1a901a98926ddbe16459aa6a746 (patch) | |
tree | 68a0cc1b668652e6fbf2c603301e475205165ef0 /.travis.yml | |
parent | ddaa8bed3dea59201392e9f516a9f2dbb12654d9 (diff) |
gitlab/travis: Rework how and when we use virtualenv in order to use python3
As things stand today, we have tools that CI requires where "python"
must be "python2". We need to use a virtualenv and pip in order to
ensure that our pytest tests can be run. Rework things slightly so
that:
- On Travis-CI, we install python-pyelftools for the platforms that
require pyelftools to be installed.
- On GitLab-CI, we move to a newer base image that includes python3-pip
and continue to use a virtualenv per job that needs it, for the
correct set of packages.
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Stephen Warren <swarren@nvidia.com>
Tested-by: Simon Glass <sjg@chromium.org> [on sandbox]
Signed-off-by: Tom Rini <trini@konsulko.com>
Diffstat (limited to '.travis.yml')
-rw-r--r-- | .travis.yml | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/.travis.yml b/.travis.yml index c50270de5f..2369da97f9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,7 +21,9 @@ addons: - build-essential - libsdl1.2-dev - python - - python-virtualenv + - python-pyelftools + - python3-virtualenv + - python3-pip - swig - libpython-dev - iasl @@ -47,11 +49,6 @@ install: - echo -e "arc = /tmp/arc_gnu_2018.09_prebuilt_uclibc_le_archs_linux_install" >> ~/.buildman - echo -e "\n[toolchain-alias]\nsh = sh2\n" >> ~/.buildman - cat ~/.buildman - - virtualenv /tmp/venv - - . /tmp/venv/bin/activate - - pip install pytest - - pip install python-subunit - - pip install pyelftools - grub-mkimage --prefix="" -o ~/grub_x86.efi -O i386-efi normal echo lsefimmap lsefi lsefisystab efinet tftp minicmd - grub-mkimage --prefix="" -o ~/grub_x64.efi -O x86_64-efi normal echo lsefimmap lsefi lsefisystab efinet tftp minicmd - mkdir ~/grub2-arm @@ -136,15 +133,6 @@ script: cp ~/grub_x64.efi $UBOOT_TRAVIS_BUILD_DIR/; cp ~/grub2-arm/usr/lib/grub2/arm-efi/grub.efi $UBOOT_TRAVIS_BUILD_DIR/grub_arm.efi; cp ~/grub2-arm64/usr/lib/grub2/arm64-efi/grub.efi $UBOOT_TRAVIS_BUILD_DIR/grub_arm64.efi; - if [[ "${TEST_PY_BD}" != "" ]]; then - ./test/py/test.py --bd ${TEST_PY_BD} ${TEST_PY_ID} - -k "${TEST_PY_TEST_SPEC:-not a_test_which_does_not_exist}" - --build-dir "$UBOOT_TRAVIS_BUILD_DIR"; - ret=$?; - if [[ $ret -ne 0 ]]; then - exit $ret; - fi; - fi; if [[ -n "${TEST_PY_TOOLS}" ]]; then PYTHONPATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc/pylibfdt" PATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc:${PATH}" @@ -154,6 +142,18 @@ script: PYTHONPATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc/pylibfdt" PATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc:${PATH}" ./tools/dtoc/dtoc -t; + fi; + if [[ "${TEST_PY_BD}" != "" ]]; then + virtualenv -p /usr/bin/python3 /tmp/venv; + . /tmp/venv/bin/activate; + pip install -r test/py/requirements.txt; + ./test/py/test.py --bd ${TEST_PY_BD} ${TEST_PY_ID} + -k "${TEST_PY_TEST_SPEC:-not a_test_which_does_not_exist}" + --build-dir "$UBOOT_TRAVIS_BUILD_DIR"; + ret=$?; + if [[ $ret -ne 0 ]]; then + exit $ret; + fi; fi matrix: |