fix(event): raise MessageLost from sequence gaps #1397
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Interop Tests | |
| on: | |
| push: | |
| branches: [main] | |
| paths-ignore: | |
| - '**.md' | |
| - 'book/**' | |
| - '.github/workflows/docs.yml' | |
| - '.github/workflows/mkdocs-preview.yml' | |
| - '.github/workflows/ci.yml' | |
| - '.github/workflows/rmw-zenoh-rs.yml' | |
| - '.github/workflows/semantic-pr.yml' | |
| - '.github/workflows/pr-draft-check.yml' | |
| pull_request: | |
| types: [opened, synchronize, reopened, ready_for_review] | |
| branches: [main] | |
| paths-ignore: | |
| - '**.md' | |
| - 'book/**' | |
| - '.github/workflows/docs.yml' | |
| - '.github/workflows/mkdocs-preview.yml' | |
| - '.github/workflows/ci.yml' | |
| - '.github/workflows/rmw-zenoh-rs.yml' | |
| - '.github/workflows/semantic-pr.yml' | |
| - '.github/workflows/pr-draft-check.yml' | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: ${{ github.event_name == 'pull_request' }} | |
| jobs: | |
| interop_test: | |
| name: Interop tests with ROS 2 ${{ matrix.distro }} | |
| runs-on: ubuntu-latest | |
| # Skip for draft PRs to save CI time during development | |
| if: | | |
| github.event_name == 'push' || | |
| github.event.pull_request.draft == false | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| distro: [humble, jazzy, kilted, lyrical] | |
| include: | |
| - distro: humble | |
| image: ros:humble-ros-base | |
| hiroz_feature: humble | |
| - distro: jazzy | |
| image: ros:jazzy-ros-base | |
| hiroz_feature: jazzy | |
| - distro: kilted | |
| image: ros:kilted-ros-base | |
| hiroz_feature: kilted | |
| - distro: lyrical | |
| image: ros:lyrical-ros-base | |
| hiroz_feature: lyrical | |
| container: | |
| image: ${{ matrix.image }} | |
| steps: | |
| - name: Compute weekly cache key | |
| id: cache-week | |
| run: echo "week=$(date -u +%Y-W%V)" >> "$GITHUB_OUTPUT" | |
| - name: Cache apt packages | |
| uses: actions/cache@v4 | |
| with: | |
| path: /var/cache/apt/archives | |
| key: apt-${{ matrix.distro }}-v3-${{ hashFiles('.github/workflows/test.yml') }} | |
| # The apt package-index fetch (not the downloads) is the mirror bottleneck | |
| # here (~900 B/s), costing minutes per job. Cache the index; keyed weekly | |
| # so it can't go permanently stale — a miss just re-fetches. | |
| - name: Cache apt package lists | |
| uses: actions/cache@v4 | |
| with: | |
| path: /var/lib/apt/lists | |
| key: apt-lists-${{ matrix.distro }}-${{ steps.cache-week.outputs.week }} | |
| restore-keys: | | |
| apt-lists-${{ matrix.distro }}- | |
| # GitHub runners are on Azure, but the ROS base images point at the | |
| # generic archive/security.ubuntu.com endpoints, which are slow from here | |
| # (~75-900 B/s). Repoint to Azure's same-datacenter mirror. Handles both | |
| # the legacy one-line sources.list and the newer deb822 *.sources format. | |
| - name: Point apt at the Azure Ubuntu mirror | |
| run: | | |
| if [ -f /etc/apt/sources.list ]; then | |
| sed -i \ | |
| -e 's|http://archive\.ubuntu\.com/ubuntu|http://azure.archive.ubuntu.com/ubuntu|g' \ | |
| -e 's|http://security\.ubuntu\.com/ubuntu|http://azure.archive.ubuntu.com/ubuntu|g' \ | |
| /etc/apt/sources.list | |
| fi | |
| # Guard with `ls`: with nullglob off, a non-matching glob expands to | |
| # the literal pattern, so don't rely on the match itself. | |
| if ls /etc/apt/sources.list.d/*.sources > /dev/null 2>&1; then | |
| sed -i \ | |
| -e 's|http://archive\.ubuntu\.com/ubuntu|http://azure.archive.ubuntu.com/ubuntu|g' \ | |
| -e 's|http://security\.ubuntu\.com/ubuntu|http://azure.archive.ubuntu.com/ubuntu|g' \ | |
| /etc/apt/sources.list.d/*.sources | |
| fi | |
| - name: Install system dependencies | |
| run: | | |
| # Install jq here so taiki-e/install-action's cargo-nextest step | |
| # below doesn't trigger a second, redundant apt-get update for it. | |
| apt-get update && apt-get install -y nodejs jq | |
| - name: Install Nushell | |
| run: | | |
| NU_VERSION=0.102.0 | |
| ARCH=$(uname -m | sed 's/x86_64/x86_64/;s/aarch64/aarch64/') | |
| NU_TARBALL="nu-${NU_VERSION}-${ARCH}-unknown-linux-gnu" | |
| curl -fsSL "https://github.com/nushell/nushell/releases/download/${NU_VERSION}/${NU_TARBALL}.tar.gz" \ | |
| | tar -xz -C /usr/local/bin --strip-components=1 "${NU_TARBALL}/nu" | |
| - name: Install ROS dependencies | |
| run: | | |
| apt-get install -y \ | |
| ros-${{ matrix.distro }}-example-interfaces \ | |
| ros-${{ matrix.distro }}-rmw-zenoh-cpp \ | |
| ros-${{ matrix.distro }}-demo-nodes-cpp \ | |
| ros-${{ matrix.distro }}-action-tutorials-cpp \ | |
| ros-${{ matrix.distro }}-geometry-msgs \ | |
| ros-${{ matrix.distro }}-sensor-msgs \ | |
| ros-${{ matrix.distro }}-nav-msgs \ | |
| protobuf-compiler | |
| - name: Fix broken rmw_zenoh_cpp config for Kilted | |
| if: matrix.distro == 'kilted' | |
| run: | | |
| # WORKAROUND: ros-kilted-rmw-zenoh-cpp 0.6.6 has invalid transport_optimization field | |
| CONFIG_FILE="/opt/ros/kilted/share/rmw_zenoh_cpp/config/DEFAULT_RMW_ZENOH_SESSION_CONFIG.json5" | |
| if grep -q "transport_optimization" "$CONFIG_FILE" 2>/dev/null; then | |
| sed -i '/transport_optimization:/,/},$/d' "$CONFIG_FILE" | |
| echo "Fixed rmw_zenoh_cpp config by removing invalid transport_optimization section" | |
| fi | |
| - uses: actions/checkout@v4 | |
| - uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| - name: Setup Rust cache | |
| uses: Swatinem/rust-cache@v2 | |
| with: | |
| shared-key: ${{ matrix.distro }}-interop | |
| - name: Install cargo-nextest | |
| uses: taiki-e/install-action@v2 | |
| with: | |
| tool: cargo-nextest | |
| - name: Run interop tests | |
| shell: bash | |
| run: | | |
| source /opt/ros/${{ matrix.distro }}/setup.bash | |
| export RMW_IMPLEMENTATION=rmw_zenoh_cpp | |
| export RUST_LOG=hiroz=debug,zenoh=warn | |
| FEATURES="${{ matrix.hiroz_feature }}" | |
| if [ "$FEATURES" = "humble" ]; then | |
| cargo nextest run -p hiroz-tests --profile interop \ | |
| --no-default-features --features ros-interop,humble | |
| else | |
| cargo nextest run -p hiroz-tests --profile interop \ | |
| --features "ros-interop,$FEATURES" | |
| # dynamic_subscriber tests are all #[ignore]'d in CI (ros2 topic | |
| # pub isn't graph-visible under CI's rmw_zenoh_cpp — see | |
| # headless_test.rs). --no-tests=warn keeps that from failing the job. | |
| cargo nextest run -p hiroz-union --profile interop \ | |
| --features ros-interop \ | |
| -E 'test(dynamic_subscriber)' \ | |
| --no-tests=warn | |
| fi | |
| - uses: actions/setup-go@v5 | |
| with: | |
| go-version: '1.23' | |
| cache: false | |
| - name: Build Rust FFI library + example binaries | |
| run: | | |
| FEATURES="ffi,${{ matrix.hiroz_feature }},rmw-zenoh" | |
| cargo build --release --no-default-features --features "$FEATURES" \ | |
| --lib --example z_pubsub --example z_srvcli --example zenoh_router | |
| - name: Generate Go message types (bundled IDL) | |
| run: | | |
| mkdir -p _tmp crates/hiroz-go/generated | |
| cargo run -p hiroz-codegen --bin export_json -- \ | |
| --assets crates/hiroz-codegen/assets/jazzy \ | |
| --output _tmp/go-manifest.json \ | |
| --packages builtin_interfaces,service_msgs,action_msgs,unique_identifier_msgs,std_msgs,example_interfaces | |
| cd crates/hiroz-codegen-go && go run . \ | |
| -input ../../_tmp/go-manifest.json \ | |
| -output ../hiroz-go/generated \ | |
| -prefix github.com/ZettaScaleLabs/hiroz/crates/hiroz-go | |
| - name: Go vet (static analysis) | |
| run: nu scripts/test-go.nu --vet-only | |
| - name: Run Go integration tests (Go↔Go + Go↔Rust + Go↔ROS2) | |
| shell: bash | |
| run: | | |
| source /opt/ros/${{ matrix.distro }}/setup.bash | |
| export RMW_IMPLEMENTATION=rmw_zenoh_cpp | |
| nu scripts/test-go.nu --integration |