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

Efc/integration testing #157

Merged
merged 44 commits into from
Nov 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
8332d4a
Adding dockerfiles for building tests
aaronchongth Oct 15, 2024
603c86e
Initial docker compose nightly workflow
aaronchongth Nov 5, 2024
f8631fe
Using new docker compose command
aaronchongth Nov 5, 2024
ec8c75d
Fix zenoh bridge image branch
aaronchongth Nov 5, 2024
6b2feec
Use curl for repo tar
aaronchongth Nov 5, 2024
6a7e352
Use docker compose command for down too
aaronchongth Nov 5, 2024
1b945df
Setup integration testing with flag, test with workflow
aaronchongth Nov 6, 2024
c1fc27d
Install docker-compose in ros container
aaronchongth Nov 6, 2024
d9c9bd9
Ommit setup-ros step and fix linting
aaronchongth Nov 6, 2024
f3143bb
Revert setup ros step, use cmake -args
aaronchongth Nov 6, 2024
89c687d
Use 1.0.1 API
aaronchongth Nov 6, 2024
4b6abf5
Using client and router method
aaronchongth Nov 6, 2024
3c32daf
Remove command in docker compose
aaronchongth Nov 6, 2024
2d1a08b
Working locally, commented out zenohd
aaronchongth Nov 7, 2024
d209d50
Spinning up minimal-zenoh too
aaronchongth Nov 7, 2024
75d7380
Moving docker files, trying with client mode
aaronchongth Nov 7, 2024
2f38194
Merge branch 'easy-full-control' into efc/integration-testing
aaronchongth Nov 10, 2024
2fda75c
Use official zenoh docker image and compose example, rename client ze…
aaronchongth Nov 10, 2024
4d651b1
Re-usable workflow actions, split integration testing
aaronchongth Nov 10, 2024
75458cb
Missing docker-compose installation
aaronchongth Nov 10, 2024
710abd8
Fix broken action, rename test job
aaronchongth Nov 10, 2024
74f2937
Fix shell selection, use composite
aaronchongth Nov 10, 2024
60bb934
Set nightly schedule, fix steps in unit-tests
aaronchongth Nov 10, 2024
708000d
Remove minimal zenoh router dockerfile, add checkout to unit-tests
aaronchongth Nov 10, 2024
c04cd99
Isolating tf listner components for testing
aaronchongth Nov 10, 2024
998241a
Use correct robot name, lint
aaronchongth Nov 10, 2024
40a4158
Clean up imports and fix namespacing
aaronchongth Nov 10, 2024
8f2a507
Refactor to TfHandler, added testing
aaronchongth Nov 11, 2024
2b66dac
Simplifying API
aaronchongth Nov 14, 2024
c29b497
Moved integration testing to free fleet adapter, added abstract Robot…
aaronchongth Nov 14, 2024
1b4e8b9
Abstract out robot adapter, slight refactor
aaronchongth Nov 14, 2024
c79371a
Robot existense test, with a planned failure to verify that it is run…
aaronchongth Nov 14, 2024
f3f550d
setup rclpy node for testing too
aaronchongth Nov 14, 2024
4661bb2
Add coverage and fix lint
aaronchongth Nov 14, 2024
df34593
Use unit test test cases
aaronchongth Nov 15, 2024
492b274
Move tests
aaronchongth Nov 15, 2024
8140474
Fix launch files
aaronchongth Nov 15, 2024
ab6f946
Rename functions
aaronchongth Nov 15, 2024
511e2c7
Not to check execution, comment out stop command test
aaronchongth Nov 15, 2024
60d0f5d
Use helper function for stop
aaronchongth Nov 15, 2024
fdff8bc
Using all statuses
aaronchongth Nov 15, 2024
87830af
Badges
aaronchongth Nov 15, 2024
bac3660
Switch to easy-full-control branch before merging
aaronchongth Nov 15, 2024
d4e9589
Update readme
aaronchongth Nov 15, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions .github/actions/build-and-test/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: build-and-test

inputs:
ros-distribution:
description: string, ROS distribution to setup
required: true
zenoh-version:
description: string, version of eclipse-zenoh to install from pip
required: true
integration-testing:
description: string, supports ON or OFF only
required: false
default: "OFF"

runs:
using: composite
steps:
- name: install dependencies
run: |
sudo apt update && sudo apt install python3-pip -y
pip3 install eclipse-zenoh==${{ inputs.zenoh-version }} pycdr2 --break-system-packages
shell: bash

- uses: ros-tooling/setup-ros@v0.7
with:
required-ros-distributions: ${{ inputs.ros-distribution }}

- name: build and test
uses: ros-tooling/action-ros-ci@v0.3
with:
package-name: free_fleet free_fleet_adapter free_fleet_examples
target-ros2-distro: ${{ inputs.ros-distribution }}
colcon-defaults: |
{
"build": {
"cmake-args": [
"-DINTEGRATION_TESTING=${{ inputs.integration-testing }}"
],
"mixin": ["coverage-pytest"]
},
"test": {
"mixin": ["coverage-pytest"]
}
}
colcon-mixin-repository: https://raw.githubusercontent.com/colcon/colcon-mixin-repository/master/index.yaml
29 changes: 29 additions & 0 deletions .github/docker/integration-tests/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
version: "3"

services:
minimal-nav2-bringup:
image: ghcr.io/open-rmf/free_fleet/minimal-nav2-bringup:jazzy-latest
stop_signal: SIGINT
network_mode: host
privileged: true
stdin_open: true
tty: true
environment:
- ROS_DOMAIN_ID=42

minimal-zenoh-bridge:
image: ghcr.io/open-rmf/free_fleet/minimal-zenoh-bridge:jazzy-latest
network_mode: host
stdin_open: true
tty: true
environment:
- ROS_DOMAIN_ID=42

minimal-zenoh-router:
image: eclipse/zenoh
restart: unless-stopped
network_mode: host
stdin_open: true
tty: true
environment:
- RUST_LOG=debug
22 changes: 22 additions & 0 deletions .github/docker/minimal-nav2-bringup/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
ARG ROS_DISTRO=jazzy
FROM docker.io/ros:$ROS_DISTRO-ros-base

RUN apt update && apt install -y curl ros-$ROS_DISTRO-nav2-bringup ros-$ROS_DISTRO-rmw-cyclonedds-cpp

RUN mkdir -p /tb3 && cd /tb3 \
&& curl -sL https://github.com/ROBOTIS-GIT/turtlebot3_simulations/archive/refs/heads/master.tar.gz -o turtlebot3_simulations.tar.gz \
&& mkdir -p /tb3/turtlebot3_simulations && tar zxf turtlebot3_simulations.tar.gz -C /tb3/turtlebot3_simulations --strip-components=1 && rm turtlebot3_simulations.tar.gz

ENV RMW_IMPLEMENTATION rmw_cyclonedds_cpp
ENV GAZEBO_MODEL_PATH "$GAZEBO_MODEL_PATH:/tb3/turtlebot3_simulations/turtlebot3_gazebo/models"

RUN rm -rf \
/var/lib/apt/lists \
/dist

# Modify existing params file to add initial pose
RUN mkdir -p /params && cd /params \
&& cp /opt/ros/$ROS_DISTRO/share/nav2_bringup/params/nav2_params.yaml . \
&& sed -z 's|amcl:\n ros__parameters:\n|amcl:\n ros__parameters:\n set_initial_pose: true\n initial_pose: {x: -2.0, y: -0.5, z: 0.0, yaw: 0.0}\n|' nav2_params.yaml > nav2_params_edited.yaml

ENTRYPOINT ["bash", "-c", ". /opt/ros/$ROS_DISTRO/setup.bash && ros2 launch nav2_bringup tb3_simulation_launch.py params_file:=/params/nav2_params_edited.yaml use_rviz:=False"]
22 changes: 22 additions & 0 deletions .github/docker/minimal-zenoh-bridge/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
ARG ROS_DISTRO=jazzy
FROM docker.io/ros:$ROS_DISTRO-ros-base
ARG ZENOH_VERSION=1.0.1
ARG FREE_FLEET_BRANCH=main

RUN apt update && apt install -y wget unzip ros-jazzy-rmw-cyclonedds-cpp

RUN mkdir -p /zenoh-bridge && cd /zenoh-bridge \
&& wget -O zenoh-plugin-ros2dds.zip https://github.com/eclipse-zenoh/zenoh-plugin-ros2dds/releases/download/$ZENOH_VERSION/zenoh-plugin-ros2dds-$ZENOH_VERSION-x86_64-unknown-linux-gnu-standalone.zip \
&& unzip zenoh-plugin-ros2dds.zip \
&& rm zenoh-plugin-ros2dds.zip

RUN cd /zenoh-bridge \
&& wget -O turtlebot3_1_client_zenoh_config.json5 https://raw.githubusercontent.com/open-rmf/free_fleet/refs/heads/$FREE_FLEET_BRANCH/free_fleet_examples/zenoh_configs/turtlebot3_1_client_zenoh_config.json5

ENV RMW_IMPLEMENTATION rmw_cyclonedds_cpp

RUN rm -rf \
/var/lib/apt/lists \
/dist

