I am trying to come up with the best solution for CI for a group of about 10 developers when it comes to testing a web interface. All I need is for a test suite to run when any of the devs push their code. I don't need to worry about building/compiling or deployment because we have other teams for that. I have considered Jenkins, but have read it can be tedious to set up, requires maintenance and takes up a lot of disk space. In my situation using Jenkins seems like an unnecessary amount of work and just using Git hooks might be better, but I have also read using Git hooks alone for CI is bad practice. Would one of these be the best solution, or is there something else I have not considered?
Asked
Active
Viewed 1,045 times
8
-
Your terminology seems a bit confused. I'm not sure what "using Git hooks alone" would mean, or why using Git hooks to start some process would be considered a bad idea (especially in comparison to polling for changes). If you're not using a system like Jenkins, what would be reacting to the incoming webhooks? The most common use for Jenkins is to build and test software, so it seems like it would be a reasonable choice. It's not clear why you would want to have this separate from the compiling and deployment (which would hopefully also be done by Jenkins?), but Jenkins should fit fine here. – Christopher Orr Mar 17 '17 at 09:57
-
1@ChristopherOrr Apologies if my explanation is confusing, I don't have experience with git hooks or Jenkins yet. At first I thought a git hook could be used to trigger the entire test suite to run on a dev's machine each time they push but as Stony mentioned below that would probably not be ideal. Your comment made me realize this situation is as simple as I had first realized haha. Thank you – Tom Mar 17 '17 at 15:22
-
Note: Git 2.36 (Q1 2022) will come with [`git hook run [--ignore-missing]
[-- – VonC Feb 13 '22 at 14:44]`](https://stackoverflow.com/a/71101716/6309)!
1 Answers
2
Jenkins is a deployment system which can run defined tasks and tests on your code and build that code for your production systems. If some of that tests fail it stops building. The installation of Jenkins is very easy.
So testing is normally a step in the deployment process. You should run the tests before your changes go live to prevent errors.
I don't know if it's a good idea to run your complete tests on every push. If you have some tests that have a long running time it can cause errors if a lot of people push your changes.
In your case i would prefer a code review system like Gerrit or the build in systems in Github or Bitbucket. Then 2 people have to check the code and can check if there are some errors.

René Höhle
- 26,716
- 22
- 73
- 82
-
The first part of this answer makes sense, but suggesting using code review as an _alternative_ to automated testing doesn't really fit. – Christopher Orr Mar 17 '17 at 09:58
-
1Instead of running the test everytime you can check your code with 2 people and then one of them have to run the tests to test the changes ;) it's a workaround... – René Höhle Mar 17 '17 at 10:20