btrfs-progs: tests: pull and build reiserfs lib inside CI
authorDavid Sterba <dsterba@suse.com>
Mon, 28 Aug 2017 12:28:53 +0000 (14:28 +0200)
committerDavid Sterba <dsterba@suse.com>
Fri, 8 Sep 2017 14:15:05 +0000 (16:15 +0200)
The functionality needed to support reiserfs in convert has been added
recently and is not yet available in the CI images, so we'll download
and build it there.

Signed-off-by: David Sterba <dsterba@suse.com>
.travis.yml
travis-should-run-test [new file with mode: 0755]

index 15313df..b5cc7fe 100644 (file)
@@ -23,7 +23,8 @@ compiler:
   - gcc
   - clang
 
-cache: ccache
+cache:
+  ccache: true
 
 git:
   depth: 2
@@ -60,8 +61,19 @@ addons:
     branch_pattern: coverity_scan
 
 script:
+  - "mkdir tmp-reiser;
+     cd tmp-reiser;
+     wget https://www.kernel.org/pub/linux/kernel/people/jeffm/reiserfsprogs/v3.6.27/reiserfsprogs-3.6.27.tar.xz;
+     tar xf reiserfsprogs-3.6.27.tar.xz;
+     cd reiserfsprogs-3.6.27;
+     ./configure --prefix=/usr;
+     make all;
+     sudo make install;
+     cd ../..
+    "
   - "./autogen.sh && ./configure --disable-documentation && make"
-  - "make TEST_LOG=dump test-cli"
-  - "make TEST_LOG=dump test-mkfs"
-  - "make TEST_LOG=dump test-check"
-  - "make TEST_LOG=dump test-misc"
+  - "if ./travis-should-run-test; then make TEST_LOG=dump test-cli; fi"
+  - "if ./travis-should-run-test; then make TEST_LOG=dump test-mkfs; fi"
+  - "if ./travis-should-run-test; then make TEST_LOG=dump test-check; fi"
+  - "if ./travis-should-run-test; then make TEST_LOG=dump test-misc; fi"
+  - "if [ $TRAVIS_BRANCH = release-test ]; then make TEST_LOG=dump test-convert; fi"
diff --git a/travis-should-run-test b/travis-should-run-test
new file mode 100755 (executable)
index 0000000..f711615
--- /dev/null
@@ -0,0 +1,24 @@
+#!/bin/sh
+
+if [ -z "$TRAVIS_BRANCH" ] ; then
+       # no branch? run anyway
+       exit 0
+fi
+
+# no tests
+if [ "$TRAVIS_BRANCH" = 'coverity_scan' ]; then
+       exit 1
+fi
+
+# quick tests
+if [ "$TRAVIS_BRANCH" = 'devel' -o "$TRAVIS_BRANCH" = 'master' ]; then
+       exit 0
+fi
+
+# all tests
+if [ "$TRAVIS_BRANCH" = 'release-test' ]; then
+       exit 0
+fi
+
+# branch not recognized
+exit 1