summaryrefslogtreecommitdiffstats
path: root/.travis.yml
diff options
context:
space:
mode:
authorAustin S. Hemmelgarn <austin@netdata.cloud>2019-12-19 08:41:42 -0500
committerGitHub <noreply@github.com>2019-12-19 08:41:42 -0500
commit23973d7f2abb0649109a0099d322592167ece06d (patch)
tree9f863002646e1e89aaa6f28a29ec0606d168eddf /.travis.yml
parentce9f70d7b3696a54f099628f3337f5c4d5bd1407 (diff)
Skip unit testing during CI when it's not needed. (#7559)
* Skip unit testing during CI when it's not needed. Our current unit testing takes almost 20 minutes on average during the CI process, which is almost twice as long as any other step, and it's only going to get longer as we get better test coverage. This commit slightly alters how we handle unit testing during CI so that only those unit tests which are actually needed get run. This is achieved by using the `$TRAVIS_COMMIT_RANGE` environment variable provided by Travis to determine which commits we're actually testing, and then using that information to query Git for what files actually changed. As of right now, the only unit testing we're doing is in the dbengine code, so we check to see if any of those files or the C unit testing files are modified by the PR and only runs the unit tests for those if they were modified. The checks are a bit more wide-ranging than they probably need to be so that we make sure to avoid any false negatives. This should speed up CI checks for PR's (as well as not monopolizing the master branch after every PR that gets merged). * Restructure to better handle PR's. The previous code did not work correctly with PR's because it ignored the fact that Travis does not appear to report the full list of commits for a PR in `TRAVIS_COMMIT_RANGE`, instead only reporting the most recent set of commits that were pushed. * Add listing of commits being checked. This will allow for verification of what is being tested, making it easier to spot issues with the detection logic. * Don't assume PR's are targeting the master branch.
Diffstat (limited to '.travis.yml')
-rw-r--r--.travis.yml6
1 files changed, 4 insertions, 2 deletions
diff --git a/.travis.yml b/.travis.yml
index b5c938bcf6..8ca7169411 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -154,9 +154,11 @@ jobs:
name: Unit Testing
script:
- - fakeroot ./netdata-installer.sh --install $HOME --dont-wait --dont-start-it --enable-plugin-nfacct --enable-plugin-freeipmi --disable-lto
- - $HOME/netdata/usr/sbin/netdata -W unittest
+ - .travis/run-unit-tests.sh
env: CFLAGS='-O1 -DNETDATA_INTERNAL_CHECKS=1 -DNETDATA_VERIFY_LOCKS=1'
+ # We need a full deep clone for the checks done by the unit testing script to work.
+ git:
+ depth: false
after_failure: post_message "TRAVIS_MESSAGE" "Unit testing failed"
- name: Build/Install for ubuntu 18.04 (not containerized)