Close

Servio Overview (Part 4/5) - Continuous Integration

A project log for Servio

Open-source DC servomotor with extensive testing infrastructure.

veverakveverak 02/16/2024 at 21:380 Comments

We can think of Continuous Integration (CI) in two ways: as an approach to development and as infrastructure. For Servio, both aspects are relevant, as we heavily utilize CI for development.

As a development approach, the philosophy centers on continuously testing new changes to ensure they do not disrupt the system as a whole. This contrasts with making large changes and integrating them into the system sporadically to see if anything breaks. Essentially, it emphasizes incremental updates.

Ater we re-factored code for static-friction compensation, we run step velocity test... to find out immediatly that the refactoring has some issues. (Executed on real hardware)

From a coding perspective, we often use a powered test jig on the desk and periodically run the full test suite with it. This practice helps us identify any errors or issues introduced by changes—sometimes these are bugs, and sometimes they are expected outcomes.

Technically, we hide the testjig in a shelf in some cases, so it's not on the table

Another perspective involves the backend connected to the server. Once any change is committed and merged into the main git repository, the same testing process automatically occurs in the background for each commit.

Screenshot of HTML report produced by GitHub runner.

emlabcpp and joque

Regarding the library subprojects, emlabcpp and joque, each has its own CI setup and pipelines.

From Servio's perspective, these libraries should be tested through their own mechanisms without any explicit testing on Servio's part.

Docker container

Regarding Docker containers, we opted for an automated build and testing environment by creating a Docker image based on the official Arch Linux distribution. We simply add our build tools and dependencies to this image and use it across all our pipelines for repositories. This image is publicly available, and we encourage its use. Dockerfile is here.

Public repo

Our public repository builds everything in CI and runs unit tests to ensure the build is independent of any specific details of the developers' environment. The unit tests check basic functionality, but due to their limited coverage, more comprehensive testing is conducted in the private repository.

Private repo

For the private repository, we have a GitHub runner for pipelines, equipped with a smaller version of the test jig with a Servio PCB permanently connected. Currently, this test jig is unpowered and disconnected, as leaving a power source permanently enabled presents a risk. This setup resides in my living room, and I have yet to decide to leave any power source permanently on for an automatically starting device.

PCB For GitHub runner - Is it just a PCB laying on shelf somewhere close to USB hub? yes!

For each commit in the private repository, we initiate a build of all firmware and tests on our runner and execute a full suite of tests. The test suite can be adjusted for an unpowered scenario, affecting many tests, some skip themselves, while others simply disable evaluation.

Discussions