Skip to content

Commit

Permalink
Test timing out
Browse files Browse the repository at this point in the history
Signed-off-by: Aaron Chong <aaronchongth@gmail.com>
  • Loading branch information
aaronchongth committed Dec 31, 2024
1 parent 26ff2b8 commit 3ac9338
Show file tree
Hide file tree
Showing 8 changed files with 569 additions and 66 deletions.
7 changes: 6 additions & 1 deletion .github/actions/build-and-test/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ inputs:
description: string, supports ON or OFF only
required: false
default: "OFF"
e2e-testing:
description: string, supports ON or OFF only
required: false
default: "OFF"

runs:
using: composite
Expand All @@ -39,7 +43,8 @@ runs:
"build": {
"cmake-args": [
"-DNAV1_INTEGRATION_TESTING=${{ inputs.nav1-integration-testing }}",
"-DNAV2_INTEGRATION_TESTING=${{ inputs.nav2-integration-testing }}"
"-DNAV2_INTEGRATION_TESTING=${{ inputs.nav2-integration-testing }}",
"-DE2E_TESTING=${{ inputs.e2e-testing }}"
],
"mixin": ["coverage-pytest"]
},
Expand Down
40 changes: 40 additions & 0 deletions .github/docker/e2e-tests/e2e-docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
services:
minimal-ros1-sim:
image: ghcr.io/open-rmf/free_fleet/minimal-ros1-sim:noetic-latest
stop_signal: SIGINT
network_mode: host
privileged: true
stdin_open: true
tty: true

minimal-nav1-bringup:
image: ghcr.io/open-rmf/free_fleet/minimal-nav1-bringup:noetic-latest
stop_signal: SIGINT
network_mode: host
privileged: true
stdin_open: true
tty: true

minimal-zenoh-bridge-ros1:
image: ghcr.io/open-rmf/free_fleet/minimal-zenoh-bridge-ros1:noetic-latest
network_mode: host
stdin_open: true
tty: true

minimal-zenoh-router:
image: eclipse/zenoh
restart: unless-stopped
network_mode: host
stdin_open: true
tty: true
environment:
- RUST_LOG=debug

minimal-rmf:
image: ghcr.io/open-rmf/free_fleet/minimal-rmf:jazzy-latest
network_mode: host
stdin_open: true
tty: true
environment:
- ROS_DOMAIN_ID=0
- RMW_IMPLEMENTATION=rmw_fastrtps_cpp
27 changes: 27 additions & 0 deletions .github/docker/minimal-rmf/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
ARG ROS_DISTRO=jazzy
FROM docker.io/ros:$ROS_DISTRO-ros-base
ARG RMF_BRANCH=main
ARG FREE_FLEET_BRANCH=main

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

RUN mkdir -p /rmf && cd /rmf \
&& curl -sL https://github.com/open-rmf/free_fleet/archive/refs/heads/$FREE_FLEET_BRANCH.tar.gz -o free_fleet.tar.gz \
&& mkdir -p /rmf/src/free_fleet && tar zxf free_fleet.tar.gz -C /rmf/src/free_fleet --strip-components=1 && rm free_fleet.tar.gz \
&& curl -sL https://github.com/open-rmf/rmf_demos/archive/refs/heads/$RMF_BRANCH.tar.gz -o rmf_demos.tar.gz \
&& mkdir -p /rmf/src/rmf_demos && tar zxf rmf_demos.tar.gz -C /rmf/src/rmf_demos --strip-components=1 && rm rmf_demos.tar.gz

RUN rosdep update && rosdep install --from-paths /rmf/src -yi

RUN cd /rmf \
&& . /opt/ros/$ROS_DISTRO/setup.sh \
&& colcon build --merge-install --install-base /opt/rmf --cmake-args -DCMAKE_BUILD_TYPE=Release --packages-up-to free_fleet_examples \
&& rm -rf /rmf

ENV RMW_IMPLEMENTATION=rmw_cyclonedds_cpp

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

ENTRYPOINT ["bash", "-c", ". /opt/rmf/setup.bash && ros2 launch free_fleet_examples turtlebot3_world_rmf_common.launch.xml"]
45 changes: 45 additions & 0 deletions .github/workflows/e2e-tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: e2e-tests

on: push

jobs:
e2e-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/e2e-tests/e2e-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.1.0
e2e-testing: ON

- name: Stop test fixture containers
if: always()
run: docker-compose -f ".github/docker/e2e-tests/e2e-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 }}
160 changes: 95 additions & 65 deletions .github/workflows/nightly.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,99 @@ on:
# 2am SGT
- cron: '0 18 * * *'

# on: [push]

jobs:
build-minimal-nav2-docker-images:
name: Push minimal nav2 docker images to GitHub Packages
# build-minimal-nav2-docker-images:
# name: Push minimal nav2 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-ros2dds
# uses: docker/build-push-action@v5
# with:
# push: true
# build-args: |
# ROS_DISTRO=${{ matrix.ros_distribution }}
# ZENOH_VERSION=1.1.0
# FREE_FLEET_BRANCH=easy-full-control
# tags: ghcr.io/${{ github.repository }}/minimal-zenoh-bridge-ros2dds:${{ matrix.ros_distribution }}-latest
# context: .github/docker/minimal-zenoh-bridge-ros2dds

# build-minimal-nav1-docker-images:
# name: Push minimal nav1 docker images to GitHub Packages
# runs-on: ubuntu-latest
# strategy:
# matrix:
# ros_distribution: [noetic]
# 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-ros1-sim
# uses: docker/build-push-action@v5
# with:
# push: true
# build-args: |
# ROS_DISTRO=${{ matrix.ros_distribution }}
# tags: ghcr.io/${{ github.repository }}/minimal-ros1-sim:${{ matrix.ros_distribution }}-latest
# context: .github/docker/minimal-ros1-sim

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

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

build-minimal-rmf-docker-images:
name: Push minimal rmf docker images to GitHub Packages
runs-on: ubuntu-latest
strategy:
matrix:
Expand All @@ -25,74 +115,14 @@ jobs:
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-ros2dds
uses: docker/build-push-action@v5
with:
push: true
build-args: |
ROS_DISTRO=${{ matrix.ros_distribution }}
ZENOH_VERSION=1.1.0
FREE_FLEET_BRANCH=easy-full-control
tags: ghcr.io/${{ github.repository }}/minimal-zenoh-bridge-ros2dds:${{ matrix.ros_distribution }}-latest
context: .github/docker/minimal-zenoh-bridge-ros2dds

build-minimal-nav1-docker-images:
name: Push minimal nav1 docker images to GitHub Packages
runs-on: ubuntu-latest
strategy:
matrix:
ros_distribution: [noetic]
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-ros1-sim
uses: docker/build-push-action@v5
with:
push: true
build-args: |
ROS_DISTRO=${{ matrix.ros_distribution }}
tags: ghcr.io/${{ github.repository }}/minimal-ros1-sim:${{ matrix.ros_distribution }}-latest
context: .github/docker/minimal-ros1-sim

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

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

nav1-integration-tests:
needs: build-minimal-nav1-docker-images
Expand Down
12 changes: 12 additions & 0 deletions free_fleet_adapter/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,18 @@ if(BUILD_TESTING)
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
)
endforeach()
elseif (E2E_TESTING)
set(_pytest_tests
tests/e2e/test_nav1_fleet_adapter.py
)
foreach(_test_path ${_pytest_tests})
get_filename_component(_test_name ${_test_path} NAME_WE)
ament_add_pytest_test(${_test_name} ${_test_path}
APPEND_ENV PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}
TIMEOUT 60
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
)
endforeach()
endif()
endif()

Expand Down
Empty file.
Loading

0 comments on commit 3ac9338

Please sign in to comment.