[U-Boot] [PATCH] test/py: Set cache_dir to /tmp/.pytest_cache

Bin Meng bmeng.cn at gmail.com
Thu Oct 31 15:13:32 UTC 2019


Hi Tom,

On Thu, Oct 31, 2019 at 10:51 PM Tom Rini <trini at konsulko.com> wrote:
>
> For some time now, pytest has supported setting where a cache directory
> that it will use is located (and in turn has logic to re-use this cache
> and speed things up when possible).  When running the pytest tests on
> Azure Pipelines, our source directory is read-only and we now see a

Thanks for checking Azure. Though I did not see such warning from
pytest in my run below. Which job did you see it?
https://dev.azure.com/bmeng/GitHub/_build/results?buildId=134

BTW: It looks the green check mark on
https://github.com/u-boot/u-boot/commits/master only contains
Travis-CI results. Would you please set up the connection to Azure
pipeline as well?

> warning about being unable to create the .pytest_cache directory as the
> default is in the same place as pytest.ini.  Set cache_dir to
> /tmp/.pytest_cache so that it will always be placed in a read/write
> location.
>
> Cc: Stephen Warren <swarren at nvidia.com>
> Cc: Simon Glass <sjg at chromium.org>
> Cc: Bin Meng <bmeng.cn at gmail.com>
> Signed-off-by: Tom Rini <trini at konsulko.com>
> ---
> Looking at
> https://docs.pytest.org/en/latest/customize.html#confval-cache_dir we
> could use an environment variable but TMP/TMPDIR/etc aren't always going
> to be set and that in turn leads to test/py/$TMPDIR/.pytest_cache being
> used.  I think hard-coding to /tmp here ends up being less problematic
> but I am open to suggestions.  We could even just ignore the warning, I
> only spotted it when seeing why a test had otherwise failed.
> ---
>  test/py/pytest.ini | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/test/py/pytest.ini b/test/py/pytest.ini
> index e93d010f1fa2..56c1f0521a54 100644
> --- a/test/py/pytest.ini
> +++ b/test/py/pytest.ini
> @@ -11,3 +11,4 @@ markers =
>      notbuildconfigspec: U-Boot: Describes required disabled Kconfig options.
>      requiredtool: U-Boot: Required host tools for a test.
>      slow: U-Boot: Specific test will run slowly.
> +cache_dir = /tmp/.pytest_cache
> --

Regards,
Bin


More information about the U-Boot mailing list