tigerblue77 / Dell_iDRAC_fan_controller_Docker

Docker image to control your Dell PowerEdge fans via IPMI
Other
272 stars 66 forks source link

Add automated tests before generating a new Docker image to avoid pushing non-working code on master branch #79

Open tigerblue77 opened 10 months ago

7Adrian commented 1 week ago

How do you plan to incorporate this into the build process using GitHub Actions? Do you have any frameworks in mind for running those unit tests?

tigerblue77 commented 1 week ago

@7Adrian, no, I start from a blank page. I never wrote Docker/bash unit tests before, I did on Java, so I'm opened to any suggestion. I think a new GitHub action that would run before the current one would be a great start ? I have to read about GitHub CI/CD cause I'm a noob.

7Adrian commented 1 week ago

@tigerblue77 I'm thinking of trying bats (MIT) for unit tests. I don’t have much experience with GitHub CI/CD since I typically use Jenkins pipelines for that, but I’m hopeful that GitHub Actions will work well with it bats examples.

tigerblue77 commented 1 week ago

It sounds good ! Thanks for the advice

7Adrian commented 1 week ago

I added tests for calculating line interpolation. You can run them by simply typing:

./tests.sh

There are executed in docker container provided by bats maintainers. Any file from test directory which ends with *.bats will be executed.

If all tests pass, the script returns 0; otherwise, it returns 1. You can experiment with this to set up CI/CD.

Also remember to credits authors of that library.