zarfld / LinuxCnc_PokeysLibComp

Pokeys comp for LinuxCnc using https://bitbucket.org/mbosnak/pokeyslib.git
MIT License
5 stars 0 forks source link

Incorporate Docker for Testing LinuxCNC Components in CI Pipeline #81

Open zarfld opened 20 hours ago

zarfld commented 20 hours ago

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:

  1. Docker Integration:

    • Utilize the LinuxCNC Docker image from the jeffersonjhunt/linuxcnc-docker repository for all LinuxCNC-related tests.
    • 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.
  2. 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.
  3. 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.
  4. 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:

Acceptance Criteria:

Reference Links: