Skip to content

Adds Config & Integration testing support#14

Merged
raffael0 merged 5 commits intomainfrom
feat/config-integrationtest
May 5, 2026
Merged

Adds Config & Integration testing support#14
raffael0 merged 5 commits intomainfrom
feat/config-integrationtest

Conversation

@raffael0
Copy link
Copy Markdown
Member

This PR introduces end-to-end integration test coverage for running FerroFlow against the ECUEmulator.

  • Adds an ECUEmulator integration test that:
    • Ensures a vcan interface exists on the host for SocketCAN communication
    • Starts the ecuemulator docker image using testcontainers
    • Runs FerroFlow in a scoped thread and polls NodeManager until the emulator registers
    • Streams container logs into the test output
    • Requests a clean shutdown via Event::Shutdown

I've also added support for filtering the event_dispatcher events. For every subscribe call one has to provide a list of EventKinds of the events which it should be triggered by. Also I added Event::Shutdown subscriptions for all threads for a graceful shutdown of the system.

To create the vcan interfaces I had to add a custom ip wrapper which we can give specific networking capabilities to. The idea is that the developer builds this once, places it in their Path and then the tests can be run automatically. Kind of hacky but it works. Otherwise all integration tests would need to be run with sudo

Related: SpaceTeam/ECUEmulator#17
closes: #3 #5

Note that i'll change the ecuemulator docker container once the other PR is merged

@raffael0 raffael0 requested a review from miDeb April 22, 2026 14:11
@raffael0 raffael0 force-pushed the feat/config-integrationtest branch from 55551ad to 84c7809 Compare April 22, 2026 14:16
@raffael0 raffael0 requested a review from fweichselbaum April 22, 2026 14:16
 - Add a new integration test that boots the ecuemulator: container via testcontainers
 - Inject ECUEmulator TOML config into the container at startup (with_copy_to + CONFIG_PATH)
 - Run FerroFlow in a scoped thread and poll NodeManager for registration progress
 - Stream container stdout/stderr into the test output for easier debugging
 - Trigger a clean shutdown at the end of the test via Event::Shutdown
@raffael0 raffael0 force-pushed the feat/config-integrationtest branch from 84c7809 to d6aadaa Compare April 22, 2026 14:29
@raffael0 raffael0 force-pushed the feat/config-integrationtest branch from bdf06b3 to 809f898 Compare April 22, 2026 14:57
Copy link
Copy Markdown
Member

@miDeb miDeb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, just some comments

Comment thread src/can/mod.rs Outdated
Comment thread src/lib.rs Outdated
Comment thread src/events/mod.rs Outdated
Comment thread tests/common.rs Outdated
@raffael0 raffael0 force-pushed the feat/config-integrationtest branch from 0eb959c to 3e3316b Compare April 27, 2026 15:40
@raffael0 raffael0 force-pushed the feat/config-integrationtest branch from 3e3316b to 940bc7a Compare April 27, 2026 15:42
previously this was done asynchronously in the can send thread itself, potentially causing a race condition
@miDeb miDeb mentioned this pull request May 4, 2026
@raffael0 raffael0 merged commit e7a20e5 into main May 5, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Config Parsing

2 participants