Incorporate Docker for Testing LinuxCNC Components in CI Pipeline
Description:
Due to ongoing challenges in setting up a proper testing environment for LinuxCNC components in the CI pipeline, it may be beneficial to switch to a Docker-based approach. By leveraging a provided LinuxCNC Docker image, such as jeffersonjhunt/linuxcnc-docker, we can simplify the testing process and ensure that tests run in a consistent, isolated environment.
Modify the CI pipeline to pull and run the Docker container during the testing phase.
Ensure that the Docker container includes the necessary dependencies, such as pokeyslib, to run the tests effectively.
CI Pipeline Modification:
Update the pipeline configuration (e.g., .github/workflows/ci.yml) to include Docker commands that pull the relevant image and run tests inside the container.
Ensure the pipeline installs any additional requirements inside the Docker container, such as Python packages or compiled binaries related to LinuxCNC and PoKeys components.
Testing Inside Docker:
Ensure that the Docker container can properly simulate or mock PoKeys hardware for unit testing.
Configure mock environments for components like digital I/O, analog I/O, counters, PWM, and motion control (PEv2) to allow testing without physical hardware attached.
Implement scripts to interact with the LinuxCNC configuration files (hal, ini) inside the Docker container.
Benefits of Docker for Testing:
Consistency: Every test run in the same environment, reducing variability across different CI environments.
Simplicity: The Docker image provides a pre-configured LinuxCNC environment, which minimizes setup complexity in the CI pipeline.
Isolation: Running tests inside Docker ensures no interference with other system processes or environment variables.
Cross-platform Compatibility: The Docker image can be used across different platforms, making local testing and development easier for contributors.
Tasks:
[ ] Review and update CI pipeline to use the LinuxCNC Docker image for testing.
[ ] Ensure pokeyslib and any required PoKeys components are properly integrated inside the Docker container.
[ ] Create and run automated tests inside the Docker container for each PoKeys module (e.g., digital I/O, analog I/O, PEv2 motion control).
[ ] Mock PoKeys hardware for testing inside the Docker environment, ensuring tests run successfully without physical devices.
[ ] Validate the CI pipeline by running tests using the Docker image to confirm functionality.
Acceptance Criteria:
[ ] Docker image successfully integrated into the CI pipeline.
[ ] Tests for PoKeys components run successfully inside the Docker container without hardware dependencies.
[ ] CI pipeline passes consistently, with a simplified environment setup.
Incorporate Docker for Testing LinuxCNC Components in CI Pipeline
Description:
Due to ongoing challenges in setting up a proper testing environment for LinuxCNC components in the CI pipeline, it may be beneficial to switch to a Docker-based approach. By leveraging a provided LinuxCNC Docker image, such as jeffersonjhunt/linuxcnc-docker, we can simplify the testing process and ensure that tests run in a consistent, isolated environment.
Proposed Solution:
Docker Integration:
pokeyslib
, to run the tests effectively.CI Pipeline Modification:
.github/workflows/ci.yml
) to include Docker commands that pull the relevant image and run tests inside the container.Testing Inside Docker:
hal
,ini
) inside the Docker container.Benefits of Docker for Testing:
Tasks:
pokeyslib
and any required PoKeys components are properly integrated inside the Docker container.Acceptance Criteria:
Reference Links: