Avocado is a set of tools and libraries to help with automated testing. One can call it a test framework with benefits. Native tests are written in Python and they follow the unittest pattern, but any executable can serve as a test.
At a certain point a method is called to convert the cache_dirs to a list, but ast will fail with an error since it contains special (/) characters in it.
Steps to reproduce
Can reproduce it in two ways:
By setting the above in avocado.conf and running python3.10 test --select=unit
After a bit of debugging I could find the same behavior that _as_list(value) is doing by following the quick example on python CLE.
>>> import ast
>>> bla = '/build/avocado/data/cache'
>>> print(ast.literal_eval(bla))
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python3.10/ast.py", line 64, in literal_eval
node_or_string = parse(node_or_string.lstrip(" \t"), mode='eval')
File "/usr/lib/python3.10/ast.py", line 50, in parse
return compile(source, filename, mode, flags,
File "<unknown>", line 1
/build/avocado/data/cache
^
Expected behavior_as_list(value) should return the string as a list.
Current behavior
The above errors mentioned.
System information (please complete the following information):
OS: lsb_release -a
Ubuntu 22.04
Avocado version: avocado -v
103
Avocado installation method: pip, rpm, github ?
Trying to package it in Ubuntu and failing unit tests :-)
Maybe relevant to the bug:
Python version: python3 3.10.6-1~22.04
Additional information
Currently working on an effort to package avocado-framework into Ubuntu/Debian.
Describe the bug If I add a custom directory on avocado.conf with the example:
At a certain point a method is called to convert the cache_dirs to a list, but
ast
will fail with an error since it contains special (/
) characters in it.Steps to reproduce Can reproduce it in two ways: By setting the above in
avocado.conf
and runningpython3.10 test --select=unit
After a bit of debugging I could find the same behavior that
_as_list(value)
is doing by following the quick example on python CLE.Expected behavior
_as_list(value)
should return the string as a list.Current behavior The above errors mentioned.
System information (please complete the following information):
lsb_release -a
avocado -v
python3 3.10.6-1~22.04
Additional information Currently working on an effort to package
avocado-framework
into Ubuntu/Debian.