ENTRYPOINT ["bash", "-c", ". /opt/ros/$ROS_DISTRO/setup.bash && /zenoh-bridge/zenoh-bridge-ros2dds -c /zenoh-bridge/turtlebot3_1_client_zenoh_config.json5"]
30 changes: 0 additions & 30 deletions .github/workflows/build.yaml

This file was deleted.

45 changes: 45 additions & 0 deletions .github/workflows/integration-tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: integration-tests

on: push

jobs:
integration-tests:
timeout-minutes: 10
runs-on: ubuntu-latest
container:
image: osrf/ros:${{ matrix.ros_distribution }}-desktop-noble
strategy:
matrix:
ros_distribution:
- jazzy

steps:
- name: Checkout
uses: actions/checkout@v1

- name: Install docker-compose
run: |
sudo apt update && sudo apt install docker-compose -y
- name: Start test fixture containers
run: docker-compose -f ".github/docker/integration-tests/docker-compose.yaml" up -d --build

- name: build-and-test
uses: ./.github/actions/build-and-test
with:
ros-distribution: ${{ matrix.ros_distribution }}
zenoh-version: 1.0.1
integration-testing: ON

- name: Stop test fixture containers
if: always()
run: docker-compose -f ".github/docker/integration-tests/docker-compose.yaml" down

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
files: ros_ws/coveragepy/.coverage
flags: tests
fail_ci_if_error: true
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
79 changes: 79 additions & 0 deletions .github/workflows/nightly.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: nightly

on:
schedule:
# 2am SGT
- cron: '0 18 * * *'

jobs:
build-minimal-docker-images:
name: Push minimal docker images to GitHub Packages
runs-on: ubuntu-latest
strategy:
matrix:
ros_distribution: [jazzy]
steps:
- uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to docker
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push minimal-nav2-bringup
uses: docker/build-push-action@v5
with:
push: true
build-args: |
ROS_DISTRO=${{ matrix.ros_distribution }}
tags: ghcr.io/${{ github.repository }}/minimal-nav2-bringup:${{ matrix.ros_distribution }}-latest
context: .github/docker/minimal-nav2-bringup

- name: Build and push minimal-zenoh-bridge
uses: docker/build-push-action@v5
with:
push: true
build-args: |
ROS_DISTRO=${{ matrix.ros_distribution }}
ZENOH_VERSION=1.0.1
FREE_FLEET_BRANCH=easy-full-control
tags: ghcr.io/${{ github.repository }}/minimal-zenoh-bridge:${{ matrix.ros_distribution }}-latest
context: .github/docker/minimal-zenoh-bridge

integration-tests:
needs: build-minimal-docker-images
timeout-minutes: 10
runs-on: ubuntu-latest
container:
image: osrf/ros:${{ matrix.ros_distribution }}-desktop-noble
strategy:
matrix:
ros_distribution:
- jazzy

steps:
- name: Checkout
uses: actions/checkout@v1

- name: Install docker-compose
run: |
sudo apt update && sudo apt install docker-compose -y
- name: Start test fixture containers
run: docker-compose -f ".github/docker/integration-tests/docker-compose.yaml" up -d --build

- name: build-and-test
uses: ./.github/actions/build-and-test
with:
ros-distribution: ${{ matrix.ros_distribution }}
zenoh-version: 1.0.1
integration-testing: ON

- name: Stop test fixture containers
if: always()
run: docker-compose -f ".github/docker/integration-tests/docker-compose.yaml" down
20 changes: 11 additions & 9 deletions .github/workflows/style.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@ jobs:
container:
image: ${{ matrix.docker_image }}
steps:
- uses: actions/checkout@v3
- name: deps
shell: bash
run: |
sudo apt update && sudo apt install pycodestyle
- name: pycodestyle
shell: bash
run: |
pycodestyle .
- uses: actions/checkout@v3

- name: deps
shell: bash
run: |
sudo apt update && sudo apt install pycodestyle
- name: pycodestyle
shell: bash
run: |
pycodestyle .
24 changes: 24 additions & 0 deletions .github/workflows/unit-tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: unit-tests

on: push

jobs:
unit-tests:
runs-on: ubuntu-latest
container:
image: osrf/ros:${{ matrix.ros_distribution }}-desktop-noble
strategy:
matrix:
ros_distribution:
- jazzy
- rolling
steps:
- name: Checkout
uses: actions/checkout@v1

- name: build-and-test
uses: ./.github/actions/build-and-test
with:
ros-distribution: ${{ matrix.ros_distribution }}
zenoh-version: 1.0.1
integration-testing: OFF
Loading
Loading