Packaging Tests
This guide explains how to package your tests for upload to the Roboticks platform using thepackage_tests.sh script.
Prerequisites
Before packaging, ensure you have:- Test files in a
tests/directory (or custom location) - roboticks-tests submodule initialized (for the test framework)
Using package_tests.sh
Thetools/package_tests.sh script packages your tests with the test framework:
Basic Usage
build/test-package.tar.gz with default settings.
With Options
Available Options
| Option | Description | Default |
|---|---|---|
--name NAME | Package name | my-tests |
--version VERSION | Version string | 1.0.0 |
--tests-dir DIR | Tests directory | tests/ |
--output FILE | Output tarball path | build/test-package.tar.gz |
--help | Show help message | - |
Package Contents
The generated tarball contains:VERSION File
The VERSION file contains metadata:Uploading to Platform
After packaging, upload using the CLI:CLI Options
| Option | Description | Required |
|---|---|---|
--file FILE | Path to tarball | Yes |
--name NAME | Package name | Yes |
--version VERSION | Version string | Yes |
--description DESC | Description | No |
Directory Structure Requirements
For the test framework to work correctly, your tests must follow this structure when extracted:Custom Packaging
If you need more control, you can create packages manually:Manual Packaging
Without Test Framework (Direct Mode)
If you don’t need the test framework orchestrator, you can package just your tests:test-framework/runner.py is absent, the test runner uses a default execution script inside the Docker container:
- Test runner starts the Docker container with a default entrypoint script
- The script starts the device manager process
- Device manager discovers compositions automatically from the deployment directory using its config
- The script executes
ROBOTICKS_TEST_COMMAND(e.g.,pytest tests/ -v) - The script stops the device manager when tests complete
In direct mode, the device manager handles composition discovery and lifecycle itself based on its configuration. This is simpler but offers less customization than the Python-based
runner.py orchestrator.Use direct mode when:- You have simple tests that don’t need custom orchestration
- The device manager’s built-in composition discovery is sufficient
- You prefer the default script to handle the device manager lifecycle
Versioning Strategy
We recommend semantic versioning for test packages:- MAJOR - Breaking changes to test structure or dependencies
- MINOR - New tests or features
- PATCH - Bug fixes to existing tests
CI/CD Integration
GitHub Actions Example
Troubleshooting
Test framework not found
Test framework not found
Ensure the roboticks-tests submodule is initialized:
No test files found
No test files found
Verify your tests directory contains
test_*.py files:Upload fails
Upload fails
Check your API key and organization permissions:
Tests not running in test-framework mode
Tests not running in test-framework mode
Verify
test-framework/runner.py exists in the extracted package: