diff mbox series

[yocto-autobuilder-helper,v2] scripts/run-toaster-tests.py: run via pytest and fix environment setup

Message ID 20231201144928.4191-1-alexander.lussier-cullen@savoirfairelinux.com
State New
Headers show
Series [yocto-autobuilder-helper,v2] scripts/run-toaster-tests.py: run via pytest and fix environment setup | expand

Commit Message

Alexander Lussier-Cullen Dec. 1, 2023, 2:49 p.m. UTC
Strip quotes from directory variables as they caused path errors.
Add environment variable for the toaster artifact directory.
Migrate from tox and django tools to using pytest.
Install python module requirements from the script as this is no
longer handled by tox.

Signed-off-by: Alexander Lussier-Cullen <alexander.lussier-cullen@savoirfairelinux.com>
CC: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 scripts/run-toaster-tests | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/scripts/run-toaster-tests b/scripts/run-toaster-tests
index 516965e..b694e37 100755
--- a/scripts/run-toaster-tests
+++ b/scripts/run-toaster-tests
@@ -16,13 +16,15 @@  pokydir=$(realpath "$2")
 cd $builddir
 
 bitbake -e > bbenv
-export SSTATE_DIR=$(grep '^SSTATE_DIR=' bbenv | cut -d "=" -f2-)
-export DL_DIR=$(grep '^DL_DIR=' bbenv | cut -d "=" -f2-)
+export SSTATE_DIR=$(grep '^SSTATE_DIR=' bbenv | cut -d "=" -f2- | sed -e 's/^"//' -e 's/"$//')
+export DL_DIR=$(grep '^DL_DIR=' bbenv | cut -d "=" -f2- | sed -e 's/^"//' -e 's/"$//')
 export TOASTER_DJANGO_TMPDIR=$builddir
+export TOASTER_DIR=$builddir
 
 mkdir -p toaster_logs
+
 python3 -m venv venv --without-pip --system-site-packages
 source venv/bin/activate
-python3 -m pip install tox
+python3 -m pip install -r $pokydir/bitbake/toaster-requirements.txt -r $pokydir/bitbake/lib/toaster/tests/toaster-tests-requirements.txt
 
-tox -c $pokydir/bitbake/lib/toaster/tox.ini
+python3 -m pytest -c $pokydir/bitbake/lib/toaster/pytest.ini $pokydir/bitbake/lib/toaster/tests/