Skip to content

Commit

Permalink
Basic sub fleet state test
Browse files Browse the repository at this point in the history
Signed-off-by: Aaron Chong <[email protected]>
  • Loading branch information
aaronchongth committed Feb 11, 2025
1 parent ad36048 commit 317ac98
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 28 deletions.
32 changes: 16 additions & 16 deletions .github/workflows/nav2-integration-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,23 +23,22 @@ jobs:
# - name: Build and export free-fleet-examples
# uses: docker/build-push-action@v5
# with:
# push: false
# build-args: |
# ROS_DISTRO=${{ matrix.ros_distribution }}
# FREE_FLEET_BRANCH=${{ steps.extract_branch.outputs.branch }}
# tags: ghcr.io/${{ github.repository }}/free-fleet-examples:${{ matrix.ros_distribution }}-${{ steps.extract_branch.outputs.branch }}
# tags: free-fleet-examples:${{ matrix.ros_distribution }}-${{ steps.extract_branch.outputs.branch }}
# context: .github/docker/free-fleet-examples
# outputs: type=docker,dest=${{ runner.temp }}/free-fleet-examples.tar
# outputs: type=docker,dest=./free-fleet-examples.tar

# - name: Upload artifact
# uses: actions/upload-artifact@v4
# with:
# name: free-fleet-examples
# path: free-fleet-examples.tar
# # - name: Upload artifact
# # uses: actions/upload-artifact@v4
# # with:
# # name: free-fleet-examples
# # path: free-fleet-examples.tar

integration-tests:
# needs: [build-free-fleet-docker-image]
timeout-minutes: 10
timeout-minutes: 20
runs-on: ubuntu-latest
container:
image: osrf/ros:${{ matrix.ros_distribution }}-desktop-noble
Expand Down Expand Up @@ -71,18 +70,19 @@ jobs:
build-args: |
ROS_DISTRO=${{ matrix.ros_distribution }}
FREE_FLEET_BRANCH=${{ steps.extract_branch.outputs.branch }}
tags: ghcr.io/${{ github.repository }}/free-fleet-examples:${{ matrix.ros_distribution }}-${{ steps.extract_branch.outputs.branch }}
tags: free-fleet-examples:${{ matrix.ros_distribution }}-${{ steps.extract_branch.outputs.branch }}
context: .github/docker/free-fleet-examples
outputs: type=docker,dest=./free-fleet-examples.tar

# - name: Download artifact
# uses: actions/download-artifact@v4
# with:
# name: free-fleet-examples

# - name: Load image
# run: |
# docker load --input free-fleet-examples.tar
# docker image ls -a
- name: Load image
run: |
docker load --input ./free-fleet-examples.tar
docker image ls -a
- name: Start test fixture containers
run: docker-compose -f ".github/docker/integration-tests/nav2-docker-compose.yaml" up -d --build
Expand All @@ -91,14 +91,14 @@ jobs:
run: |
docker run --network=host -d \
-e ROS_DOMAIN_ID=0 \
ghcr.io/${{ github.repository }}/free-fleet-examples:${{ matrix.ros_distribution }}-${{ steps.extract_branch.outputs.branch }} \
free-fleet-examples:${{ matrix.ros_distribution }}-${{ steps.extract_branch.outputs.branch }} \
bash -c "ros2 launch free_fleet_examples turtlebot3_world_rmf_common.launch.xml"
- name: Start the free fleet adapter
run: |
docker run --network=host -d \
-e ROS_DOMAIN_ID=0 \
ghcr.io/${{ github.repository }}/free-fleet-examples:${{ matrix.ros_distribution }}-${{ steps.extract_branch.outputs.branch }} \
free-fleet-examples:${{ matrix.ros_distribution }}-${{ steps.extract_branch.outputs.branch }} \
bash -c "ros2 launch free_fleet_examples nav2_tb3_simulation_fleet_adapter.launch.xml"
- name: build-and-test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,18 @@ def tearDownClass(cls):
rclpy.shutdown()

def test_robot_exists(self):
def start_adapter():
start_fleet_adapter(
config_path=str(self.__fleet_config_path),
nav_graph_path=str(self.__nav_graph_path),
zenoh_config_path=None,
server_uri=None,
use_sim_time=True
)
fleet_adapter_thread = \
threading.Thread(target=start_adapter, args=())
fleet_adapter_thread.daemon = True
fleet_adapter_thread.start()
# def start_adapter():
# start_fleet_adapter(
# config_path=str(self.__fleet_config_path),
# nav_graph_path=str(self.__nav_graph_path),
# zenoh_config_path=None,
# server_uri=None,
# use_sim_time=True
# )
# fleet_adapter_thread = \
# threading.Thread(target=start_adapter, args=())
# fleet_adapter_thread.daemon = True
# fleet_adapter_thread.start()

robot_exists = asyncio.Future()

Expand Down

0 comments on commit 317ac98

Please sign in to comment.