Skip to content
Snippets Groups Projects
Commit 26a426a1 authored by Tom Rini's avatar Tom Rini
Browse files

travis/gitlab/azure: Ensure we use python3 always


When running our tests there are some cases where as part of the Python
2.7 to Python 3.6 migration we didn't force Python 3.6 to be used as
everything wasn't yet migrated.  Now that everything is, make sure to
tell virtualenv to use python3.  In the case of Travis this is best done
by making the tools test happen after the main tests so that it will
already have been run in all cases, TEST_PY_TOOLS is a subset of
TEST_PY_BD.

Signed-off-by: default avatarTom Rini <trini@konsulko.com>
parent fbf9c154
No related branches found
No related tags found
No related merge requests found
...@@ -123,7 +123,7 @@ jobs: ...@@ -123,7 +123,7 @@ jobs:
git config --global user.name "Azure Pipelines" git config --global user.name "Azure Pipelines"
git config --global user.email bmeng.cn@gmail.com git config --global user.email bmeng.cn@gmail.com
export USER=azure export USER=azure
virtualenv /tmp/venv virtualenv -p /usr/bin/python3 /tmp/venv
. /tmp/venv/bin/activate . /tmp/venv/bin/activate
pip install pyelftools pip install pyelftools
export UBOOT_TRAVIS_BUILD_DIR=/tmp/.bm-work/sandbox_spl export UBOOT_TRAVIS_BUILD_DIR=/tmp/.bm-work/sandbox_spl
......
...@@ -72,7 +72,7 @@ build all 64bit ARM platforms: ...@@ -72,7 +72,7 @@ build all 64bit ARM platforms:
tags: [ 'all' ] tags: [ 'all' ]
stage: world build stage: world build
script: script:
- virtualenv /tmp/venv - virtualenv -p /usr/bin/python3 /tmp/venv
- . /tmp/venv/bin/activate - . /tmp/venv/bin/activate
- pip install pyelftools - pip install pyelftools
- ret=0; - ret=0;
...@@ -157,7 +157,7 @@ Run binman, buildman, dtoc and patman testsuites: ...@@ -157,7 +157,7 @@ Run binman, buildman, dtoc and patman testsuites:
- git config --global user.name "GitLab CI Runner"; - git config --global user.name "GitLab CI Runner";
git config --global user.email trini@konsulko.com; git config --global user.email trini@konsulko.com;
export USER=gitlab; export USER=gitlab;
virtualenv /tmp/venv; virtualenv -p /usr/bin/python3 /tmp/venv;
. /tmp/venv/bin/activate; . /tmp/venv/bin/activate;
pip install pyelftools; pip install pyelftools;
export UBOOT_TRAVIS_BUILD_DIR=/tmp/.bm-work/sandbox_spl; export UBOOT_TRAVIS_BUILD_DIR=/tmp/.bm-work/sandbox_spl;
......
...@@ -133,16 +133,6 @@ script: ...@@ -133,16 +133,6 @@ script:
cp ~/grub_x64.efi $UBOOT_TRAVIS_BUILD_DIR/; 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-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; cp ~/grub2-arm64/usr/lib/grub2/arm64-efi/grub.efi $UBOOT_TRAVIS_BUILD_DIR/grub_arm64.efi;
if [[ -n "${TEST_PY_TOOLS}" ]]; then
PYTHONPATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc/pylibfdt"
PATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc:${PATH}"
./tools/binman/binman --toolpath ${UBOOT_TRAVIS_BUILD_DIR}/tools test &&
./tools/patman/patman --test &&
./tools/buildman/buildman -t &&
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 if [[ "${TEST_PY_BD}" != "" ]]; then
virtualenv -p /usr/bin/python3 /tmp/venv; virtualenv -p /usr/bin/python3 /tmp/venv;
. /tmp/venv/bin/activate; . /tmp/venv/bin/activate;
...@@ -154,6 +144,14 @@ script: ...@@ -154,6 +144,14 @@ script:
if [[ $ret -ne 0 ]]; then if [[ $ret -ne 0 ]]; then
exit $ret; exit $ret;
fi; fi;
if [[ -n "${TEST_PY_TOOLS}" ]]; then
export PYTHONPATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc/pylibfdt";
export PATH="${UBOOT_TRAVIS_BUILD_DIR}/scripts/dtc:${PATH}";
./tools/binman/binman --toolpath ${UBOOT_TRAVIS_BUILD_DIR}/tools test &&
./tools/patman/patman --test &&
./tools/buildman/buildman -t &&
./tools/dtoc/dtoc -t;
fi;
fi fi
matrix: matrix:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment