Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can Travis-CI test diff instead of all files?

We would like to improve our code quality, but we’re working on legacy code and using Travis-CI now would trigger lots of changes that the team won’t be able to handle.

To improve code step by step, I was wondering if there is a way to check only modified files, or even better: just the modified lines.

We could get rid of inconsistencies as we code and switch to “all code coverage” once we feel we have the time for it.

like image 744
arkhi Avatar asked Oct 02 '15 04:10

arkhi


People also ask

Which of the following file is used to configure the Travis CI?

Configuration. Travis CI is configured by adding a file named . travis. yml , which is a YAML format text file, to the root directory of the repository.

Which of the following analysis tool is used for code coverage in Travis CI?

Coveralls is a hosted analysis tool, providing statistics about your code coverage. Configuring your Travis CI build to send results to Coveralls always follows the same pattern: Add your repository to Coveralls.

How do you speed up Travis CI?

To speed up a test suite, you can break it up into several parts using Travis CI's build matrix feature. Say you want to split up your unit tests and your integration tests into two different build jobs. They'll run in parallel and fully utilize the available build capacity for your account.


1 Answers

Travis-CI runs on a Git repository with the code checked-out. You can teach your test scripts to run git diff --name-only HEAD^ to get the modified files, and then run only the tests corresponding to them.

like image 93
Matthieu Moy Avatar answered Sep 30 '22 03:09

Matthieu Moy