Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix humble devel tests after package migration #33

Merged

Conversation

leandropineda
Copy link
Member

@leandropineda leandropineda commented Dec 22, 2022

Problem description

After upgrading from galactic to humble (see #31) pep257 and pep8 tests started to fail. The reason why the same tests didn't fail on galactic-devel is not clear. Is suspect that changes on mayor versions for pytest packages between ubuntu 20.04 and 22.04 is what is causing it.

Pytest version and plugins

Galactic

platform linux -- Python 3.8.10, pytest-4.6.9, py-1.8.1, pluggy-0.13.0 -- /usr/bin/python3
cachedir: .pytest_cache
rootdir: /home/docker/dev_ws
plugins: launch-testing-0.17.1, ament-copyright-0.10.7, launch-testing-ros-0.14.3,
         ament-flake8-0.10.7, ament-pep257-0.10.7, ament-xmllint-0.10.7,
         ament-lint-0.10.7, ament-mypy-0.10.7, colcon-core-0.11.0

Humble

platform linux -- Python 3.10.6, pytest-6.2.5, py-1.10.0, pluggy-0.13.0 -- /usr/bin/python3
cachedir: .pytest_cache
rootdir: /home/docker/dev_ws
plugins: ament-xmllint-0.12.4, ament-lint-0.12.4, ament-flake8-0.12.4,
         ament-pep257-0.12.4, ament-copyright-0.12.4, launch-testing-1.0.3,
         launch-testing-ros-0.19.3, ament-mypy-0.12.4, colcon-core-0.11.0

Changes

  • Fixed pep257 & flake8 linting errors
  • Refactored docstrings on all python files to use the same format
  • Added Dockerfile for local development

Demo

Errors before

docker@ros_amr_interop:~/dev_ws$ colcon test --packages-select vda5050_connector && colcon test-result --verbose
Starting >>> vda5050_connector
[Processing: vda5050_connector]                   
--- stderr: vda5050_connector                     
Errors while running CTest
Output from these tests are in: /home/docker/dev_ws/build/vda5050_connector/Testing/Temporary/LastTest.log
Use "--rerun-failed --output-on-failure" to re-run the failed cases verbosely.
---
Finished <<< vda5050_connector [53.1s]  [ with test failures ]

Summary: 1 package finished [53.6s]
  1 package had stderr output: vda5050_connector
  1 package had test failures: vda5050_connector
build/vda5050_connector/Testing/20221222-1420/Test.xml: 36 tests, 0 errors, 2 failures, 0 skipped
- flake8
  <<< failure message
    -- run_test.py: invoking following command in '/home/docker/dev_ws/src/vda5050_connector':
     - /opt/ros/humble/bin/ament_flake8 --xunit-file /home/docker/dev_ws/build/vda5050_connector/test_results/vda5050_connector/flake8.xunit.xml --config /home/docker/dev_ws/src/vda5050_connector/.flake8
    # Script link: https://github.com/ros-planning/navigation2/blob/main/nav2_common/nav2_common/launch/rewritten_yaml.py
                                                                                                       ^
    1     E501 line too long (117 > 99 characters)
    
    ./vda5050_connector_py/rewritten_yaml.py:16:100: E501 line too long (117 > 99 characters)
    
    
    18 files checked
    1 errors
    
    'E'-type errors: 1
    
    Checked files:
    
    * ./scripts/mqtt_bridge.py
    * ./scripts/vda5050_controller.py
    * ./docs/source/conf.py
    * ./launch/controller.launch.py
    * ./launch/mqtt_bridge.launch.py
    * ./vda5050_connector_py/mqtt_bridge.py
    * ./vda5050_connector_py/rewritten_yaml.py
    * ./vda5050_connector_py/utils.py
    * ./vda5050_connector_py/vda5050_controller.py
    * ./vda5050_connector_py/__init__.py
    * ./test/test_vda5050_controller.py
    * ./test/test_vda5050_mqtt_bridge.py
    * ./test/test_copyright.py
    * ./test/conftest.py
    * ./test/test_vda5050_controller_actions.py
    * ./test/test_pep257.py
    * ./test/test_utils.py
    * ./test/test_flake8.py
    -- run_test.py: return code 1
    -- run_test.py: verify result file '/home/docker/dev_ws/build/vda5050_connector/test_results/vda5050_connector/flake8.xunit.xml'
  >>>
- pep257
  <<< failure message
    -- run_test.py: invoking following command in '/home/docker/dev_ws/src/vda5050_connector':
     - /opt/ros/humble/bin/ament_pep257 --xunit-file /home/docker/dev_ws/build/vda5050_connector/test_results/vda5050_connector/pep257.xunit.xml
    checking ./docs/source/conf.py
    checking ./launch/controller.launch.py
    checking ./launch/mqtt_bridge.launch.py
    checking ./scripts/mqtt_bridge.py
    checking ./scripts/vda5050_controller.py
    checking ./test/conftest.py
    checking ./test/test_copyright.py
    checking ./test/test_flake8.py
    checking ./test/test_pep257.py
    checking ./test/test_utils.py
    checking ./test/test_vda5050_controller.py
    checking ./test/test_vda5050_controller_actions.py
    checking ./test/test_vda5050_mqtt_bridge.py
    checking ./vda5050_connector_py/__init__.py
    checking ./vda5050_connector_py/mqtt_bridge.py
    ./vda5050_connector_py/mqtt_bridge.py:147 in public function `generate_vda_instant_action_msg`: D416: Section name should end with a colon ('Arguments:', not 'Arguments')
    ./vda5050_connector_py/mqtt_bridge.py:147 in public function `generate_vda_instant_action_msg`: D417: Missing argument descriptions in the docstring (argument(s) instant_action are missing descriptions in 'generate_vda_instant_action_msg' docstring)
    ./vda5050_connector_py/mqtt_bridge.py:147 in public function `generate_vda_instant_action_msg`: D409: Section underline should match the length of its name (Expected 6 dashes in section 'Return', got 7)
    ./vda5050_connector_py/mqtt_bridge.py:147 in public function `generate_vda_instant_action_msg`: D416: Section name should end with a colon ('Return:', not 'Return')
    ./vda5050_connector_py/mqtt_bridge.py:440 in private method `_publish_to_topic`: D413: Missing blank line after last section ('Arguments')
    ./vda5050_connector_py/mqtt_bridge.py:440 in private method `_publish_to_topic`: D416: Section name should end with a colon ('Arguments:', not 'Arguments')
    ./vda5050_connector_py/mqtt_bridge.py:440 in private method `_publish_to_topic`: D417: Missing argument descriptions in the docstring (argument(s) msg, topic are missing descriptions in '_publish_to_topic' docstring)
    ./vda5050_connector_py/mqtt_bridge.py:453 in private method `_publish_state`: D413: Missing blank line after last section ('Arguments')
    ./vda5050_connector_py/mqtt_bridge.py:453 in private method `_publish_state`: D416: Section name should end with a colon ('Arguments:', not 'Arguments')
    ./vda5050_connector_py/mqtt_bridge.py:453 in private method `_publish_state`: D417: Missing argument descriptions in the docstring (argument(s) msg are missing descriptions in '_publish_state' docstring)
    ./vda5050_connector_py/mqtt_bridge.py:468 in private method `_publish_connection`: D413: Missing blank line after last section ('Arguments')
    ./vda5050_connector_py/mqtt_bridge.py:468 in private method `_publish_connection`: D416: Section name should end with a colon ('Arguments:', not 'Arguments')
    ./vda5050_connector_py/mqtt_bridge.py:468 in private method `_publish_connection`: D417: Missing argument descriptions in the docstring (argument(s) msg are missing descriptions in '_publish_connection' docstring)
    ./vda5050_connector_py/mqtt_bridge.py:489 in private method `_publish_visualization`: D413: Missing blank line after last section ('Arguments')
    ./vda5050_connector_py/mqtt_bridge.py:489 in private method `_publish_visualization`: D416: Section name should end with a colon ('Arguments:', not 'Arguments')
    ./vda5050_connector_py/mqtt_bridge.py:489 in private method `_publish_visualization`: D417: Missing argument descriptions in the docstring (argument(s) msg are missing descriptions in '_publish_visualization' docstring)
    checking ./vda5050_connector_py/rewritten_yaml.py
    checking ./vda5050_connector_py/utils.py
    ./vda5050_connector_py/utils.py:117 in public function `json_camel_to_snake_case`: D407: Missing dashed underline after section ('Args')
    ./vda5050_connector_py/utils.py:152 in public function `json_snake_to_camel_case`: D416: Section name should end with a colon ('Args:', not 'Args')
    checking ./vda5050_connector_py/vda5050_controller.py
    ./vda5050_connector_py/vda5050_controller.py:409 in private method `_update_state`: D416: Section name should end with a colon ('Args:', not 'Args')
    ./vda5050_connector_py/vda5050_controller.py:543 in private method `_update_action_status`: D416: Section name should end with a colon ('Args:', not 'Args')
    ./vda5050_connector_py/vda5050_controller.py:596 in public method `get_state_from_adapter`: D416: Section name should end with a colon ('Args:', not 'Args')
    ./vda5050_connector_py/vda5050_controller.py:618 in private method `_get_state_from_adapter_callback`: D416: Section name should end with a colon ('Args:', not 'Args')
    ./vda5050_connector_py/vda5050_controller.py:633 in private method `_update_state_from_adapter`: D416: Section name should end with a colon ('Args:', not 'Args')
    ./vda5050_connector_py/vda5050_controller.py:669 in public method `process_instant_actions`: D416: Section name should end with a colon ('Args:', not 'Args')
    ./vda5050_connector_py/vda5050_controller.py:669 in public method `process_instant_actions`: D417: Missing argument descriptions in the docstring (argument(s) instant_actions are missing descriptions in 'process_instant_actions' docstring)
    ./vda5050_connector_py/vda5050_controller.py:742 in public method `send_adapter_process_vda_action`: D416: Section name should end with a colon ('Args:', not 'Args')
    ./vda5050_connector_py/vda5050_controller.py:775 in private method `_process_vda_action_goal_response_callback`: D416: Section name should end with a colon ('Args:', not 'Args')
    ./vda5050_connector_py/vda5050_controller.py:805 in private method `_process_vda_action_feedback_callback`: D416: Section name should end with a colon ('Args:', not 'Args')
    ./vda5050_connector_py/vda5050_controller.py:818 in private method `_process_vda_action_result_callback`: D413: Missing blank line after last section ('Args')
    ./vda5050_connector_py/vda5050_controller.py:818 in private method `_process_vda_action_result_callback`: D416: Section name should end with a colon ('Args:', not 'Args')
    ./vda5050_connector_py/vda5050_controller.py:834 in public method `process_order`: D416: Section name should end with a colon ('Args:', not 'Args')
    ./vda5050_connector_py/vda5050_controller.py:834 in public method `process_order`: D417: Missing argument descriptions in the docstring (argument(s) order are missing descriptions in 'process_order' docstring)
    ./vda5050_connector_py/vda5050_controller.py:955 in private method `_first_node_in_deviation_range`: D416: Section name should end with a colon ('Args:', not 'Args')
    ./vda5050_connector_py/vda5050_controller.py:955 in private method `_first_node_in_deviation_range`: D413: Missing blank line after last section ('Return')
    ./vda5050_connector_py/vda5050_controller.py:955 in private method `_first_node_in_deviation_range`: D416: Section name should end with a colon ('Return:', not 'Return')
    ./vda5050_connector_py/vda5050_controller.py:993 in private method `_accept_order`: D413: Missing blank line after last section ('Args')
    ./vda5050_connector_py/vda5050_controller.py:993 in private method `_accept_order`: D416: Section name should end with a colon ('Args:', not 'Args')
    ./vda5050_connector_py/vda5050_controller.py:1079 in private method `_reject_order`: D416: Section name should end with a colon ('Args:', not 'Args')
    ./vda5050_connector_py/vda5050_controller.py:1079 in private method `_reject_order`: D417: Missing argument descriptions in the docstring (argument(s) description are missing descriptions in '_reject_order' docstring)
    ./vda5050_connector_py/vda5050_controller.py:1229 in private method `_process_node`: D416: Section name should end with a colon ('Args:', not 'Args')
    ./vda5050_connector_py/vda5050_controller.py:1336 in public method `send_adapter_navigate_to_node`: D416: Section name should end with a colon ('Args:', not 'Args')
    ./vda5050_connector_py/vda5050_controller.py:1361 in private method `_navigate_to_node_goal_response_callback`: D416: Section name should end with a colon ('Args:', not 'Args')
    ./vda5050_connector_py/vda5050_controller.py:1383 in private method `_navigate_to_node_result_callback`: D416: Section name should end with a colon ('Args:', not 'Args')
    43 errors
    -- run_test.py: return code 1
    -- run_test.py: verify result file '/home/docker/dev_ws/build/vda5050_connector/test_results/vda5050_connector/pep257.xunit.xml'
  >>>
build/vda5050_connector/test_results/vda5050_connector/flake8.xunit.xml: 1 test, 0 errors, 1 failure, 0 skipped
- vda5050_connector.flake8 E501 (./vda5050_connector_py/rewritten_yaml.py:16:100)
  <<< failure message
    line too long (117 > 99 characters):
    # Script link: https://github.com/ros-planning/navigation2/blob/main/nav2_common/nav2_common/launch/rewritten_yaml.py
  >>>
build/vda5050_connector/test_results/vda5050_connector/pep257.xunit.xml: 58 tests, 0 errors, 43 failures, 0 skipped
- vda5050_connector.pep257 D416 (./vda5050_connector_py/mqtt_bridge.py:147)
  <<< failure message
    D416: Section name should end with a colon ('Arguments:', not 'Arguments')
  >>>
- vda5050_connector.pep257 D417 (./vda5050_connector_py/mqtt_bridge.py:147)
  <<< failure message
    D417: Missing argument descriptions in the docstring (argument(s) instant_action are missing descriptions in 'generate_vda_instant_action_msg' docstring)
  >>>
- vda5050_connector.pep257 D409 (./vda5050_connector_py/mqtt_bridge.py:147)
  <<< failure message
    D409: Section underline should match the length of its name (Expected 6 dashes in section 'Return', got 7)
  >>>
- vda5050_connector.pep257 D416 (./vda5050_connector_py/mqtt_bridge.py:147)
  <<< failure message
    D416: Section name should end with a colon ('Return:', not 'Return')
  >>>
- vda5050_connector.pep257 D413 (./vda5050_connector_py/mqtt_bridge.py:440)
  <<< failure message
    D413: Missing blank line after last section ('Arguments')
  >>>
- vda5050_connector.pep257 D416 (./vda5050_connector_py/mqtt_bridge.py:440)
  <<< failure message
    D416: Section name should end with a colon ('Arguments:', not 'Arguments')
  >>>
- vda5050_connector.pep257 D417 (./vda5050_connector_py/mqtt_bridge.py:440)
  <<< failure message
    D417: Missing argument descriptions in the docstring (argument(s) msg, topic are missing descriptions in '_publish_to_topic' docstring)
  >>>
- vda5050_connector.pep257 D413 (./vda5050_connector_py/mqtt_bridge.py:453)
  <<< failure message
    D413: Missing blank line after last section ('Arguments')
  >>>
- vda5050_connector.pep257 D416 (./vda5050_connector_py/mqtt_bridge.py:453)
  <<< failure message
    D416: Section name should end with a colon ('Arguments:', not 'Arguments')
  >>>
- vda5050_connector.pep257 D417 (./vda5050_connector_py/mqtt_bridge.py:453)
  <<< failure message
    D417: Missing argument descriptions in the docstring (argument(s) msg are missing descriptions in '_publish_state' docstring)
  >>>
- vda5050_connector.pep257 D413 (./vda5050_connector_py/mqtt_bridge.py:468)
  <<< failure message
    D413: Missing blank line after last section ('Arguments')
  >>>
- vda5050_connector.pep257 D416 (./vda5050_connector_py/mqtt_bridge.py:468)
  <<< failure message
    D416: Section name should end with a colon ('Arguments:', not 'Arguments')
  >>>
- vda5050_connector.pep257 D417 (./vda5050_connector_py/mqtt_bridge.py:468)
  <<< failure message
    D417: Missing argument descriptions in the docstring (argument(s) msg are missing descriptions in '_publish_connection' docstring)
  >>>
- vda5050_connector.pep257 D413 (./vda5050_connector_py/mqtt_bridge.py:489)
  <<< failure message
    D413: Missing blank line after last section ('Arguments')
  >>>
- vda5050_connector.pep257 D416 (./vda5050_connector_py/mqtt_bridge.py:489)
  <<< failure message
    D416: Section name should end with a colon ('Arguments:', not 'Arguments')
  >>>
- vda5050_connector.pep257 D417 (./vda5050_connector_py/mqtt_bridge.py:489)
  <<< failure message
    D417: Missing argument descriptions in the docstring (argument(s) msg are missing descriptions in '_publish_visualization' docstring)
  >>>
- vda5050_connector.pep257 D407 (./vda5050_connector_py/utils.py:117)
  <<< failure message
    D407: Missing dashed underline after section ('Args')
  >>>
- vda5050_connector.pep257 D416 (./vda5050_connector_py/utils.py:152)
  <<< failure message
    D416: Section name should end with a colon ('Args:', not 'Args')
  >>>
- vda5050_connector.pep257 D416 (./vda5050_connector_py/vda5050_controller.py:409)
  <<< failure message
    D416: Section name should end with a colon ('Args:', not 'Args')
  >>>
- vda5050_connector.pep257 D416 (./vda5050_connector_py/vda5050_controller.py:543)
  <<< failure message
    D416: Section name should end with a colon ('Args:', not 'Args')
  >>>
- vda5050_connector.pep257 D416 (./vda5050_connector_py/vda5050_controller.py:596)
  <<< failure message
    D416: Section name should end with a colon ('Args:', not 'Args')
  >>>
- vda5050_connector.pep257 D416 (./vda5050_connector_py/vda5050_controller.py:618)
  <<< failure message
    D416: Section name should end with a colon ('Args:', not 'Args')
  >>>
- vda5050_connector.pep257 D416 (./vda5050_connector_py/vda5050_controller.py:633)
  <<< failure message
    D416: Section name should end with a colon ('Args:', not 'Args')
  >>>
- vda5050_connector.pep257 D416 (./vda5050_connector_py/vda5050_controller.py:669)
  <<< failure message
    D416: Section name should end with a colon ('Args:', not 'Args')
  >>>
- vda5050_connector.pep257 D417 (./vda5050_connector_py/vda5050_controller.py:669)
  <<< failure message
    D417: Missing argument descriptions in the docstring (argument(s) instant_actions are missing descriptions in 'process_instant_actions' docstring)
  >>>
- vda5050_connector.pep257 D416 (./vda5050_connector_py/vda5050_controller.py:742)
  <<< failure message
    D416: Section name should end with a colon ('Args:', not 'Args')
  >>>
- vda5050_connector.pep257 D416 (./vda5050_connector_py/vda5050_controller.py:775)
  <<< failure message
    D416: Section name should end with a colon ('Args:', not 'Args')
  >>>
- vda5050_connector.pep257 D416 (./vda5050_connector_py/vda5050_controller.py:805)
  <<< failure message
    D416: Section name should end with a colon ('Args:', not 'Args')
  >>>
- vda5050_connector.pep257 D413 (./vda5050_connector_py/vda5050_controller.py:818)
  <<< failure message
    D413: Missing blank line after last section ('Args')
  >>>
- vda5050_connector.pep257 D416 (./vda5050_connector_py/vda5050_controller.py:818)
  <<< failure message
    D416: Section name should end with a colon ('Args:', not 'Args')
  >>>
- vda5050_connector.pep257 D416 (./vda5050_connector_py/vda5050_controller.py:834)
  <<< failure message
    D416: Section name should end with a colon ('Args:', not 'Args')
  >>>
- vda5050_connector.pep257 D417 (./vda5050_connector_py/vda5050_controller.py:834)
  <<< failure message
    D417: Missing argument descriptions in the docstring (argument(s) order are missing descriptions in 'process_order' docstring)
  >>>
- vda5050_connector.pep257 D416 (./vda5050_connector_py/vda5050_controller.py:955)
  <<< failure message
    D416: Section name should end with a colon ('Args:', not 'Args')
  >>>
- vda5050_connector.pep257 D413 (./vda5050_connector_py/vda5050_controller.py:955)
  <<< failure message
    D413: Missing blank line after last section ('Return')
  >>>
- vda5050_connector.pep257 D416 (./vda5050_connector_py/vda5050_controller.py:955)
  <<< failure message
    D416: Section name should end with a colon ('Return:', not 'Return')
  >>>
- vda5050_connector.pep257 D413 (./vda5050_connector_py/vda5050_controller.py:993)
  <<< failure message
    D413: Missing blank line after last section ('Args')
  >>>
- vda5050_connector.pep257 D416 (./vda5050_connector_py/vda5050_controller.py:993)
  <<< failure message
    D416: Section name should end with a colon ('Args:', not 'Args')
  >>>
- vda5050_connector.pep257 D416 (./vda5050_connector_py/vda5050_controller.py:1079)
  <<< failure message
    D416: Section name should end with a colon ('Args:', not 'Args')
  >>>
- vda5050_connector.pep257 D417 (./vda5050_connector_py/vda5050_controller.py:1079)
  <<< failure message
    D417: Missing argument descriptions in the docstring (argument(s) description are missing descriptions in '_reject_order' docstring)
  >>>
- vda5050_connector.pep257 D416 (./vda5050_connector_py/vda5050_controller.py:1229)
  <<< failure message
    D416: Section name should end with a colon ('Args:', not 'Args')
  >>>
- vda5050_connector.pep257 D416 (./vda5050_connector_py/vda5050_controller.py:1336)
  <<< failure message
    D416: Section name should end with a colon ('Args:', not 'Args')
  >>>
- vda5050_connector.pep257 D416 (./vda5050_connector_py/vda5050_controller.py:1361)
  <<< failure message
    D416: Section name should end with a colon ('Args:', not 'Args')
  >>>
- vda5050_connector.pep257 D416 (./vda5050_connector_py/vda5050_controller.py:1383)
  <<< failure message
    D416: Section name should end with a colon ('Args:', not 'Args')
  >>>

Summary: 415 tests, 0 errors, 46 failures, 85 skipped

Errors after

docker@ros_amr_interop:~/dev_ws$ colcon test --packages-select vda5050_connector && colcon test-result --verbose
Starting >>> vda5050_connector
[Processing: vda5050_connector]                   
Finished <<< vda5050_connector [52.6s]            

Summary: 1 package finished [53.1s]
Summary: 375 tests, 0 errors, 0 failures, 85 skipped

@leandropineda leandropineda self-assigned this Dec 22, 2022
@leandropineda leandropineda marked this pull request as ready for review December 26, 2022 15:24
@FlorGrosso
Copy link
Member

Thanks for the fixes and for the Dockerfile, Lean!

@leandropineda leandropineda merged commit 4bf33fb into inorbit-ai:humble-devel Dec 26, 2022
@leandropineda leandropineda deleted the fix/humble-devel-tests branch December 26, 2022 15:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants