tests(cpu): Add deep sleep and misc tests for CPU #2995
10 errors, 22 pass in 16m 13s
Annotations
Check failure on line 0 in validation.hello_world.test_hello_world
github-actions / Test Results
4 out of 12 runs with error: test_hello_world (validation.hello_world.test_hello_world)
./artifacts/parent-artifacts/results/hw/validation/hello_world/esp32/hello_world.xml [took 3s]
./artifacts/parent-artifacts/results/hw/validation/hello_world/esp32c6/hello_world.xml [took 3s]
./artifacts/parent-artifacts/results/hw/validation/hello_world/esp32h2/hello_world.xml [took 3s]
./artifacts/parent-artifacts/results/hw/validation/hello_world/esp32s2/hello_world.xml [took 3s]
Raw output
failed on setup with "ValueError: Couldn't auto detect chip. Please manually specify with "--port""
args = ()
kwargs = {'_fixture_classes_and_options': ClassCliOptions(classes={'app': <class 'pytest_embedded_arduino.app.ArduinoApp'>, 'se...ino.app.ArduinoApp object at 0x7fefb13fcbb0>, 'msg_queue': <pytest_embedded.log.MessageQueue object at 0x7fefb13afbe0>}
_close_or_terminate = <function multi_dut_generator_fixture.<locals>.wrapper.<locals>._close_or_terminate at 0x7fefb1405000>
res = None
@functools.wraps(func)
def wrapper(*args, **kwargs):
def _close_or_terminate(obj):
if obj is None:
del obj
return
try:
if isinstance(obj, (subprocess.Popen, multiprocessing.process.BaseProcess)):
obj.terminate()
obj.kill()
elif isinstance(obj, io.IOBase):
try:
obj.close()
except Exception as e:
logging.debug('file %s closed failed with error: %s', obj, str(e))
else:
try:
obj.close()
except AttributeError:
try:
obj.terminate()
except AttributeError:
pass
except Exception as e:
logging.debug('Not properly caught object %s: %s', obj, str(e))
except Exception as e:
logging.debug('%s: %s', obj, str(e))
return # swallow up all error
finally:
referrers = gc.get_referrers(obj)
for _referrer in referrers:
if isinstance(_referrer, list):
for _i, val in enumerate(_referrer):
if val is obj:
_referrer[_i] = None
elif isinstance(_referrer, dict):
for key, value in _referrer.items():
if value is obj:
_referrer[key] = None
del obj
if _COUNT == 1:
res = None
try:
> res = func(*args, **kwargs)
/usr/local/lib/python3.10/site-packages/pytest_embedded/plugin.py:490:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/local/lib/python3.10/site-packages/pytest_embedded/plugin.py:1111: in serial
return serial_gn(**locals())
/usr/local/lib/python3.10/site-packages/pytest_embedded/dut_factory.py:431: in serial_gn
return cls(**_drop_none_kwargs(kwargs))
/usr/local/lib/python3.10/site-packages/pytest_embedded_arduino/serial.py:26: in __init__
super().__init__(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pytest_embedded_arduino.serial.ArduinoSerial object at 0x7fefb13fd030>
pexpect_proc = <pytest_embedded.log.PexpectProcess object at 0x7fefb13fca90>
msg_queue = <pytest_embedded.log.MessageQueue object at 0x7fefb13afbe0>
target = 'esp32c6', beta_target = None, port = None, port_mac = None
baud = 115200, esptool_baud = 921600, esp_flash_force = False
skip_autoflash = False, erase_all = False
meta = Meta(logdir='/tmp/pytest-embedded/2024-09-19_16-56-29-047708/test_hello_world', port_target_cache={}, port_app_cache={}, logfile_extension='.log')
ports_to_occupy = (), kwargs = {}, available_ports = ['/dev/ttyS0']
ports = ['/dev/ttyS0']
def __init__(
self,
pexpect_proc: PexpectProcess,
msg_queue: MessageQueue,
target: Optional[str] = None,
beta_target: Optional[str] = None,
port: Optional[str] = None,
port_mac: Optional[str] = None,
baud: int = Serial.DEFAULT_BAUDRATE,
esptool_baud: int = ESPTOOL_DEFAULT_BAUDRATE,
esp_flash_force: bool = False,
skip_autoflash: bool = False,
erase_all: bool = False,
meta: Optional[Meta] = None,
ports_to_occupy: List[str] = (),
**kwargs,
) -> None:
self._meta = meta
esptool_target = beta_target or target or 'auto'
if port is None or port.endswith('*'):
port_filter = port.strip('*') if port else ''
available_ports = [_p for _p in esptool.get_port_list() if port_filter in _p]
ports = list(set(available_ports) - set(self.occupied_ports.keys()) - set(ports_to_occupy))
# sort to make /dev/ttyS* ports before /dev/ttyUSB* ports
# esptool will reverse the list
ports.sort()
if port_mac:
for port in ports:
if _is_port_mac_verified(pexpect_proc, port, port_mac, msg_queue):
ports = [port]
break
else:
raise ValueError(f'The specified MAC address {port_mac} cannot be found.')
# prioritize the cache recorded target port
if esptool_target and self._meta:
ports.sort(key=lambda x: self._meta.hit_port_target_cache(x, esptool_target))
logging.debug(f'Detecting ports from {", ".join(ports)}')
else:
if port_mac:
if _is_port_mac_verified(pexpect_proc, port, port_mac, msg_queue):
ports = [port]
else:
raise ValueError(f'The specified MAC address {port_mac} binds with different port, not with {port}')
else:
ports = [port]
# normal loader
if esptool_target not in ['auto', *ESPTOOL_CHIPS]:
raise ValueError(
f'esptool version {ESPTOOL_VERSION} not support target {esptool_target}\n'
f'Supported targets: {ESPTOOL_CHIPS}'
)
with contextlib.redirect_stdout(msg_queue):
self.esp = esptool.get_default_connected_device(
ports,
port=port,
connect_attempts=3,
initial_baud=baud,
chip=esptool_target,
)
if not self.esp:
> raise ValueError('Couldn\'t auto detect chip. Please manually specify with "--port"')
E ValueError: Couldn't auto detect chip. Please manually specify with "--port"
/usr/local/lib/python3.10/site-packages/pytest_embedded_serial_esp/serial.py:118: ValueError
Check failure on line 0 in validation.nvs.test_nvs
github-actions / Test Results
12 out of 34 runs with error: test_nvs (validation.nvs.test_nvs)
./artifacts/parent-artifacts/results/hw/validation/nvs/esp32/nvs0.xml [took 3s]
./artifacts/parent-artifacts/results/hw/validation/nvs/esp32/nvs1.xml [took 3s]
./artifacts/parent-artifacts/results/hw/validation/nvs/esp32c6/nvs0.xml [took 3s]
./artifacts/parent-artifacts/results/hw/validation/nvs/esp32c6/nvs1.xml [took 3s]
./artifacts/parent-artifacts/results/hw/validation/nvs/esp32c6/nvs2.xml [took 3s]
./artifacts/parent-artifacts/results/hw/validation/nvs/esp32c6/nvs3.xml [took 3s]
./artifacts/parent-artifacts/results/hw/validation/nvs/esp32h2/nvs0.xml [took 3s]
./artifacts/parent-artifacts/results/hw/validation/nvs/esp32h2/nvs1.xml [took 3s]
./artifacts/parent-artifacts/results/hw/validation/nvs/esp32h2/nvs2.xml [took 3s]
./artifacts/parent-artifacts/results/hw/validation/nvs/esp32h2/nvs3.xml [took 3s]
./artifacts/parent-artifacts/results/hw/validation/nvs/esp32s2/nvs0.xml [took 3s]
./artifacts/parent-artifacts/results/hw/validation/nvs/esp32s2/nvs1.xml [took 3s]
Raw output
failed on setup with "ValueError: Couldn't auto detect chip. Please manually specify with "--port""
args = ()
kwargs = {'_fixture_classes_and_options': ClassCliOptions(classes={'app': <class 'pytest_embedded_arduino.app.ArduinoApp'>, 'se...ino.app.ArduinoApp object at 0x7f931ce68c70>, 'msg_queue': <pytest_embedded.log.MessageQueue object at 0x7f931ce23ca0>}
_close_or_terminate = <function multi_dut_generator_fixture.<locals>.wrapper.<locals>._close_or_terminate at 0x7f931ce74ee0>
res = None
@functools.wraps(func)
def wrapper(*args, **kwargs):
def _close_or_terminate(obj):
if obj is None:
del obj
return
try:
if isinstance(obj, (subprocess.Popen, multiprocessing.process.BaseProcess)):
obj.terminate()
obj.kill()
elif isinstance(obj, io.IOBase):
try:
obj.close()
except Exception as e:
logging.debug('file %s closed failed with error: %s', obj, str(e))
else:
try:
obj.close()
except AttributeError:
try:
obj.terminate()
except AttributeError:
pass
except Exception as e:
logging.debug('Not properly caught object %s: %s', obj, str(e))
except Exception as e:
logging.debug('%s: %s', obj, str(e))
return # swallow up all error
finally:
referrers = gc.get_referrers(obj)
for _referrer in referrers:
if isinstance(_referrer, list):
for _i, val in enumerate(_referrer):
if val is obj:
_referrer[_i] = None
elif isinstance(_referrer, dict):
for key, value in _referrer.items():
if value is obj:
_referrer[key] = None
del obj
if _COUNT == 1:
res = None
try:
> res = func(*args, **kwargs)
/usr/local/lib/python3.10/site-packages/pytest_embedded/plugin.py:490:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/local/lib/python3.10/site-packages/pytest_embedded/plugin.py:1111: in serial
return serial_gn(**locals())
/usr/local/lib/python3.10/site-packages/pytest_embedded/dut_factory.py:431: in serial_gn
return cls(**_drop_none_kwargs(kwargs))
/usr/local/lib/python3.10/site-packages/pytest_embedded_arduino/serial.py:26: in __init__
super().__init__(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pytest_embedded_arduino.serial.ArduinoSerial object at 0x7f931ce690f0>
pexpect_proc = <pytest_embedded.log.PexpectProcess object at 0x7f931ce68b50>
msg_queue = <pytest_embedded.log.MessageQueue object at 0x7f931ce23ca0>
target = 'esp32c6', beta_target = None, port = None, port_mac = None
baud = 115200, esptool_baud = 921600, esp_flash_force = False
skip_autoflash = False, erase_all = False
meta = Meta(logdir='/tmp/pytest-embedded/2024-09-19_16-57-15-506521/test_nvs', port_target_cache={}, port_app_cache={}, logfile_extension='.log')
ports_to_occupy = (), kwargs = {}, available_ports = ['/dev/ttyS0']
ports = ['/dev/ttyS0']
def __init__(
self,
pexpect_proc: PexpectProcess,
msg_queue: MessageQueue,
target: Optional[str] = None,
beta_target: Optional[str] = None,
port: Optional[str] = None,
port_mac: Optional[str] = None,
baud: int = Serial.DEFAULT_BAUDRATE,
esptool_baud: int = ESPTOOL_DEFAULT_BAUDRATE,
esp_flash_force: bool = False,
skip_autoflash: bool = False,
erase_all: bool = False,
meta: Optional[Meta] = None,
ports_to_occupy: List[str] = (),
**kwargs,
) -> None:
self._meta = meta
esptool_target = beta_target or target or 'auto'
if port is None or port.endswith('*'):
port_filter = port.strip('*') if port else ''
available_ports = [_p for _p in esptool.get_port_list() if port_filter in _p]
ports = list(set(available_ports) - set(self.occupied_ports.keys()) - set(ports_to_occupy))
# sort to make /dev/ttyS* ports before /dev/ttyUSB* ports
# esptool will reverse the list
ports.sort()
if port_mac:
for port in ports:
if _is_port_mac_verified(pexpect_proc, port, port_mac, msg_queue):
ports = [port]
break
else:
raise ValueError(f'The specified MAC address {port_mac} cannot be found.')
# prioritize the cache recorded target port
if esptool_target and self._meta:
ports.sort(key=lambda x: self._meta.hit_port_target_cache(x, esptool_target))
logging.debug(f'Detecting ports from {", ".join(ports)}')
else:
if port_mac:
if _is_port_mac_verified(pexpect_proc, port, port_mac, msg_queue):
ports = [port]
else:
raise ValueError(f'The specified MAC address {port_mac} binds with different port, not with {port}')
else:
ports = [port]
# normal loader
if esptool_target not in ['auto', *ESPTOOL_CHIPS]:
raise ValueError(
f'esptool version {ESPTOOL_VERSION} not support target {esptool_target}\n'
f'Supported targets: {ESPTOOL_CHIPS}'
)
with contextlib.redirect_stdout(msg_queue):
self.esp = esptool.get_default_connected_device(
ports,
port=port,
connect_attempts=3,
initial_baud=baud,
chip=esptool_target,
)
if not self.esp:
> raise ValueError('Couldn\'t auto detect chip. Please manually specify with "--port"')
E ValueError: Couldn't auto detect chip. Please manually specify with "--port"
/usr/local/lib/python3.10/site-packages/pytest_embedded_serial_esp/serial.py:118: ValueError
Check failure on line 0 in validation.democfg.test_democfg
github-actions / Test Results
4 out of 12 runs with error: test_cfg (validation.democfg.test_democfg)
./artifacts/parent-artifacts/results/hw/validation/democfg/esp32/democfg0.xml [took 3s]
./artifacts/parent-artifacts/results/hw/validation/democfg/esp32/democfg1.xml [took 3s]
./artifacts/parent-artifacts/results/hw/validation/democfg/esp32c6/democfg.xml [took 3s]
./artifacts/parent-artifacts/results/hw/validation/democfg/esp32s2/democfg.xml [took 3s]
Raw output
failed on setup with "ValueError: Couldn't auto detect chip. Please manually specify with "--port""
args = ()
kwargs = {'_fixture_classes_and_options': ClassCliOptions(classes={'app': <class 'pytest_embedded_arduino.app.ArduinoApp'>, 'se...ino.app.ArduinoApp object at 0x7ff92c9acb50>, 'msg_queue': <pytest_embedded.log.MessageQueue object at 0x7ff92c963b80>}
_close_or_terminate = <function multi_dut_generator_fixture.<locals>.wrapper.<locals>._close_or_terminate at 0x7ff92c9b4ee0>
res = None
@functools.wraps(func)
def wrapper(*args, **kwargs):
def _close_or_terminate(obj):
if obj is None:
del obj
return
try:
if isinstance(obj, (subprocess.Popen, multiprocessing.process.BaseProcess)):
obj.terminate()
obj.kill()
elif isinstance(obj, io.IOBase):
try:
obj.close()
except Exception as e:
logging.debug('file %s closed failed with error: %s', obj, str(e))
else:
try:
obj.close()
except AttributeError:
try:
obj.terminate()
except AttributeError:
pass
except Exception as e:
logging.debug('Not properly caught object %s: %s', obj, str(e))
except Exception as e:
logging.debug('%s: %s', obj, str(e))
return # swallow up all error
finally:
referrers = gc.get_referrers(obj)
for _referrer in referrers:
if isinstance(_referrer, list):
for _i, val in enumerate(_referrer):
if val is obj:
_referrer[_i] = None
elif isinstance(_referrer, dict):
for key, value in _referrer.items():
if value is obj:
_referrer[key] = None
del obj
if _COUNT == 1:
res = None
try:
> res = func(*args, **kwargs)
/usr/local/lib/python3.10/site-packages/pytest_embedded/plugin.py:490:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/local/lib/python3.10/site-packages/pytest_embedded/plugin.py:1111: in serial
return serial_gn(**locals())
/usr/local/lib/python3.10/site-packages/pytest_embedded/dut_factory.py:431: in serial_gn
return cls(**_drop_none_kwargs(kwargs))
/usr/local/lib/python3.10/site-packages/pytest_embedded_arduino/serial.py:26: in __init__
super().__init__(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pytest_embedded_arduino.serial.ArduinoSerial object at 0x7ff92c9acfd0>
pexpect_proc = <pytest_embedded.log.PexpectProcess object at 0x7ff92c9aca30>
msg_queue = <pytest_embedded.log.MessageQueue object at 0x7ff92c963b80>
target = 'esp32', beta_target = None, port = None, port_mac = None
baud = 115200, esptool_baud = 921600, esp_flash_force = False
skip_autoflash = False, erase_all = False
meta = Meta(logdir='/tmp/pytest-embedded/2024-09-19_16-56-18-788848/test_cfg', port_target_cache={}, port_app_cache={}, logfile_extension='.log')
ports_to_occupy = (), kwargs = {}, available_ports = ['/dev/ttyS0']
ports = ['/dev/ttyS0']
def __init__(
self,
pexpect_proc: PexpectProcess,
msg_queue: MessageQueue,
target: Optional[str] = None,
beta_target: Optional[str] = None,
port: Optional[str] = None,
port_mac: Optional[str] = None,
baud: int = Serial.DEFAULT_BAUDRATE,
esptool_baud: int = ESPTOOL_DEFAULT_BAUDRATE,
esp_flash_force: bool = False,
skip_autoflash: bool = False,
erase_all: bool = False,
meta: Optional[Meta] = None,
ports_to_occupy: List[str] = (),
**kwargs,
) -> None:
self._meta = meta
esptool_target = beta_target or target or 'auto'
if port is None or port.endswith('*'):
port_filter = port.strip('*') if port else ''
available_ports = [_p for _p in esptool.get_port_list() if port_filter in _p]
ports = list(set(available_ports) - set(self.occupied_ports.keys()) - set(ports_to_occupy))
# sort to make /dev/ttyS* ports before /dev/ttyUSB* ports
# esptool will reverse the list
ports.sort()
if port_mac:
for port in ports:
if _is_port_mac_verified(pexpect_proc, port, port_mac, msg_queue):
ports = [port]
break
else:
raise ValueError(f'The specified MAC address {port_mac} cannot be found.')
# prioritize the cache recorded target port
if esptool_target and self._meta:
ports.sort(key=lambda x: self._meta.hit_port_target_cache(x, esptool_target))
logging.debug(f'Detecting ports from {", ".join(ports)}')
else:
if port_mac:
if _is_port_mac_verified(pexpect_proc, port, port_mac, msg_queue):
ports = [port]
else:
raise ValueError(f'The specified MAC address {port_mac} binds with different port, not with {port}')
else:
ports = [port]
# normal loader
if esptool_target not in ['auto', *ESPTOOL_CHIPS]:
raise ValueError(
f'esptool version {ESPTOOL_VERSION} not support target {esptool_target}\n'
f'Supported targets: {ESPTOOL_CHIPS}'
)
with contextlib.redirect_stdout(msg_queue):
self.esp = esptool.get_default_connected_device(
ports,
port=port,
connect_attempts=3,
initial_baud=baud,
chip=esptool_target,
)
if not self.esp:
> raise ValueError('Couldn\'t auto detect chip. Please manually specify with "--port"')
E ValueError: Couldn't auto detect chip. Please manually specify with "--port"
/usr/local/lib/python3.10/site-packages/pytest_embedded_serial_esp/serial.py:118: ValueError
Check failure on line 0 in validation.periman.test_periman
github-actions / Test Results
4 out of 6 runs with error: test_periman (validation.periman.test_periman)
./artifacts/parent-artifacts/results/hw/validation/periman/esp32/periman.xml [took 3s]
./artifacts/parent-artifacts/results/hw/validation/periman/esp32c6/periman.xml [took 3s]
./artifacts/parent-artifacts/results/hw/validation/periman/esp32h2/periman.xml [took 3s]
./artifacts/parent-artifacts/results/hw/validation/periman/esp32s2/periman.xml [took 3s]
Raw output
failed on setup with "ValueError: Couldn't auto detect chip. Please manually specify with "--port""
args = ()
kwargs = {'_fixture_classes_and_options': ClassCliOptions(classes={'app': <class 'pytest_embedded_arduino.app.ArduinoApp'>, 'se...ino.app.ArduinoApp object at 0x7f71963a0dc0>, 'msg_queue': <pytest_embedded.log.MessageQueue object at 0x7f719635bdf0>}
_close_or_terminate = <function multi_dut_generator_fixture.<locals>.wrapper.<locals>._close_or_terminate at 0x7f7196070ee0>
res = None
@functools.wraps(func)
def wrapper(*args, **kwargs):
def _close_or_terminate(obj):
if obj is None:
del obj
return
try:
if isinstance(obj, (subprocess.Popen, multiprocessing.process.BaseProcess)):
obj.terminate()
obj.kill()
elif isinstance(obj, io.IOBase):
try:
obj.close()
except Exception as e:
logging.debug('file %s closed failed with error: %s', obj, str(e))
else:
try:
obj.close()
except AttributeError:
try:
obj.terminate()
except AttributeError:
pass
except Exception as e:
logging.debug('Not properly caught object %s: %s', obj, str(e))
except Exception as e:
logging.debug('%s: %s', obj, str(e))
return # swallow up all error
finally:
referrers = gc.get_referrers(obj)
for _referrer in referrers:
if isinstance(_referrer, list):
for _i, val in enumerate(_referrer):
if val is obj:
_referrer[_i] = None
elif isinstance(_referrer, dict):
for key, value in _referrer.items():
if value is obj:
_referrer[key] = None
del obj
if _COUNT == 1:
res = None
try:
> res = func(*args, **kwargs)
/usr/local/lib/python3.10/site-packages/pytest_embedded/plugin.py:490:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/local/lib/python3.10/site-packages/pytest_embedded/plugin.py:1111: in serial
return serial_gn(**locals())
/usr/local/lib/python3.10/site-packages/pytest_embedded/dut_factory.py:431: in serial_gn
return cls(**_drop_none_kwargs(kwargs))
/usr/local/lib/python3.10/site-packages/pytest_embedded_arduino/serial.py:26: in __init__
super().__init__(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pytest_embedded_arduino.serial.ArduinoSerial object at 0x7f71963a1240>
pexpect_proc = <pytest_embedded.log.PexpectProcess object at 0x7f71963a0ca0>
msg_queue = <pytest_embedded.log.MessageQueue object at 0x7f719635bdf0>
target = 'esp32c6', beta_target = None, port = None, port_mac = None
baud = 115200, esptool_baud = 921600, esp_flash_force = False
skip_autoflash = False, erase_all = False
meta = Meta(logdir='/tmp/pytest-embedded/2024-09-19_16-57-46-491504/test_periman', port_target_cache={}, port_app_cache={}, logfile_extension='.log')
ports_to_occupy = (), kwargs = {}, available_ports = ['/dev/ttyS0']
ports = ['/dev/ttyS0']
def __init__(
self,
pexpect_proc: PexpectProcess,
msg_queue: MessageQueue,
target: Optional[str] = None,
beta_target: Optional[str] = None,
port: Optional[str] = None,
port_mac: Optional[str] = None,
baud: int = Serial.DEFAULT_BAUDRATE,
esptool_baud: int = ESPTOOL_DEFAULT_BAUDRATE,
esp_flash_force: bool = False,
skip_autoflash: bool = False,
erase_all: bool = False,
meta: Optional[Meta] = None,
ports_to_occupy: List[str] = (),
**kwargs,
) -> None:
self._meta = meta
esptool_target = beta_target or target or 'auto'
if port is None or port.endswith('*'):
port_filter = port.strip('*') if port else ''
available_ports = [_p for _p in esptool.get_port_list() if port_filter in _p]
ports = list(set(available_ports) - set(self.occupied_ports.keys()) - set(ports_to_occupy))
# sort to make /dev/ttyS* ports before /dev/ttyUSB* ports
# esptool will reverse the list
ports.sort()
if port_mac:
for port in ports:
if _is_port_mac_verified(pexpect_proc, port, port_mac, msg_queue):
ports = [port]
break
else:
raise ValueError(f'The specified MAC address {port_mac} cannot be found.')
# prioritize the cache recorded target port
if esptool_target and self._meta:
ports.sort(key=lambda x: self._meta.hit_port_target_cache(x, esptool_target))
logging.debug(f'Detecting ports from {", ".join(ports)}')
else:
if port_mac:
if _is_port_mac_verified(pexpect_proc, port, port_mac, msg_queue):
ports = [port]
else:
raise ValueError(f'The specified MAC address {port_mac} binds with different port, not with {port}')
else:
ports = [port]
# normal loader
if esptool_target not in ['auto', *ESPTOOL_CHIPS]:
raise ValueError(
f'esptool version {ESPTOOL_VERSION} not support target {esptool_target}\n'
f'Supported targets: {ESPTOOL_CHIPS}'
)
with contextlib.redirect_stdout(msg_queue):
self.esp = esptool.get_default_connected_device(
ports,
port=port,
connect_attempts=3,
initial_baud=baud,
chip=esptool_target,
)
if not self.esp:
> raise ValueError('Couldn\'t auto detect chip. Please manually specify with "--port"')
E ValueError: Couldn't auto detect chip. Please manually specify with "--port"
/usr/local/lib/python3.10/site-packages/pytest_embedded_serial_esp/serial.py:118: ValueError
Check failure on line 0 in validation.timer.test_timer
github-actions / Test Results
All 4 runs with error: test_timer (validation.timer.test_timer)
./artifacts/parent-artifacts/results/hw/validation/timer/esp32/timer.xml [took 3s]
./artifacts/parent-artifacts/results/hw/validation/timer/esp32c6/timer.xml [took 3s]
./artifacts/parent-artifacts/results/hw/validation/timer/esp32h2/timer.xml [took 3s]
./artifacts/parent-artifacts/results/hw/validation/timer/esp32s2/timer.xml [took 3s]
Raw output
failed on setup with "ValueError: Couldn't auto detect chip. Please manually specify with "--port""
args = ()
kwargs = {'_fixture_classes_and_options': ClassCliOptions(classes={'app': <class 'pytest_embedded_arduino.app.ArduinoApp'>, 'se...ino.app.ArduinoApp object at 0x7f8629cccd90>, 'msg_queue': <pytest_embedded.log.MessageQueue object at 0x7f8629c87dc0>}
_close_or_terminate = <function multi_dut_generator_fixture.<locals>.wrapper.<locals>._close_or_terminate at 0x7f8629cd8ee0>
res = None
@functools.wraps(func)
def wrapper(*args, **kwargs):
def _close_or_terminate(obj):
if obj is None:
del obj
return
try:
if isinstance(obj, (subprocess.Popen, multiprocessing.process.BaseProcess)):
obj.terminate()
obj.kill()
elif isinstance(obj, io.IOBase):
try:
obj.close()
except Exception as e:
logging.debug('file %s closed failed with error: %s', obj, str(e))
else:
try:
obj.close()
except AttributeError:
try:
obj.terminate()
except AttributeError:
pass
except Exception as e:
logging.debug('Not properly caught object %s: %s', obj, str(e))
except Exception as e:
logging.debug('%s: %s', obj, str(e))
return # swallow up all error
finally:
referrers = gc.get_referrers(obj)
for _referrer in referrers:
if isinstance(_referrer, list):
for _i, val in enumerate(_referrer):
if val is obj:
_referrer[_i] = None
elif isinstance(_referrer, dict):
for key, value in _referrer.items():
if value is obj:
_referrer[key] = None
del obj
if _COUNT == 1:
res = None
try:
> res = func(*args, **kwargs)
/usr/local/lib/python3.10/site-packages/pytest_embedded/plugin.py:490:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/local/lib/python3.10/site-packages/pytest_embedded/plugin.py:1111: in serial
return serial_gn(**locals())
/usr/local/lib/python3.10/site-packages/pytest_embedded/dut_factory.py:431: in serial_gn
return cls(**_drop_none_kwargs(kwargs))
/usr/local/lib/python3.10/site-packages/pytest_embedded_arduino/serial.py:26: in __init__
super().__init__(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pytest_embedded_arduino.serial.ArduinoSerial object at 0x7f8629ccd210>
pexpect_proc = <pytest_embedded.log.PexpectProcess object at 0x7f8629cccc70>
msg_queue = <pytest_embedded.log.MessageQueue object at 0x7f8629c87dc0>
target = 'esp32h2', beta_target = None, port = None, port_mac = None
baud = 115200, esptool_baud = 921600, esp_flash_force = False
skip_autoflash = False, erase_all = False
meta = Meta(logdir='/tmp/pytest-embedded/2024-09-19_16-57-52-766268/test_timer', port_target_cache={}, port_app_cache={}, logfile_extension='.log')
ports_to_occupy = (), kwargs = {}, available_ports = ['/dev/ttyS0']
ports = ['/dev/ttyS0']
def __init__(
self,
pexpect_proc: PexpectProcess,
msg_queue: MessageQueue,
target: Optional[str] = None,
beta_target: Optional[str] = None,
port: Optional[str] = None,
port_mac: Optional[str] = None,
baud: int = Serial.DEFAULT_BAUDRATE,
esptool_baud: int = ESPTOOL_DEFAULT_BAUDRATE,
esp_flash_force: bool = False,
skip_autoflash: bool = False,
erase_all: bool = False,
meta: Optional[Meta] = None,
ports_to_occupy: List[str] = (),
**kwargs,
) -> None:
self._meta = meta
esptool_target = beta_target or target or 'auto'
if port is None or port.endswith('*'):
port_filter = port.strip('*') if port else ''
available_ports = [_p for _p in esptool.get_port_list() if port_filter in _p]
ports = list(set(available_ports) - set(self.occupied_ports.keys()) - set(ports_to_occupy))
# sort to make /dev/ttyS* ports before /dev/ttyUSB* ports
# esptool will reverse the list
ports.sort()
if port_mac:
for port in ports:
if _is_port_mac_verified(pexpect_proc, port, port_mac, msg_queue):
ports = [port]
break
else:
raise ValueError(f'The specified MAC address {port_mac} cannot be found.')
# prioritize the cache recorded target port
if esptool_target and self._meta:
ports.sort(key=lambda x: self._meta.hit_port_target_cache(x, esptool_target))
logging.debug(f'Detecting ports from {", ".join(ports)}')
else:
if port_mac:
if _is_port_mac_verified(pexpect_proc, port, port_mac, msg_queue):
ports = [port]
else:
raise ValueError(f'The specified MAC address {port_mac} binds with different port, not with {port}')
else:
ports = [port]
# normal loader
if esptool_target not in ['auto', *ESPTOOL_CHIPS]:
raise ValueError(
f'esptool version {ESPTOOL_VERSION} not support target {esptool_target}\n'
f'Supported targets: {ESPTOOL_CHIPS}'
)
with contextlib.redirect_stdout(msg_queue):
self.esp = esptool.get_default_connected_device(
ports,
port=port,
connect_attempts=3,
initial_baud=baud,
chip=esptool_target,
)
if not self.esp:
> raise ValueError('Couldn\'t auto detect chip. Please manually specify with "--port"')
E ValueError: Couldn't auto detect chip. Please manually specify with "--port"
/usr/local/lib/python3.10/site-packages/pytest_embedded_serial_esp/serial.py:118: ValueError
Check failure on line 0 in validation.uart.test_uart
github-actions / Test Results
All 4 runs with error: test_uart (validation.uart.test_uart)
./artifacts/parent-artifacts/results/hw/validation/uart/esp32/uart.xml [took 3s]
./artifacts/parent-artifacts/results/hw/validation/uart/esp32c6/uart.xml [took 3s]
./artifacts/parent-artifacts/results/hw/validation/uart/esp32h2/uart.xml [took 3s]
./artifacts/parent-artifacts/results/hw/validation/uart/esp32s2/uart.xml [took 3s]
Raw output
failed on setup with "ValueError: Couldn't auto detect chip. Please manually specify with "--port""
args = ()
kwargs = {'_fixture_classes_and_options': ClassCliOptions(classes={'app': <class 'pytest_embedded_arduino.app.ArduinoApp'>, 'se...ino.app.ArduinoApp object at 0x7fe2e13fce80>, 'msg_queue': <pytest_embedded.log.MessageQueue object at 0x7fe2e13bbeb0>}
_close_or_terminate = <function multi_dut_generator_fixture.<locals>.wrapper.<locals>._close_or_terminate at 0x7fe2e1408ee0>
res = None
@functools.wraps(func)
def wrapper(*args, **kwargs):
def _close_or_terminate(obj):
if obj is None:
del obj
return
try:
if isinstance(obj, (subprocess.Popen, multiprocessing.process.BaseProcess)):
obj.terminate()
obj.kill()
elif isinstance(obj, io.IOBase):
try:
obj.close()
except Exception as e:
logging.debug('file %s closed failed with error: %s', obj, str(e))
else:
try:
obj.close()
except AttributeError:
try:
obj.terminate()
except AttributeError:
pass
except Exception as e:
logging.debug('Not properly caught object %s: %s', obj, str(e))
except Exception as e:
logging.debug('%s: %s', obj, str(e))
return # swallow up all error
finally:
referrers = gc.get_referrers(obj)
for _referrer in referrers:
if isinstance(_referrer, list):
for _i, val in enumerate(_referrer):
if val is obj:
_referrer[_i] = None
elif isinstance(_referrer, dict):
for key, value in _referrer.items():
if value is obj:
_referrer[key] = None
del obj
if _COUNT == 1:
res = None
try:
> res = func(*args, **kwargs)
/usr/local/lib/python3.10/site-packages/pytest_embedded/plugin.py:490:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/local/lib/python3.10/site-packages/pytest_embedded/plugin.py:1111: in serial
return serial_gn(**locals())
/usr/local/lib/python3.10/site-packages/pytest_embedded/dut_factory.py:431: in serial_gn
return cls(**_drop_none_kwargs(kwargs))
/usr/local/lib/python3.10/site-packages/pytest_embedded_arduino/serial.py:26: in __init__
super().__init__(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pytest_embedded_arduino.serial.ArduinoSerial object at 0x7fe2e13fd300>
pexpect_proc = <pytest_embedded.log.PexpectProcess object at 0x7fe2e13fcd60>
msg_queue = <pytest_embedded.log.MessageQueue object at 0x7fe2e13bbeb0>
target = 'esp32', beta_target = None, port = None, port_mac = None
baud = 115200, esptool_baud = 921600, esp_flash_force = False
skip_autoflash = False, erase_all = False
meta = Meta(logdir='/tmp/pytest-embedded/2024-09-19_16-58-22-928202/test_uart', port_target_cache={}, port_app_cache={}, logfile_extension='.log')
ports_to_occupy = (), kwargs = {}, available_ports = ['/dev/ttyS0']
ports = ['/dev/ttyS0']
def __init__(
self,
pexpect_proc: PexpectProcess,
msg_queue: MessageQueue,
target: Optional[str] = None,
beta_target: Optional[str] = None,
port: Optional[str] = None,
port_mac: Optional[str] = None,
baud: int = Serial.DEFAULT_BAUDRATE,
esptool_baud: int = ESPTOOL_DEFAULT_BAUDRATE,
esp_flash_force: bool = False,
skip_autoflash: bool = False,
erase_all: bool = False,
meta: Optional[Meta] = None,
ports_to_occupy: List[str] = (),
**kwargs,
) -> None:
self._meta = meta
esptool_target = beta_target or target or 'auto'
if port is None or port.endswith('*'):
port_filter = port.strip('*') if port else ''
available_ports = [_p for _p in esptool.get_port_list() if port_filter in _p]
ports = list(set(available_ports) - set(self.occupied_ports.keys()) - set(ports_to_occupy))
# sort to make /dev/ttyS* ports before /dev/ttyUSB* ports
# esptool will reverse the list
ports.sort()
if port_mac:
for port in ports:
if _is_port_mac_verified(pexpect_proc, port, port_mac, msg_queue):
ports = [port]
break
else:
raise ValueError(f'The specified MAC address {port_mac} cannot be found.')
# prioritize the cache recorded target port
if esptool_target and self._meta:
ports.sort(key=lambda x: self._meta.hit_port_target_cache(x, esptool_target))
logging.debug(f'Detecting ports from {", ".join(ports)}')
else:
if port_mac:
if _is_port_mac_verified(pexpect_proc, port, port_mac, msg_queue):
ports = [port]
else:
raise ValueError(f'The specified MAC address {port_mac} binds with different port, not with {port}')
else:
ports = [port]
# normal loader
if esptool_target not in ['auto', *ESPTOOL_CHIPS]:
raise ValueError(
f'esptool version {ESPTOOL_VERSION} not support target {esptool_target}\n'
f'Supported targets: {ESPTOOL_CHIPS}'
)
with contextlib.redirect_stdout(msg_queue):
self.esp = esptool.get_default_connected_device(
ports,
port=port,
connect_attempts=3,
initial_baud=baud,
chip=esptool_target,
)
if not self.esp:
> raise ValueError('Couldn\'t auto detect chip. Please manually specify with "--port"')
E ValueError: Couldn't auto detect chip. Please manually specify with "--port"
/usr/local/lib/python3.10/site-packages/pytest_embedded_serial_esp/serial.py:118: ValueError
Check failure on line 0 in validation.unity.test_unity
github-actions / Test Results
All 4 runs with error: test_unity (validation.unity.test_unity)
./artifacts/parent-artifacts/results/hw/validation/unity/esp32/unity.xml [took 3s]
./artifacts/parent-artifacts/results/hw/validation/unity/esp32c6/unity.xml [took 3s]
./artifacts/parent-artifacts/results/hw/validation/unity/esp32h2/unity.xml [took 3s]
./artifacts/parent-artifacts/results/hw/validation/unity/esp32s2/unity.xml [took 3s]
Raw output
failed on setup with "ValueError: Couldn't auto detect chip. Please manually specify with "--port""
args = ()
kwargs = {'_fixture_classes_and_options': ClassCliOptions(classes={'app': <class 'pytest_embedded_arduino.app.ArduinoApp'>, 'se...ino.app.ArduinoApp object at 0x7f096aa84f10>, 'msg_queue': <pytest_embedded.log.MessageQueue object at 0x7f096aa3ff40>}
_close_or_terminate = <function multi_dut_generator_fixture.<locals>.wrapper.<locals>._close_or_terminate at 0x7f096a754ee0>
res = None
@functools.wraps(func)
def wrapper(*args, **kwargs):
def _close_or_terminate(obj):
if obj is None:
del obj
return
try:
if isinstance(obj, (subprocess.Popen, multiprocessing.process.BaseProcess)):
obj.terminate()
obj.kill()
elif isinstance(obj, io.IOBase):
try:
obj.close()
except Exception as e:
logging.debug('file %s closed failed with error: %s', obj, str(e))
else:
try:
obj.close()
except AttributeError:
try:
obj.terminate()
except AttributeError:
pass
except Exception as e:
logging.debug('Not properly caught object %s: %s', obj, str(e))
except Exception as e:
logging.debug('%s: %s', obj, str(e))
return # swallow up all error
finally:
referrers = gc.get_referrers(obj)
for _referrer in referrers:
if isinstance(_referrer, list):
for _i, val in enumerate(_referrer):
if val is obj:
_referrer[_i] = None
elif isinstance(_referrer, dict):
for key, value in _referrer.items():
if value is obj:
_referrer[key] = None
del obj
if _COUNT == 1:
res = None
try:
> res = func(*args, **kwargs)
/usr/local/lib/python3.10/site-packages/pytest_embedded/plugin.py:490:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/local/lib/python3.10/site-packages/pytest_embedded/plugin.py:1111: in serial
return serial_gn(**locals())
/usr/local/lib/python3.10/site-packages/pytest_embedded/dut_factory.py:431: in serial_gn
return cls(**_drop_none_kwargs(kwargs))
/usr/local/lib/python3.10/site-packages/pytest_embedded_arduino/serial.py:26: in __init__
super().__init__(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pytest_embedded_arduino.serial.ArduinoSerial object at 0x7f096aa85390>
pexpect_proc = <pytest_embedded.log.PexpectProcess object at 0x7f096aa84df0>
msg_queue = <pytest_embedded.log.MessageQueue object at 0x7f096aa3ff40>
target = 'esp32s2', beta_target = None, port = None, port_mac = None
baud = 115200, esptool_baud = 921600, esp_flash_force = False
skip_autoflash = False, erase_all = False
meta = Meta(logdir='/tmp/pytest-embedded/2024-09-19_17-02-10-597130/test_unity', port_target_cache={}, port_app_cache={}, logfile_extension='.log')
ports_to_occupy = (), kwargs = {}, available_ports = ['/dev/ttyS0']
ports = ['/dev/ttyS0']
def __init__(
self,
pexpect_proc: PexpectProcess,
msg_queue: MessageQueue,
target: Optional[str] = None,
beta_target: Optional[str] = None,
port: Optional[str] = None,
port_mac: Optional[str] = None,
baud: int = Serial.DEFAULT_BAUDRATE,
esptool_baud: int = ESPTOOL_DEFAULT_BAUDRATE,
esp_flash_force: bool = False,
skip_autoflash: bool = False,
erase_all: bool = False,
meta: Optional[Meta] = None,
ports_to_occupy: List[str] = (),
**kwargs,
) -> None:
self._meta = meta
esptool_target = beta_target or target or 'auto'
if port is None or port.endswith('*'):
port_filter = port.strip('*') if port else ''
available_ports = [_p for _p in esptool.get_port_list() if port_filter in _p]
ports = list(set(available_ports) - set(self.occupied_ports.keys()) - set(ports_to_occupy))
# sort to make /dev/ttyS* ports before /dev/ttyUSB* ports
# esptool will reverse the list
ports.sort()
if port_mac:
for port in ports:
if _is_port_mac_verified(pexpect_proc, port, port_mac, msg_queue):
ports = [port]
break
else:
raise ValueError(f'The specified MAC address {port_mac} cannot be found.')
# prioritize the cache recorded target port
if esptool_target and self._meta:
ports.sort(key=lambda x: self._meta.hit_port_target_cache(x, esptool_target))
logging.debug(f'Detecting ports from {", ".join(ports)}')
else:
if port_mac:
if _is_port_mac_verified(pexpect_proc, port, port_mac, msg_queue):
ports = [port]
else:
raise ValueError(f'The specified MAC address {port_mac} binds with different port, not with {port}')
else:
ports = [port]
# normal loader
if esptool_target not in ['auto', *ESPTOOL_CHIPS]:
raise ValueError(
f'esptool version {ESPTOOL_VERSION} not support target {esptool_target}\n'
f'Supported targets: {ESPTOOL_CHIPS}'
)
with contextlib.redirect_stdout(msg_queue):
self.esp = esptool.get_default_connected_device(
ports,
port=port,
connect_attempts=3,
initial_baud=baud,
chip=esptool_target,
)
if not self.esp:
> raise ValueError('Couldn\'t auto detect chip. Please manually specify with "--port"')
E ValueError: Couldn't auto detect chip. Please manually specify with "--port"
/usr/local/lib/python3.10/site-packages/pytest_embedded_serial_esp/serial.py:118: ValueError
Check warning on line 0 in validation.sleep.test_sleep
github-actions / Test Results
2 out of 6 runs failed: test_sleep (validation.sleep.test_sleep)
./artifacts/parent-artifacts/results/hw/validation/sleep/esp32c3/sleep.xml [took 52s]
./artifacts/parent-artifacts/results/hw/validation/sleep/esp32s3/sleep.xml [took 59s]
Raw output
pexpect.exceptions.TIMEOUT: Not found "Woke up from light sleep"
Bytes in current buffer (color code eliminated):
Please check the full log here: /tmp/pytest-embedded/2024-09-19_17-15-06-995373/test_sleep/dut.log
self = <pytest_embedded_serial.dut.SerialDut object at 0xb55b6f28>
pattern = 'Woke up from light sleep', expect_all = False, not_matching = ()
args = (), kwargs = {}, patterns = ['Woke up from light sleep'], res = []
debug_str = 'Not found "Woke up from light sleep"\nBytes in current buffer (color code eliminated): \nPlease check the full log here: /tmp/pytest-embedded/2024-09-19_17-15-06-995373/test_sleep/dut.log'
@functools.wraps(func)
def wrapper(
self, pattern, *args, expect_all: bool = False, not_matching: List[Union[str, re.Pattern]] = (), **kwargs
) -> Union[Union[Match, AnyStr], List[Union[Match, AnyStr]]]:
patterns = to_list(pattern)
res = []
while patterns:
try:
> index = func(self, pattern, *args, **kwargs)
/usr/local/lib/python3.10/site-packages/pytest_embedded/dut.py:76:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/local/lib/python3.10/site-packages/pytest_embedded/dut.py:153: in expect_exact
return self.pexpect_proc.expect_exact(pattern, **kwargs)
/usr/local/lib/python3.10/site-packages/pexpect/spawnbase.py:432: in expect_exact
return exp.expect_loop(timeout)
/usr/local/lib/python3.10/site-packages/pexpect/expect.py:181: in expect_loop
return self.timeout(e)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pexpect.expect.Expecter object at 0xb4d9b1c0>
err = TIMEOUT("<pytest_embedded.log.PexpectProcess object at 0xb55b6aa8>\nsearcher: searcher_string:\n 0: b'Woke up from light sleep'")
def timeout(self, err=None):
spawn = self.spawn
spawn.before = spawn._before.getvalue()
spawn.after = TIMEOUT
index = self.searcher.timeout_index
if index >= 0:
spawn.match = TIMEOUT
spawn.match_index = index
return index
else:
spawn.match = None
spawn.match_index = None
msg = str(spawn)
msg += '\nsearcher: %s' % self.searcher
if err is not None:
msg = str(err) + '\n' + msg
exc = TIMEOUT(msg)
exc.__cause__ = None # in Python 3.x we can use "raise exc from None"
> raise exc
E pexpect.exceptions.TIMEOUT: <pytest_embedded.log.PexpectProcess object at 0xb55b6aa8>
E searcher: searcher_string:
E 0: b'Woke up from light sleep'
E <pytest_embedded.log.PexpectProcess object at 0xb55b6aa8>
E searcher: searcher_string:
E 0: b'Woke up from light sleep'
/usr/local/lib/python3.10/site-packages/pexpect/expect.py:144: TIMEOUT
The above exception was the direct cause of the following exception:
dut = <pytest_embedded_serial.dut.SerialDut object at 0xb55b6f28>
def test_sleep(dut):
LOGGER = logging.getLogger(__name__)
# Deep Sleep
boot_count = 1
dut.expect_exact("Boot number: {}".format(boot_count))
dut.expect_exact("Wakeup reason: power_up")
for capability, devices in capabilities.items():
if dut.app.target in devices and capability not in ["gpio", "uart"]:
LOGGER.info("Testing {} deep sleep capability".format(capability))
boot_count += 1
dut.write("{}_deep".format(capability))
dut.expect_exact("Boot number: {}".format(boot_count))
dut.expect_exact("Wakeup reason: {}".format(capability))
# Light Sleep
for capability, devices in capabilities.items():
if dut.app.target in devices:
LOGGER.info("Testing {} light sleep capability".format(capability))
dut.write("{}_light".format(capability))
if capability == "uart":
dut.write("aaa") # Send 9 positive edges
> dut.expect_exact("Woke up from light sleep")
tests/validation/sleep/test_sleep.py:35:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pytest_embedded_serial.dut.SerialDut object at 0xb55b6f28>
pattern = 'Woke up from light sleep', expect_all = False, not_matching = ()
args = (), kwargs = {}, patterns = ['Woke up from light sleep'], res = []
debug_str = 'Not found "Woke up from light sleep"\nBytes in current buffer (color code eliminated): \nPlease check the full log here: /tmp/pytest-embedded/2024-09-19_17-15-06-995373/test_sleep/dut.log'
@functools.wraps(func)
def wrapper(
self, pattern, *args, expect_all: bool = False, not_matching: List[Union[str, re.Pattern]] = (), **kwargs
) -> Union[Union[Match, AnyStr], List[Union[Match, AnyStr]]]:
patterns = to_list(pattern)
res = []
while patterns:
try:
index = func(self, pattern, *args, **kwargs)
except (pexpect.EOF, pexpect.TIMEOUT) as e:
debug_str = (
f'Not found "{pattern!s}"\n'
f'Bytes in current buffer (color code eliminated): {self.pexpect_proc.buffer_debug_str}\n'
f'Please check the full log here: {self.logfile}'
)
> raise e.__class__(debug_str) from e
E pexpect.exceptions.TIMEOUT: Not found "Woke up from light sleep"
E Bytes in current buffer (color code eliminated):
E Please check the full log here: /tmp/pytest-embedded/2024-09-19_17-15-06-995373/test_sleep/dut.log
/usr/local/lib/python3.10/site-packages/pytest_embedded/dut.py:83: TIMEOUT
Check failure on line 0 in validation.sleep.test_sleep
github-actions / Test Results
4 out of 6 runs with error: test_sleep (validation.sleep.test_sleep)
./artifacts/parent-artifacts/results/hw/validation/sleep/esp32/sleep.xml [took 3s]
./artifacts/parent-artifacts/results/hw/validation/sleep/esp32c6/sleep.xml [took 3s]
./artifacts/parent-artifacts/results/hw/validation/sleep/esp32h2/sleep.xml [took 3s]
./artifacts/parent-artifacts/results/hw/validation/sleep/esp32s2/sleep.xml [took 3s]
Raw output
failed on setup with "ValueError: Couldn't auto detect chip. Please manually specify with "--port""
args = ()
kwargs = {'_fixture_classes_and_options': ClassCliOptions(classes={'app': <class 'pytest_embedded_arduino.app.ArduinoApp'>, 'se...ino.app.ArduinoApp object at 0x7f9d6ae40d90>, 'msg_queue': <pytest_embedded.log.MessageQueue object at 0x7f9d6adfbdc0>}
_close_or_terminate = <function multi_dut_generator_fixture.<locals>.wrapper.<locals>._close_or_terminate at 0x7f9d6ae4cee0>
res = None
@functools.wraps(func)
def wrapper(*args, **kwargs):
def _close_or_terminate(obj):
if obj is None:
del obj
return
try:
if isinstance(obj, (subprocess.Popen, multiprocessing.process.BaseProcess)):
obj.terminate()
obj.kill()
elif isinstance(obj, io.IOBase):
try:
obj.close()
except Exception as e:
logging.debug('file %s closed failed with error: %s', obj, str(e))
else:
try:
obj.close()
except AttributeError:
try:
obj.terminate()
except AttributeError:
pass
except Exception as e:
logging.debug('Not properly caught object %s: %s', obj, str(e))
except Exception as e:
logging.debug('%s: %s', obj, str(e))
return # swallow up all error
finally:
referrers = gc.get_referrers(obj)
for _referrer in referrers:
if isinstance(_referrer, list):
for _i, val in enumerate(_referrer):
if val is obj:
_referrer[_i] = None
elif isinstance(_referrer, dict):
for key, value in _referrer.items():
if value is obj:
_referrer[key] = None
del obj
if _COUNT == 1:
res = None
try:
> res = func(*args, **kwargs)
/usr/local/lib/python3.10/site-packages/pytest_embedded/plugin.py:490:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/local/lib/python3.10/site-packages/pytest_embedded/plugin.py:1111: in serial
return serial_gn(**locals())
/usr/local/lib/python3.10/site-packages/pytest_embedded/dut_factory.py:431: in serial_gn
return cls(**_drop_none_kwargs(kwargs))
/usr/local/lib/python3.10/site-packages/pytest_embedded_arduino/serial.py:26: in __init__
super().__init__(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pytest_embedded_arduino.serial.ArduinoSerial object at 0x7f9d6ae41210>
pexpect_proc = <pytest_embedded.log.PexpectProcess object at 0x7f9d6ae40c70>
msg_queue = <pytest_embedded.log.MessageQueue object at 0x7f9d6adfbdc0>
target = 'esp32h2', beta_target = None, port = None, port_mac = None
baud = 115200, esptool_baud = 921600, esp_flash_force = False
skip_autoflash = False, erase_all = False
meta = Meta(logdir='/tmp/pytest-embedded/2024-09-19_16-57-37-320474/test_sleep', port_target_cache={}, port_app_cache={}, logfile_extension='.log')
ports_to_occupy = (), kwargs = {}, available_ports = ['/dev/ttyS0']
ports = ['/dev/ttyS0']
def __init__(
self,
pexpect_proc: PexpectProcess,
msg_queue: MessageQueue,
target: Optional[str] = None,
beta_target: Optional[str] = None,
port: Optional[str] = None,
port_mac: Optional[str] = None,
baud: int = Serial.DEFAULT_BAUDRATE,
esptool_baud: int = ESPTOOL_DEFAULT_BAUDRATE,
esp_flash_force: bool = False,
skip_autoflash: bool = False,
erase_all: bool = False,
meta: Optional[Meta] = None,
ports_to_occupy: List[str] = (),
**kwargs,
) -> None:
self._meta = meta
esptool_target = beta_target or target or 'auto'
if port is None or port.endswith('*'):
port_filter = port.strip('*') if port else ''
available_ports = [_p for _p in esptool.get_port_list() if port_filter in _p]
ports = list(set(available_ports) - set(self.occupied_ports.keys()) - set(ports_to_occupy))
# sort to make /dev/ttyS* ports before /dev/ttyUSB* ports
# esptool will reverse the list
ports.sort()
if port_mac:
for port in ports:
if _is_port_mac_verified(pexpect_proc, port, port_mac, msg_queue):
ports = [port]
break
else:
raise ValueError(f'The specified MAC address {port_mac} cannot be found.')
# prioritize the cache recorded target port
if esptool_target and self._meta:
ports.sort(key=lambda x: self._meta.hit_port_target_cache(x, esptool_target))
logging.debug(f'Detecting ports from {", ".join(ports)}')
else:
if port_mac:
if _is_port_mac_verified(pexpect_proc, port, port_mac, msg_queue):
ports = [port]
else:
raise ValueError(f'The specified MAC address {port_mac} binds with different port, not with {port}')
else:
ports = [port]
# normal loader
if esptool_target not in ['auto', *ESPTOOL_CHIPS]:
raise ValueError(
f'esptool version {ESPTOOL_VERSION} not support target {esptool_target}\n'
f'Supported targets: {ESPTOOL_CHIPS}'
)
with contextlib.redirect_stdout(msg_queue):
self.esp = esptool.get_default_connected_device(
ports,
port=port,
connect_attempts=3,
initial_baud=baud,
chip=esptool_target,
)
if not self.esp:
> raise ValueError('Couldn\'t auto detect chip. Please manually specify with "--port"')
E ValueError: Couldn't auto detect chip. Please manually specify with "--port"
/usr/local/lib/python3.10/site-packages/pytest_embedded_serial_esp/serial.py:118: ValueError
Check failure on line 0 in validation.touch.test_touch
github-actions / Test Results
All 2 runs with error: test_touch (validation.touch.test_touch)
./artifacts/parent-artifacts/results/hw/validation/touch/esp32/touch.xml [took 3s]
./artifacts/parent-artifacts/results/hw/validation/touch/esp32s2/touch.xml [took 3s]
Raw output
failed on setup with "ValueError: Couldn't auto detect chip. Please manually specify with "--port""
args = ()
kwargs = {'_fixture_classes_and_options': ClassCliOptions(classes={'app': <class 'pytest_embedded_arduino.app.ArduinoApp'>, 'se...ino.app.ArduinoApp object at 0x7fa2df14cdf0>, 'msg_queue': <pytest_embedded.log.MessageQueue object at 0x7fa2df107e20>}
_close_or_terminate = <function multi_dut_generator_fixture.<locals>.wrapper.<locals>._close_or_terminate at 0x7fa2df158ee0>
res = None
@functools.wraps(func)
def wrapper(*args, **kwargs):
def _close_or_terminate(obj):
if obj is None:
del obj
return
try:
if isinstance(obj, (subprocess.Popen, multiprocessing.process.BaseProcess)):
obj.terminate()
obj.kill()
elif isinstance(obj, io.IOBase):
try:
obj.close()
except Exception as e:
logging.debug('file %s closed failed with error: %s', obj, str(e))
else:
try:
obj.close()
except AttributeError:
try:
obj.terminate()
except AttributeError:
pass
except Exception as e:
logging.debug('Not properly caught object %s: %s', obj, str(e))
except Exception as e:
logging.debug('%s: %s', obj, str(e))
return # swallow up all error
finally:
referrers = gc.get_referrers(obj)
for _referrer in referrers:
if isinstance(_referrer, list):
for _i, val in enumerate(_referrer):
if val is obj:
_referrer[_i] = None
elif isinstance(_referrer, dict):
for key, value in _referrer.items():
if value is obj:
_referrer[key] = None
del obj
if _COUNT == 1:
res = None
try:
> res = func(*args, **kwargs)
/usr/local/lib/python3.10/site-packages/pytest_embedded/plugin.py:490:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/local/lib/python3.10/site-packages/pytest_embedded/plugin.py:1111: in serial
return serial_gn(**locals())
/usr/local/lib/python3.10/site-packages/pytest_embedded/dut_factory.py:431: in serial_gn
return cls(**_drop_none_kwargs(kwargs))
/usr/local/lib/python3.10/site-packages/pytest_embedded_arduino/serial.py:26: in __init__
super().__init__(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pytest_embedded_arduino.serial.ArduinoSerial object at 0x7fa2df14d270>
pexpect_proc = <pytest_embedded.log.PexpectProcess object at 0x7fa2df14ccd0>
msg_queue = <pytest_embedded.log.MessageQueue object at 0x7fa2df107e20>
target = 'esp32s2', beta_target = None, port = None, port_mac = None
baud = 115200, esptool_baud = 921600, esp_flash_force = False
skip_autoflash = False, erase_all = False
meta = Meta(logdir='/tmp/pytest-embedded/2024-09-19_17-01-39-685538/test_touch', port_target_cache={}, port_app_cache={}, logfile_extension='.log')
ports_to_occupy = (), kwargs = {}, available_ports = ['/dev/ttyS0']
ports = ['/dev/ttyS0']
def __init__(
self,
pexpect_proc: PexpectProcess,
msg_queue: MessageQueue,
target: Optional[str] = None,
beta_target: Optional[str] = None,
port: Optional[str] = None,
port_mac: Optional[str] = None,
baud: int = Serial.DEFAULT_BAUDRATE,
esptool_baud: int = ESPTOOL_DEFAULT_BAUDRATE,
esp_flash_force: bool = False,
skip_autoflash: bool = False,
erase_all: bool = False,
meta: Optional[Meta] = None,
ports_to_occupy: List[str] = (),
**kwargs,
) -> None:
self._meta = meta
esptool_target = beta_target or target or 'auto'
if port is None or port.endswith('*'):
port_filter = port.strip('*') if port else ''
available_ports = [_p for _p in esptool.get_port_list() if port_filter in _p]
ports = list(set(available_ports) - set(self.occupied_ports.keys()) - set(ports_to_occupy))
# sort to make /dev/ttyS* ports before /dev/ttyUSB* ports
# esptool will reverse the list
ports.sort()
if port_mac:
for port in ports:
if _is_port_mac_verified(pexpect_proc, port, port_mac, msg_queue):
ports = [port]
break
else:
raise ValueError(f'The specified MAC address {port_mac} cannot be found.')
# prioritize the cache recorded target port
if esptool_target and self._meta:
ports.sort(key=lambda x: self._meta.hit_port_target_cache(x, esptool_target))
logging.debug(f'Detecting ports from {", ".join(ports)}')
else:
if port_mac:
if _is_port_mac_verified(pexpect_proc, port, port_mac, msg_queue):
ports = [port]
else:
raise ValueError(f'The specified MAC address {port_mac} binds with different port, not with {port}')
else:
ports = [port]
# normal loader
if esptool_target not in ['auto', *ESPTOOL_CHIPS]:
raise ValueError(
f'esptool version {ESPTOOL_VERSION} not support target {esptool_target}\n'
f'Supported targets: {ESPTOOL_CHIPS}'
)
with contextlib.redirect_stdout(msg_queue):
self.esp = esptool.get_default_connected_device(
ports,
port=port,
connect_attempts=3,
initial_baud=baud,
chip=esptool_target,
)
if not self.esp:
> raise ValueError('Couldn\'t auto detect chip. Please manually specify with "--port"')
E ValueError: Couldn't auto detect chip. Please manually specify with "--port"
/usr/local/lib/python3.10/site-packages/pytest_embedded_serial_esp/serial.py:118: ValueError
Check failure on line 0 in validation.cpu_misc.test_cpu_misc
github-actions / Test Results
All 4 runs with error: test_cpu_misc (validation.cpu_misc.test_cpu_misc)
./artifacts/parent-artifacts/results/hw/validation/cpu_misc/esp32/cpu_misc.xml [took 3s]
./artifacts/parent-artifacts/results/hw/validation/cpu_misc/esp32c6/cpu_misc.xml [took 3s]
./artifacts/parent-artifacts/results/hw/validation/cpu_misc/esp32h2/cpu_misc.xml [took 3s]
./artifacts/parent-artifacts/results/hw/validation/cpu_misc/esp32s2/cpu_misc.xml [took 3s]
Raw output
failed on setup with "ValueError: Couldn't auto detect chip. Please manually specify with "--port""
args = ()
kwargs = {'_fixture_classes_and_options': ClassCliOptions(classes={'app': <class 'pytest_embedded_arduino.app.ArduinoApp'>, 'se...ino.app.ArduinoApp object at 0x7f730e74cbb0>, 'msg_queue': <pytest_embedded.log.MessageQueue object at 0x7f730e707be0>}
_close_or_terminate = <function multi_dut_generator_fixture.<locals>.wrapper.<locals>._close_or_terminate at 0x7f730e41cee0>
res = None
@functools.wraps(func)
def wrapper(*args, **kwargs):
def _close_or_terminate(obj):
if obj is None:
del obj
return
try:
if isinstance(obj, (subprocess.Popen, multiprocessing.process.BaseProcess)):
obj.terminate()
obj.kill()
elif isinstance(obj, io.IOBase):
try:
obj.close()
except Exception as e:
logging.debug('file %s closed failed with error: %s', obj, str(e))
else:
try:
obj.close()
except AttributeError:
try:
obj.terminate()
except AttributeError:
pass
except Exception as e:
logging.debug('Not properly caught object %s: %s', obj, str(e))
except Exception as e:
logging.debug('%s: %s', obj, str(e))
return # swallow up all error
finally:
referrers = gc.get_referrers(obj)
for _referrer in referrers:
if isinstance(_referrer, list):
for _i, val in enumerate(_referrer):
if val is obj:
_referrer[_i] = None
elif isinstance(_referrer, dict):
for key, value in _referrer.items():
if value is obj:
_referrer[key] = None
del obj
if _COUNT == 1:
res = None
try:
> res = func(*args, **kwargs)
/usr/local/lib/python3.10/site-packages/pytest_embedded/plugin.py:490:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/local/lib/python3.10/site-packages/pytest_embedded/plugin.py:1111: in serial
return serial_gn(**locals())
/usr/local/lib/python3.10/site-packages/pytest_embedded/dut_factory.py:431: in serial_gn
return cls(**_drop_none_kwargs(kwargs))
/usr/local/lib/python3.10/site-packages/pytest_embedded_arduino/serial.py:26: in __init__
super().__init__(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pytest_embedded_arduino.serial.ArduinoSerial object at 0x7f730e74d030>
pexpect_proc = <pytest_embedded.log.PexpectProcess object at 0x7f730e74ca90>
msg_queue = <pytest_embedded.log.MessageQueue object at 0x7f730e707be0>
target = 'esp32s2', beta_target = None, port = None, port_mac = None
baud = 115200, esptool_baud = 921600, esp_flash_force = False
skip_autoflash = False, erase_all = False
meta = Meta(logdir='/tmp/pytest-embedded/2024-09-19_16-59-35-513816/test_cpu_misc', port_target_cache={}, port_app_cache={}, logfile_extension='.log')
ports_to_occupy = (), kwargs = {}, available_ports = ['/dev/ttyS0']
ports = ['/dev/ttyS0']
def __init__(
self,
pexpect_proc: PexpectProcess,
msg_queue: MessageQueue,
target: Optional[str] = None,
beta_target: Optional[str] = None,
port: Optional[str] = None,
port_mac: Optional[str] = None,
baud: int = Serial.DEFAULT_BAUDRATE,
esptool_baud: int = ESPTOOL_DEFAULT_BAUDRATE,
esp_flash_force: bool = False,
skip_autoflash: bool = False,
erase_all: bool = False,
meta: Optional[Meta] = None,
ports_to_occupy: List[str] = (),
**kwargs,
) -> None:
self._meta = meta
esptool_target = beta_target or target or 'auto'
if port is None or port.endswith('*'):
port_filter = port.strip('*') if port else ''
available_ports = [_p for _p in esptool.get_port_list() if port_filter in _p]
ports = list(set(available_ports) - set(self.occupied_ports.keys()) - set(ports_to_occupy))
# sort to make /dev/ttyS* ports before /dev/ttyUSB* ports
# esptool will reverse the list
ports.sort()
if port_mac:
for port in ports:
if _is_port_mac_verified(pexpect_proc, port, port_mac, msg_queue):
ports = [port]
break
else:
raise ValueError(f'The specified MAC address {port_mac} cannot be found.')
# prioritize the cache recorded target port
if esptool_target and self._meta:
ports.sort(key=lambda x: self._meta.hit_port_target_cache(x, esptool_target))
logging.debug(f'Detecting ports from {", ".join(ports)}')
else:
if port_mac:
if _is_port_mac_verified(pexpect_proc, port, port_mac, msg_queue):
ports = [port]
else:
raise ValueError(f'The specified MAC address {port_mac} binds with different port, not with {port}')
else:
ports = [port]
# normal loader
if esptool_target not in ['auto', *ESPTOOL_CHIPS]:
raise ValueError(
f'esptool version {ESPTOOL_VERSION} not support target {esptool_target}\n'
f'Supported targets: {ESPTOOL_CHIPS}'
)
with contextlib.redirect_stdout(msg_queue):
self.esp = esptool.get_default_connected_device(
ports,
port=port,
connect_attempts=3,
initial_baud=baud,
chip=esptool_target,
)
if not self.esp:
> raise ValueError('Couldn\'t auto detect chip. Please manually specify with "--port"')
E ValueError: Couldn't auto detect chip. Please manually specify with "--port"
/usr/local/lib/python3.10/site-packages/pytest_embedded_serial_esp/serial.py:118: ValueError
Check notice on line 0 in .github
github-actions / Test Results
32 tests found
There are 32 tests, see "Raw output" for the full list of tests.
Raw output
auto_baudrate_test
basic_transmission_test
begin_when_running_test
change_baudrate_test
change_cpu_frequency_test
change_pins_test
disabled_uart_calls_test
enabled_uart_calls_test
end_when_stopped_test
get_cpu_temperature
periman_test
resize_buffers_test
test_fail
test_pass
test_touch_errors
test_touch_interrtupt
test_touch_read
timer_clock_select_test
timer_divider_test
timer_interrupt_test
timer_read_test
validation.cpu_misc.test_cpu_misc ‑ test_cpu_misc
validation.democfg.test_democfg ‑ test_cfg
validation.hello_world.test_hello_world ‑ test_hello_world
validation.nvs.test_nvs ‑ test_nvs
validation.periman.test_periman ‑ test_periman
validation.sleep.test_sleep ‑ test_sleep
validation.timer.test_timer ‑ test_timer
validation.touch.test_touch ‑ test_touch
validation.uart.test_uart ‑ test_uart
validation.unity.test_unity ‑ test_unity
validation.wifi.test_wifi ‑ test_wifi