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 automated tests before generating a new Docker image to avoid pushing non-working code on master branch #79

Open
tigerblue77 opened this issue Jan 29, 2024 · 7 comments
Assignees
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@tigerblue77
Copy link
Owner

No description provided.

@7Adrian
Copy link

7Adrian commented Nov 20, 2024

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
Copy link
Owner Author

@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
Copy link

7Adrian commented Nov 20, 2024

@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
Copy link
Owner Author

It sounds good ! Thanks for the advice

@7Adrian
Copy link

7Adrian commented Nov 21, 2024

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.

@blstmo
Copy link

blstmo commented Dec 16, 2024

@tigerblue77 Idrac is a pain to unit test with I think you would have a public idrac instance

@tigerblue77
Copy link
Owner Author

@blstmo can you elaborate please ? I didn't have time to check yet but @7Adrian seems to have developed a good basis for these tests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants