From 390b9268db0539e79fd0f38242d564417c9367b5 Mon Sep 17 00:00:00 2001 From: alberto-abarzua Date: Thu, 7 Dec 2023 22:06:03 -0300 Subject: [PATCH] chore: update docs --- README.md | 2 +- arm_docs/docs/introduction/installation.md | 2 +- controller/pyproject.toml | 2 +- controller/src/ribot/tests/test_controller.py | 2 +- manage.py | 18 +++++++++--------- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 30c8d4e9..68ad4cd1 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ Welcome to the Ribot project, your comprehensive solution for controlling roboti - Python 3.8 or higher - ESPTool Python package for firmware flashing (Required, if using Docker): ```bash - pip install esptool + pip install esptool toml ``` - Alternatively, you can use your own install of ESP IDF (v5.1.1) for manual firmware flashing. diff --git a/arm_docs/docs/introduction/installation.md b/arm_docs/docs/introduction/installation.md index 9cdf7fa1..d092d3b2 100644 --- a/arm_docs/docs/introduction/installation.md +++ b/arm_docs/docs/introduction/installation.md @@ -18,7 +18,7 @@ Before installing RiBot, ensure that your system meets the following prerequisit - **ESPtool**: This is a Python library needed for flashing the ESP32 microcontroller. Install it using the following command in your terminal: ```bash - pip install esptool + pip install esptool toml ``` ## Steps to Install RiBot diff --git a/controller/pyproject.toml b/controller/pyproject.toml index 0eb6ec60..add956c0 100644 --- a/controller/pyproject.toml +++ b/controller/pyproject.toml @@ -48,7 +48,7 @@ isort = "isort src" black = "black src" pure_lint = "flake8 src" type_check = "mypy src" -test = "python -m unittest discover -s src/ribot/tests -p 'test_*.py'" +test = "python -m unittest discover -s src/ribot/tests -p 'test_*.py' -v" format = {composite = ["isort", "black"]} lint = {composite = ["pure_lint", "type_check"]} main = "python src/ribot/sample_main.py" diff --git a/controller/src/ribot/tests/test_controller.py b/controller/src/ribot/tests/test_controller.py index deca47ed..2fd3ff17 100644 --- a/controller/src/ribot/tests/test_controller.py +++ b/controller/src/ribot/tests/test_controller.py @@ -221,7 +221,7 @@ def test_speed_with_modified_settings(self) -> None: self.controller.set_setting_joints(Settings.STEPS_PER_REV_MOTOR_AXIS, 800) self.controller.set_setting_joints(Settings.STEPS_PER_REV_MOTOR_AXIS, 800) - self.controller.set_setting_joint(Settings.STEPS_PER_REV_MOTOR_AXIS, 1600, 0) + self.controller.set_setting_joint(Settings.STEPS_PER_REV_MOTOR_AXIS, 1000, 0) self.controller.set_setting_joint(Settings.STEPS_PER_REV_MOTOR_AXIS, 200, 3) self.controller.set_setting_joints(Settings.HOMING_OFFSET_RADS, 0) diff --git a/manage.py b/manage.py index eb8344e1..ec157ada 100755 --- a/manage.py +++ b/manage.py @@ -1,5 +1,6 @@ #!/usr/bin/env python3 +from sys import stdout import time import argparse import subprocess @@ -88,16 +89,14 @@ def dc_run(self, service_name: str, command: str, env={}, service_ports_and_alia new_command.extend(command_list) try: - if mute: - return subprocess.run(new_command, env={**os.environ, **env}, check=True, - stdout=subprocess.PIPE, stderr=subprocess.STDOUT) - else: - return subprocess.check_call(new_command, env={**os.environ, **env}) + result = subprocess.run(new_command, env={**os.environ, **env}, check=True, + stderr=subprocess.PIPE) + print(result.stderr.decode('utf-8')) + return result.returncode except subprocess.CalledProcessError as e: - if mute: - print("Command failed with the following output:") - print(e.stdout.decode('utf-8')) - raise + print("Command failed with the following output:") + print(e.output.decode('utf-8')) # Output includes both stdout and stderr + return e.returncode def dc_up(self, files: List[str], env: dict = {}, detached=False): @@ -424,6 +423,7 @@ def test_no_debug(self, **_): self.build_firmware() self.docker_manager.dc_up(['firmware.yaml'], env={ "ESP_CONTROLLER_SERVER_HOST": "controller"}, detached=True) + exit_code = self.docker_manager.dc_run('controller.yaml', 'controller pdm run test', service_ports_and_aliases=True)