mesa/.gitlab-ci/lava/utils
Guilherme Gallo bc86b73bbe ci/lava: Fix lava-tags parsing
python-fire auto-converts `item1,item2` into a tuple, but if there is a
dash `-` inside the argument, it treats it as a string.

Let's validate the data, when it comes as a `str` or `tuple`.

For more details, here are the tested scenarios:

| --lava-tags= | Type  | Value               |
|--------------|-------|---------------------|
| None         | bool  | True                |
| ''           | str   | ''                  |
| tag1         | str   | "tag1"              |
| tag1,        | tuple | ("tag1",)           |
| tag-1,tag-2  | str   | 'tag-1,tag-2'       |
| tag1,tag2    | tuple | ("tag1", "tag2")    |
| ','          | str   | ','                 |
| ',,'         | str   | ',,'                |
| 'tag1,,'     | str   | 'tag1,,'            |

See also:
https://google.github.io/python-fire/guide/#argument-parsing

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31882>
2024-10-31 18:00:27 +00:00
..
__init__.py ci/lava: Create LAVAJobDefinition 2023-11-02 03:31:50 +00:00
console_format.py ci/lava: Change default section colour to cyan 2024-10-20 11:32:42 +01:00
constants.py ci/lava: Detect a6xx gpu recovery failures 2024-07-19 23:41:13 +00:00
gitlab_section.py ci/lava: Print relative timestamps in sections 2024-10-20 11:32:42 +01:00
lava_farm.py ci/lava: Add LavaFarm class to find LAVA farm from runner tag 2023-02-16 13:08:41 +00:00
lava_job.py ci/lava: Coalesce post-processed job information 2024-10-20 11:32:42 +01:00
lava_job_definition.py ci/lava: Fix lava-tags parsing 2024-10-31 18:00:27 +00:00
lava_log_hints.py ci/lava: Detect a6xx gpu recovery failures 2024-07-19 23:41:13 +00:00
lava_proxy.py ci/lava: Remove pointless messages 2024-10-20 11:32:42 +01:00
log_follower.py ci/lava: Print relative timestamps in sections 2024-10-20 11:32:42 +01:00
log_section.py ci/lava: Print relative timestamps in sections 2024-10-20 11:32:42 +01:00
ssh_job_definition.py ci/lava: Add unit tests covering job definition 2023-11-02 03:31:50 +00:00
uart_job_definition.py ci/lava: Use LAVA rootfs overlays for build/per-job 2024-10-31 18:00:26 +00:00