Skip to content

Commit

Permalink
Merge pull request eclipse-iceoryx#1907 from ApexAI/iox-1960-update-i…
Browse files Browse the repository at this point in the history
…ntegrationtests

Iox 1960 update integrationtests
  • Loading branch information
dkroenke authored Feb 21, 2023
2 parents 6272c34 + dcdcaff commit adbab34
Show file tree
Hide file tree
Showing 7 changed files with 56 additions and 43 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,13 @@ jobs:
run-integration-test:
# prevent stuck jobs consuming runners for 6 hours
timeout-minutes: 60
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
needs: pre-flight-check
steps:
- name: Setup ROS
uses: ros-tooling/[email protected]
with:
required-ros-distributions: foxy
required-ros-distributions: humble
- uses: actions/checkout@v3
- run: ./tools/ci/run-integration-test.sh

Expand Down Expand Up @@ -162,12 +162,12 @@ jobs:
file: ./lcov_results/unittest/lcov/iceoryx_lcov_result_unit.info
name: iceoryx
flags: unittests
fail_ci_if_error: true
fail_ci_if_error: false

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
file: ./lcov_results/unittest_timing/lcov/iceoryx_lcov_result_unit-timing.info
name: iceoryx
flags: unittests_timing
fail_ci_if_error: true
fail_ci_if_error: false
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ All new code should follow the folder structure.
only set the title and include the readme from `/iceoryx_examples/foobar/README.md`
3. Add an `add_subdirectory` directive into `iceoryx_meta/CMakeLists.txt` in the `if(EXAMPLES)` section.
4. Consider using [geoffrey](https://github.com/elBoberido/geoffrey#geoffrey---syncs-source-code-to-markdown-code-blocks) for syncing code in code blocks with the respective source files
5. Add integration test for example
5. Add integration test (add as dependency to package.xml and write a launch_test for the example)
6. [Record an asciicast](./tools/website/how-to-record-asciicast.md) and embed image link

## Testing
Expand Down
1 change: 1 addition & 0 deletions doc/website/release-notes/iceoryx-unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
- Provide a better error message when attempting to create a shared memory in read-only mode
[\#1821](https://github.com/eclipse-iceoryx/iceoryx/issues/1821)
- Can not build iceoryx with gcc 9.4 [\#1871](https://github.com/eclipse-iceoryx/iceoryx/issues/1871)
- Update iceoryx_integrationtest package to use ROS2 Humble [\#1906](https://github.com/eclipse-iceoryx/iceoryx/issues/1906)

**Refactoring:**

Expand Down
39 changes: 17 additions & 22 deletions iceoryx_integrationtest/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2021 - 2022 by Apex.AI Inc. All rights reserved.
# Copyright (c) 2021 - 2023 by Apex.AI Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
Expand All @@ -20,29 +20,24 @@ project(iceoryx_integrationtest)
find_package(ament_cmake REQUIRED)

if(BUILD_TESTING)
find_package(ros_testing)
find_package(launch_testing_ament_cmake REQUIRED)

add_ros_test(iceoryx_integrationtest/test_roudi_startup_shutdown.py)
add_ros_test(iceoryx_integrationtest/test_callback_example.py)
add_ros_test(iceoryx_integrationtest/test_callback_in_c_example.py)
add_ros_test(iceoryx_integrationtest/test_icehello_example.py)
add_ros_test(iceoryx_integrationtest/test_icedelivery_example.py)
add_ros_test(iceoryx_integrationtest/test_icedelivery_in_c_example.py)
add_ros_test(iceoryx_integrationtest/test_singleprocess_example.py)
add_ros_test(iceoryx_integrationtest/test_waitset_example.py)
add_ros_test(iceoryx_integrationtest/test_waitset_in_c_example.py)
add_ros_test(iceoryx_integrationtest/test_iceoptions_example.py)
add_ros_test(iceoryx_integrationtest/test_complexdata_example.py)
add_ros_test(iceoryx_integrationtest/test_user_header_example.py)
add_ros_test(iceoryx_integrationtest/test_icediscovery_example.py)
add_ros_test(iceoryx_integrationtest/test_icediscovery_monitoring.py)
add_ros_test(iceoryx_integrationtest/test_request_response_in_c_basic.py)
add_ros_test(iceoryx_integrationtest/test_request_response_in_c_listener_and_waitset.py)
add_ros_test(iceoryx_integrationtest/test_request_response_basic.py)
add_ros_test(iceoryx_integrationtest/test_request_response_listener.py)
add_ros_test(iceoryx_integrationtest/test_request_response_untyped.py)
add_ros_test(iceoryx_integrationtest/test_icediscovery_in_c_example.py)
list(APPEND IOX_INT_TESTS test_roudi_startup_shutdown test_callback_example test_callback_in_c_example
test_icehello_example test_icedelivery_example test_icedelivery_in_c_example
test_singleprocess_example test_waitset_example test_waitset_in_c_example
test_iceoptions_example test_complexdata_example test_user_header_example
test_icediscovery_example test_icediscovery_in_c_example test_icediscovery_monitoring
test_request_response_in_c_listener_and_waitset test_request_response_basic test_request_response_in_c_basic
test_request_response_listener test_request_response_untyped
)
# add test_ice_access_control_example when activating integrationtest #1910

foreach(TEST IN LISTS IOX_INT_TESTS)
add_launch_test(
"${PROJECT_NAME}/${TEST}.py"
TIMEOUT 45
)
endforeach()
endif()

ament_package()
14 changes: 7 additions & 7 deletions iceoryx_integrationtest/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,30 +24,30 @@ Limitations:

## Setup

To build and execute the tests you need to have ROS 2 installed. Please follow the instructions on <https://docs.ros.org/en/foxy/Installation.html>.
The system tests are currently tested on ROS 2 "Foxy Fitzroy" in Ubuntu 20.04 LTS.
To build and execute the tests you need to have ROS 2 installed. Please follow the instructions on <https://docs.ros.org/en/humble/Installation.html>.
The system tests are currently tested on ROS 2 "Humble Hawksbill" in Ubuntu 22.04 LTS.

Please remove beforehand the `COLCON_IGNORE` files from `iceoryx_integrationtest` and `iceoryx_examples`.

For a basic setup you need to install the following packages:

```bash
sudo apt install ros-foxy-ros-base ros-foxy-ros-testing ros-foxy-launch-testing ros-foxy-ament-cmake python3-colcon-common-extensions
sudo apt install ros-humble-ros-base ros-humble-launch-testing ros-humble-ament-cmake python3-colcon-common-extensions
```

For the future versions you can use the corresponding ROS 2 release.

Once installed, you need to source ROS 2 to make the environment available in your terminal:

```bash
source /opt/ros/foxy/setup.bash
source /opt/ros/humble/setup.bash
```

**_NOTE:_** You can add the source command to your `~/.bashrc` for automatic loading the ROS 2 workspace at boot time.

Required for the colcon build of iceoryx is that the repository is located within a ROS workspace like this:

```
```shell
iceoryx_workspace
└── src
└── iceoryx
Expand All @@ -67,7 +67,7 @@ iceoryx_workspace
Go into your iceoryx_workspace folder and do the colcon build:

```bash
colcon build
colcon build --packages-up-to iceoryx_integrationtest
```

The expected output should be like this: `Summary: 21 packages finished [31.7s]`
Expand Down Expand Up @@ -118,7 +118,7 @@ An output for a failing test could look like this:
Traceback (most recent call last):
File "iceoryx_workspace/src/iceoryx/iceoryx_integrationtest/iceoryx_integrationtest/test_roudi_startup_shutdown.py", line 52, in test_roudi_ready
proc_output.assertWaitFor(
File "/opt/ros/foxy/lib/python3.8/site-packages/launch_testing/io_handler.py", line 146, in assertWaitFor
File "/opt/ros/humble/lib/python3.8/site-packages/launch_testing/io_handler.py", line 146, in assertWaitFor
assert success, 'Waiting for output timed out'
AssertionError: Waiting for output timed out
```
Expand Down
17 changes: 17 additions & 0 deletions iceoryx_integrationtest/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,23 @@
<test_depend>iceoryx_hoofs</test_depend>
<test_depend>iceoryx_dust</test_depend>

<test_depend>example_callbacks</test_depend>
<test_depend>example_callbacks_in_c</test_depend>
<test_depend>example_complexdata</test_depend>
<test_depend>example_icedelivery</test_depend>
<!-- <test_depend>example_ice_access_control</test_depend> -->
<test_depend>example_icedelivery_in_c</test_depend>
<test_depend>example_icediscovery</test_depend>
<test_depend>example_icediscovery_in_c</test_depend>
<test_depend>example_icehello</test_depend>
<test_depend>example_iceoptions</test_depend>
<test_depend>example_request_response</test_depend>
<test_depend>example_request_response_in_c</test_depend>
<test_depend>example_singleprocess</test_depend>
<test_depend>example_user_header</test_depend>
<test_depend>example_waitset</test_depend>
<test_depend>example_waitset_in_c</test_depend>

<export>
<build_type>ament_cmake</build_type>
</export>
Expand Down
18 changes: 9 additions & 9 deletions tools/ci/run-integration-test.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
# Copyright (c) 2021 by Apex.AI Inc. All rights reserved.
# Copyright (c) 2021, 2023 by Apex.AI Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -27,28 +27,28 @@ WORKSPACE=$(git rev-parse --show-toplevel)
cd "${WORKSPACE}"

msg "installing dependencies"
# NOTE: github action ros-tooling/setup-ros@0.2.1 should be run before
# NOTE: github action ros-tooling/setup-ros should be run before
sudo apt install -y apt-transport-https
sudo apt update && sudo apt install -y cmake libacl1-dev libncurses5-dev pkg-config ros-foxy-ros-testing
sudo apt update && sudo apt install -y cmake libacl1-dev libncurses5-dev pkg-config

msg "sourcing ROS workspace"
# shellcheck source=/dev/null
source /opt/ros/foxy/setup.bash
source /opt/ros/humble/setup.bash

msg "checking copyrights"
sudo rm -rf /opt/ros/foxy/lib/python3.8/site-packages/ament_copyright/template/apache2_header.txt
sudo cp -rf tools/apache2_header.txt /opt/ros/foxy/lib/python3.8/site-packages/ament_copyright/template/.
sudo rm -rf /opt/ros/humble/lib/python3.10/site-packages/ament_copyright/template/apache2_header.txt
sudo cp -rf tools/apache2_header.txt /opt/ros/humble/lib/python3.10/site-packages/ament_copyright/template/.
# shellcheck disable=SC2026
sudo sed -i '41 c\"'c'", "'cc'", "'cpp'", "'cxx'", "'h'", "'hh'", "'hpp'", "'hxx'", "'inl'", "'sh'"' /opt/ros/foxy/lib/python3.8/site-packages/ament_copyright/main.py
ament_copyright --exclude LICENSE CONTRIBUTING.md tools/apache2_header.txt
sudo sed -i '41 c\"'c'", "'cc'", "'cpp'", "'cxx'", "'h'", "'hh'", "'hpp'", "'hxx'", "'inl'", "'sh'"' /opt/ros/humble/lib/python3.10/site-packages/ament_copyright/main.py
ament_copyright ./**/* tools/apache2_header.txt

msg "compiler versions:
$(gcc --version)
$(clang --version)"

msg "building"
rm -rf iceoryx_examples/COLCON_IGNORE iceoryx_integrationtest/COLCON_IGNORE
colcon build
colcon build --packages-up-to iceoryx_integrationtest

msg "executing tests"
# shellcheck source=/dev/null
Expand Down

0 comments on commit adbab34

Please sign in to comment.