10000 GitHub - EmirTutar/ECAL_Test_Framework
[go: up one dir, main page]

Skip to content

EmirTutar/ECAL_Test_Framework

Repository files navigation

eCAL integration Tests

This repository contains automated integration tests for eCAL. It is designed to run and validate communication scenarios between multiple processes using eCAL middleware.

Table of Contents

  1. Introduction

  2. Purpose

  3. Features

  4. Test Scenarios

  5. Test Reports

  6. Triggering Tests

  7. Note for Forks

  8. Feedback to eCAL Repo

  9. Requirements

  10. Structure

  11. Local Development with VS Code

  12. Creating New Tests

Purpose

The main goal of this project is to provide:

  • Automated test runs on push, pull request, or schedule
  • Reliable feedback on message communication and process stability
  • Visual test reports for easy inspection

Features

  • Supports multiple eCAL transport layers (SHM, UDP, TCP)

  • Covers common scenarios such as:

    • Publisher to Subscriber communication
    • Multi-publisher and multi-subscriber setups
    • Fault injection (e.g., crashing subscribers or publishers)
    • Network failure simulations
  • Test results are published to GitHub Pages

  • Integration in eCAL repositori via repository_dispatch

Test Scenarios

Each test case is implemented using Robot Framework, with Docker-based isolation.

Test Case Description README
basic_pub_sub Simple 1:1 publisher-subscriber communication README
multi_pub_sub Multiple publishers and subscribers (N:N) README
network_crash Local UDP works after network disconnect README
pub_crash One publisher crashes mid-test README
sub_crash Subscriber crashes during message receive README
sub_send_crash Subscriber crashes during send/zero-copy test README
rpc_ping_test Simple RPC test with one client calling one server README
rpc_reconnect_test RPC client disconnects and reconnects during the test README
rpc_n_to_n_test Multiple RPC clients call multiple RPC servers (N:N) README

Test Reports

Test results are automatically deployed to: 👉 https://emirtutar.github.io/ECAL_Test_Framework

Each run is timestamped and archived, with access to:

  • log.html
  • report.html
  • output.xml

Triggering Tests

Tests can be triggered in three ways:

  1. Manually via GitHub Actions
  2. Automatically from the eCAL repository using repository_dispatch (Create a PR or Push to Master)

Note for Forks

If you are working on a fork of the official eCAL repository (e.g., UserName/ecal) and you create a pull request or push from develop to master within your fork, you need to allow GitHub Actions to trigger the integration tests in this repository.

To do so, follow these steps:

1. Create a Personal Access Token (PAT):

  1. Go to your GitHub Developer Settings → Personal Access Tokens.
  2. Click on “Generate new token (classic)”.
  3. Set a name like ECAL Test Trigger Token.
  4. Set an expiration (e.g., 90 days or custom).
  5. Under Scopes, enable:
  • repo (for private forks)

    or

  • public_repo (for public forks only)

  1. Click Generate token and copy it immediately. You won't see it again.

2. Add the Token to Your Forked eCAL Repository:

  1. Go to your forked repository on GitHub (e.g., UserName/ecal).
  2. Navigate to: Settings → Secrets and variables → Actions → New repository secret.
  3. Name the secret exactly:
TEST_FRAMEWORK_TOKEN
  1. Paste the copied token as the value.
  2. Click Add secret.
  3. Once added, GitHub Actions in your fork can use this token to trigger the test framework via repository_dispatch.

⚠️ This is only needed for forks. If you push or create PRs directly in eclipse-ecal/ecal, no token is required.

Feedback to eCAL Repo

After the test run finishes, the result (pass/fail) is reported back to the Pull Request in the eCAL repository as a commit status.

Requirements

  • eCAL (If you build without Docker)
  • Docker
  • Python 3
  • Robot Framework

Structure

.
├── integration_tests/                       # Main directory for all test cases and supporting infrastructure
│   ├── basic_pub_sub/                       # Test case: simple 1:1 publisher-subscriber communication
│   ├── multi_pub_sub/                       # Test case: multiple publishers and subscribers (N:N)
│   ├── network_crash/                       # Test case: test resilience after network disconnect
│   ├── pub_crash/                           # Test case: publisher crashes mid-transmission
│   ├── sub_crash/                           # Test case: subscriber crashes during reception
│   ├── sub_send_crash/                      # Test case: subscriber crashes during send (zero-copy stress)
│   ├── rpc_ping_test/                       # Test case: basic RPC ping between client and server
│   ├── rpc_reconnect_test/                  # Test case: RPC reconnects after temporary disconnect
│   ├── lib/                                 # Shared helper libraries used by multiple test cases
│   │   ├── EcalConfigHelper/                # C++ helper to configure eCAL transport modes
│   │   ├── DockerLibrary.py                 # Robot Framework library to manage Docker containers
│   │   └── GlobalPathsLibrary.py            # Library to manage paths, container names, and image tags
│   └── docker/                              # Base Dockerfile used to build test environments
│       └── Dockerfile.ecal_base             # Base image with all dependencies (eCAL, build tools)
│
├──  create_new_test/                        # Generator to create new test case folder structure
│       ├── create_new_test.py               # Python script to auto-generate new test case folders
│       └── templates/                       # Jinja2 templates used by the generator
│
├── .devcontainer/                           # Devcontainer setup for local development in VS Code
│   ├── devcontainer.json                    # Container definition for VS Code Remote Containers
│   └── README.md                            # Instructions for using the dev container setup
│
├── .github/                                 # GitHub Actions CI configuration
│   └── workflows/
│       └── run-tests.yml                    # Main workflow file to build, test, and publish reports
└── README.md                                # Main documentation file of the repository

Local Development with VS Code

If you want to develop and run the tests locally in VS Code without getting header errors (e.g. eCAL or TCLAP not found), we recommend using the included .devcontainer setup.

Steps:

  1. Make sure Docker and VS Code are installed.
  2. Install the Dev Containers extension in VS Code.
  3. Open this repository in VS Code.
  4. When prompted, click "Reopen in Container".
  5. VS Code will build and open a full-featured development environment inside Docker.

This container is based on the same Docker image used for testing, so all dependencies like eCAL and TCLAP are pre-installed. You can develop and run Robot Framework tests directly without needing to configure anything on your host system.

For more details, see: .devcontainer/README.md

Creating New Tests

To create a new test case folder automatically, use the generator in create_new_test/.

See: create_new_test/README.md

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  
0