Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CMock dependencies to Docker image (IDFGH-7808) #9342

Closed
robbawebba opened this issue Jul 12, 2022 · 4 comments
Closed

Add CMock dependencies to Docker image (IDFGH-7808) #9342

robbawebba opened this issue Jul 12, 2022 · 4 comments
Assignees
Labels
Resolution: Done Issue is done internally Status: Done Issue is done internally Type: Feature Request Feature request for IDF

Comments

@robbawebba
Copy link

Is your feature request related to a problem? Please describe.

I recently added mocking to my project's unit tests using the guide in the ESP-IDF documentation. Everything works well when building/testing locally for the esp32s3 target, and I'm very satisfied with CMock and its integration with the rest of the IDF build infrastructure.

The only downside is that the unit test build does not work when building in a Docker container using the espressif/idf docker image. My team uses the Docker image for both development and CI testing. This is due to ruby, a dependency of CMock, not being included in the Docker image by default, causing the mock generation build step to fail.

Describe the solution you'd like

I propose that ruby, and any other CMock dependencies, should be included in the espressif/idf Docker image by default. The ESP-IDF unit test documentation lists both ruby and libbsd-dev as requirements. So far I have not needed libbsd-dev, but if it is required for mocking in some scenarios, this dependency should also be included.

I enjoy using the unit testing and mocking system provided by ESP-IDF, and it seems like the developers are adopting CMock as the mocking framework of Choice. I believe adding the CMock dependencies to the Docker image will make it easier for more developers to start using mocking in their unit tests if they choose to do so.

Describe alternatives you've considered

In the meantime, I've worked around this issue by creating my own Docker image based on espressif/idf. My Dockerfile is as follows:

ARG IDF_VERSION=v4.4.1
FROM espressif/idf:${IDF_VERSION}

RUN apt-get update \
  && apt-get install -y --no-install-recommends \
    ruby \
  && apt-get autoremove -y \
  && rm -rf /var/lib/apt/lists/*
@robbawebba robbawebba added the Type: Feature Request Feature request for IDF label Jul 12, 2022
@espressif-bot espressif-bot added the Status: Opened Issue is new label Jul 12, 2022
@github-actions github-actions bot changed the title Add CMock dependencies to Docker image Add CMock dependencies to Docker image (IDFGH-7808) Jul 12, 2022
@0xjakob
Copy link
Collaborator

0xjakob commented Jul 13, 2022

@robbawebba Thanks for letting us know! I'll check but I think it should be straight-forward to add ruby and libbsd-dev.

@0xjakob 0xjakob self-assigned this Jul 13, 2022
@espressif-bot espressif-bot assigned 0xjakob and unassigned 0xjakob Jul 13, 2022
@0xjakob
Copy link
Collaborator

0xjakob commented Jul 13, 2022

@robbawebba We merged this internally already. During the next sync to github, it should be published.

@robbawebba
Copy link
Author

@0xjakob Great, thank you for your work and for the fast response!

@0xjakob
Copy link
Collaborator

0xjakob commented Jul 22, 2022

@robbawebba The image espressif/idf should contain ruby and libbsd now. Please give it a try.

@espressif-bot espressif-bot added Status: In Progress Work is in progress Resolution: Done Issue is done internally Status: Done Issue is done internally and removed Status: Opened Issue is new Status: In Progress Work is in progress labels Jul 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution: Done Issue is done internally Status: Done Issue is done internally Type: Feature Request Feature request for IDF
Projects
None yet
Development

No branches or pull requests

3 participants