[PATCH 1/2] Azure CI: Save pytest output automatically

Enable use of the python-azurepipelines package which provides automatic formatting and uploading of the pytest output.
Signed-off-by: Tom Rini trini@konsulko.com --- .azure-pipelines.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/.azure-pipelines.yml b/.azure-pipelines.yml index f6609bbd6bd1..609020fa5498 100644 --- a/.azure-pipelines.yml +++ b/.azure-pipelines.yml @@ -194,10 +194,11 @@ stages: virtualenv -p /usr/bin/python3 /tmp/venv . /tmp/venv/bin/activate pip install -r test/py/requirements.txt + pip install pytest-azurepipelines export PATH=/opt/qemu/bin:/tmp/uboot-test-hooks/bin:${PATH}; export PYTHONPATH=/tmp/uboot-test-hooks/py/travis-ci; # "${var:+"-k $var"}" expands to "" if $var is empty, "-k $var" if not - ./test/py/test.py -ra --bd ${TEST_PY_BD} ${TEST_PY_ID} ${TEST_PY_TEST_SPEC:+"-k ${TEST_PY_TEST_SPEC}"} --build-dir "$UBOOT_TRAVIS_BUILD_DIR"; + ./test/py/test.py -ra --bd ${TEST_PY_BD} ${TEST_PY_ID} ${TEST_PY_TEST_SPEC:+"-k ${TEST_PY_TEST_SPEC}"} --build-dir "$UBOOT_TRAVIS_BUILD_DIR" --report-dir "$UBOOT_TRAVIS_BUILD_DIR"; # the below corresponds to .gitlab-ci.yml "after_script" rm -rf /tmp/uboot-test-hooks /tmp/venv EOF

The default pytest cache directory is in a read-only directory in Azure, which results in a warning on the build page. Use the pytest command line option to set the cache dir to somewhere writable.
Signed-off-by: Tom Rini trini@konsulko.com --- .azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.azure-pipelines.yml b/.azure-pipelines.yml index 609020fa5498..e0c499f8a407 100644 --- a/.azure-pipelines.yml +++ b/.azure-pipelines.yml @@ -198,7 +198,7 @@ stages: export PATH=/opt/qemu/bin:/tmp/uboot-test-hooks/bin:${PATH}; export PYTHONPATH=/tmp/uboot-test-hooks/py/travis-ci; # "${var:+"-k $var"}" expands to "" if $var is empty, "-k $var" if not - ./test/py/test.py -ra --bd ${TEST_PY_BD} ${TEST_PY_ID} ${TEST_PY_TEST_SPEC:+"-k ${TEST_PY_TEST_SPEC}"} --build-dir "$UBOOT_TRAVIS_BUILD_DIR" --report-dir "$UBOOT_TRAVIS_BUILD_DIR"; + ./test/py/test.py -ra -o cache_dir="$UBOOT_TRAVIS_BUILD_DIR"/.pytest_cache --bd ${TEST_PY_BD} ${TEST_PY_ID} ${TEST_PY_TEST_SPEC:+"-k ${TEST_PY_TEST_SPEC}"} --build-dir "$UBOOT_TRAVIS_BUILD_DIR" --report-dir "$UBOOT_TRAVIS_BUILD_DIR"; # the below corresponds to .gitlab-ci.yml "after_script" rm -rf /tmp/uboot-test-hooks /tmp/venv EOF

On Tue, 28 Feb 2023 at 13:29, Tom Rini trini@konsulko.com wrote:
The default pytest cache directory is in a read-only directory in Azure, which results in a warning on the build page. Use the pytest command line option to set the cache dir to somewhere writable.
Signed-off-by: Tom Rini trini@konsulko.com
.azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by: Simon Glass sjg@chromium.org

On Tue, Feb 28, 2023 at 03:28:49PM -0500, Tom Rini wrote:
The default pytest cache directory is in a read-only directory in Azure, which results in a warning on the build page. Use the pytest command line option to set the cache dir to somewhere writable.
Signed-off-by: Tom Rini trini@konsulko.com Reviewed-by: Simon Glass sjg@chromium.org
Applied to u-boot/next, thanks!

On Tue, 28 Feb 2023 at 13:29, Tom Rini trini@konsulko.com wrote:
Enable use of the python-azurepipelines package which provides automatic formatting and uploading of the pytest output.
Signed-off-by: Tom Rini trini@konsulko.com
.azure-pipelines.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
Reviewed-by: Simon Glass sjg@chromium.org
diff --git a/.azure-pipelines.yml b/.azure-pipelines.yml index f6609bbd6bd1..609020fa5498 100644 --- a/.azure-pipelines.yml +++ b/.azure-pipelines.yml @@ -194,10 +194,11 @@ stages: virtualenv -p /usr/bin/python3 /tmp/venv . /tmp/venv/bin/activate pip install -r test/py/requirements.txt
pip install pytest-azurepipelines export PATH=/opt/qemu/bin:/tmp/uboot-test-hooks/bin:${PATH}; export PYTHONPATH=/tmp/uboot-test-hooks/py/travis-ci; # "${var:+"-k $var"}" expands to "" if $var is empty, "-k $var" if not
./test/py/test.py -ra --bd ${TEST_PY_BD} ${TEST_PY_ID} ${TEST_PY_TEST_SPEC:+"-k ${TEST_PY_TEST_SPEC}"} --build-dir "$UBOOT_TRAVIS_BUILD_DIR";
./test/py/test.py -ra --bd ${TEST_PY_BD} ${TEST_PY_ID} ${TEST_PY_TEST_SPEC:+"-k ${TEST_PY_TEST_SPEC}"} --build-dir "$UBOOT_TRAVIS_BUILD_DIR" --report-dir "$UBOOT_TRAVIS_BUILD_DIR"; # the below corresponds to .gitlab-ci.yml "after_script" rm -rf /tmp/uboot-test-hooks /tmp/venv EOF
-- 2.34.1

On Tue, Feb 28, 2023 at 03:28:48PM -0500, Tom Rini wrote:
Enable use of the python-azurepipelines package which provides automatic formatting and uploading of the pytest output.
Signed-off-by: Tom Rini trini@konsulko.com Reviewed-by: Simon Glass sjg@chromium.org
Applied to u-boot/next, thanks!
participants (2)
-
Simon Glass
-
Tom Rini