Yami Odymel
Yami Odymel

Reputation: 1898

Do you have to run test locally when you have a CI server?

I have a CI server, and I'm wondering if I still have to run test locally or just committing my changes, and push it to GitHub, then run the test on the CI server.

My laptop is slow for compiling, running programs. I also need to open MySQL, NSQ, Redis.. at the same time for testing environment.

If I decided to run the test on the CI server, things would be a lot easier. But I'll have to commit/push the project each time I changed the code (even just for a single character), so I can know if I broke the project or not.

Do people still run the tests locally even if they have a CI server?

Upvotes: 4

Views: 627

Answers (2)

dhumketu
dhumketu

Reputation: 362

It depends on so many factors. How much time does it take to run tests? Is CI server capable of handling this request. I have seen often that people don't have enough agents to handle all requests. If you are using Git and tests don't take much time, you can create new Develop branch and commit changes to this branch. Enable CI server to run for this branch. If test results are acceptable you can merge Develop branch to main branch.

Upvotes: 1

VonC
VonC

Reputation: 1324013

Do people still run the tests locally even if they have a CI server?

Yes, because unit-tests are supposed to be fast.
And there are other tools analyzing your code locally (SonarQube for instance), in order to detect bad practices. Or Linters, directly integrated to your IDE.

The tests run at the CI levels are more to double-check if everything is still OK even when you start with a fresh workspace, instead of your local development environment where you might have some "cache" issue (because you never deleted your workspace, and some old static files make the tests pass)

Plus the same static code analysis can be run and publish to a SonarQube server, for keeping track of code issue trends (as opposed to your own local environment, where you only see a snapshot)

Upvotes: 5

Related Questions