Continuous Integration
Redox uses GitLab CI for automated testing on all merge requests targeting themaster branch.
CI Pipeline Stages
1
Lint Stage
The lint stage ensures code quality and style compliance.
- rustfmt
- cargo-test
Checks Rust code formatting:Run locally:
2
Test Stage
The test stage builds images and validates packaging.
- Image Build
- Package Validation
Builds system images:Run locally:
CI Workflow Rules
The CI pipeline runs automatically when:- Commits to
masterbranch in theredox-osnamespace - Merge requests targeting
master
Local Testing
Pre-commit Testing
Before creating a merge request, run these tests locally:1
Format check
2
Run unit tests
3
Build test
4
QEMU test run
Configuration-based Testing
Redox provides several test configurations:- tests.toml
- os-test.toml
- auto-test.toml
Standard testing configuration:Build and test:
CI Image Building
The CI system builds standard images for all architectures:Build CI Images
server- Server configurationdesktop- Desktop configurationdemo- Demo configuration
Images are created in
build/img/$(ARCH)/ with the naming format:redox_<config>_<tag>_harddrive.img.zstredox_<config>_<tag>_livedisk.iso.zst
SHA256SUM file is also generated for verification.Customize Image Naming
Individual Configuration Builds
OS Testing
Run comprehensive OS-level tests:1
Clean previous test
2
Run tests in QEMU
3
Extract test results
Test Recipes
Redox includes several test recipes:Hello World Tests
Multi-language hello world tests inrecipes/tests/hello-redox/files/:
test.c- C testtest.cpp- C++ testtest.go- Go testtest.java- Java testtest.js- JavaScript testtest.lua- Lua testtest.py- Python testtest.rs- Rust testtest.zig- Zig test
Automated Testing
Theauto-test recipe group includes an Ion script for automated testing:
Testing Specific Components
- Recipe Testing
- Kernel Testing
- Driver Testing
- relibc Testing
Test a specific recipe:
Automated Testing in CI
Toolchain Testing
Build and package the toolchain:gcc-install.tar.gzrelibc-install.tar.gzrust-install.tar.gzclang-install.tar.gzSHA256SUM
build/toolchain/$(HOST_TARGET)/$(TARGET)/
Multi-Architecture Testing
Test packaging for all architectures:Regression Testing
1
Identify regression
Note the commit where the issue started.
2
Use git bisect
3
Test each commit
4
Find the culprit
Git bisect will identify the problematic commit.
Performance Testing
Benchmark Configuration
Use the tests configuration with benchmarks:tests.toml includes the benchmarks package.
Timing Builds
Test Coverage
Test coverage for Rust code can be generated using
cargo-tarpaulin or cargo-llvm-cov.Testing Best Practices
Before Submitting MR
Before Submitting MR
1
Format code
2
Run tests
3
Build and test
4
Test on multiple configs
Testing Cross-Platform
Testing Cross-Platform
Test your changes on all supported architectures:
Testing with Different Settings
Testing with Different Settings
Vary QEMU settings to catch edge cases:
Troubleshooting Tests
Tests Fail Locally But Pass in CI
Tests Fail Locally But Pass in CI
- Ensure your build environment matches CI (use podman)
- Check for uncommitted changes
- Verify dependencies are up-to-date:
make pull - Clean and rebuild:
make clean && make all
Tests Pass Locally But Fail in CI
Tests Pass Locally But Fail in CI
- Check CI logs for specific errors
- Verify all files are committed
- Ensure no local-only configuration
- Test with
PODMAN_BUILD=0like CI does
Intermittent Test Failures
Intermittent Test Failures
- May be timing-related (try
kvm=no) - Check for race conditions
- Test with different QEMU_SMP values
- Review serial logs:
make qemu serial=yes qemu_serial_logfile=test.log
Additional Resources
CI Configuration
View the complete CI configuration
Developer FAQ
Common testing questions
Debugging Guide
Debug failing tests
Build System Reference
Complete build system documentation
Next Steps
Contributing Guide
Review contribution guidelines
Development Workflow
Learn the development process