From: Jonas Rebmann <jre@pengutronix.de>
To: Ahmad Fatoum <a.fatoum@pengutronix.de>, barebox@lists.infradead.org
Subject: Re: [PATCH] fixup! test: py: add TLV integration tests
Date: Tue, 14 Oct 2025 17:26:35 +0200 [thread overview]
Message-ID: <c52ff3ad-bd4f-4a79-8106-c880212d6c1e@pengutronix.de> (raw)
In-Reply-To: <20251013120031.761008-1-a.fatoum@pengutronix.de>
Hi Ahmad
On 2025-10-13 14:00, Ahmad Fatoum wrote:
> test: py: tlv: skip when crcmod is missing
>
> TLV tests shouldn't fail the test suite if the dependencies for the
> generator scripts are not available.
>
> Therefore, have the script return 127 as specific error code and skip
> the test in that case.
>
> While at it, also drop the currently unused import for mkPredefinedCrcFun.
My patch "test: py: add TLV integration tests" intentionally only
changes the test case. I think we should separate those things.
> Cc: Jonas Rebmann <jre@pengutronix.de>
> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
> ---
> scripts/bareboxtlv-generator/bareboxtlv-generator.py | 8 +++++++-
> test/py/test_tlv.py | 6 +++---
> 2 files changed, 10 insertions(+), 4 deletions(-)
>
> diff --git a/scripts/bareboxtlv-generator/bareboxtlv-generator.py b/scripts/bareboxtlv-generator/bareboxtlv-generator.py
> index 5f9285a80630..6174fe91cdd4 100755
> --- a/scripts/bareboxtlv-generator/bareboxtlv-generator.py
> +++ b/scripts/bareboxtlv-generator/bareboxtlv-generator.py
> @@ -2,9 +2,15 @@
>
> import argparse
> import struct
> +import sys
>
> import yaml
> -from crcmod.predefined import mkPredefinedCrcFun
> +
> +try:
> + from crcmod.predefined import mkPredefinedCrcFun
> +except ModuleNotFoundError:
> + print("Error: missing crcmod dependency", file=sys.stderr)
> + sys.exit(127)
>
> _crc32_mpeg = mkPredefinedCrcFun("crc-32-mpeg")
>
Could you move this change to a separate patch which is not a fixup?
> diff --git a/test/py/test_tlv.py b/test/py/test_tlv.py
> index 963f3749b33b..79f9f9d01bbb 100644
> --- a/test/py/test_tlv.py
> +++ b/test/py/test_tlv.py
> @@ -2,11 +2,8 @@ import os
> import re
> import subprocess
> from pathlib import Path
> -from crcmod.predefined import mkPredefinedCrcFun
> from .helper import skip_disabled
>
> -_crc32_mpeg = mkPredefinedCrcFun("crc-32-mpeg")
> -
> import pytest
>
>
> @@ -14,6 +11,9 @@ class _TLV_Testdata:
> def generator(self, args, check=True):
> cmd = [os.sys.executable, str(self.generator_py)] + args
> res = subprocess.run(cmd, text=True)
> + if res.returncode == 127:
> + pytest.skip("test skipped due to missing host dependencies")
> +
> if check and res.returncode != 0:
> raise RuntimeError(f"generator failed ({res.returncode}): {res.stdout}\n{res.stderr}")
> return res
And only leave this as fixup to the change on the test case?
The reason it bothers me is that I'd like TLV signature without the
integration tests to be easily backportable.
Regards,
Jonas
--
Pengutronix e.K. | Jonas Rebmann |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-9 |
prev parent reply other threads:[~2025-10-14 15:27 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-13 12:00 Ahmad Fatoum
2025-10-14 15:26 ` Jonas Rebmann [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=c52ff3ad-bd4f-4a79-8106-c880212d6c1e@pengutronix.de \
--to=jre@pengutronix.de \
--cc=a.fatoum@pengutronix.de \
--cc=barebox@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox