@cryptotaxi247 / kubo / commits / c8e7a9564

Add an EXPENSIVE prereq and use it in t0040

We add this prereq to tests with a 100MB file as they are slow on Travis CI. License: MIT Signed-off-by: Christian Couder <chriscool@tuxfamily.org>

Christian Couder committed Nov 20, 2014 at 20:27 UTC c8e7a95644fb4d67ffddc4b4999339dbffdc10e6
2 files changed +13 -14
test/lib/test-lib.sh
+1
@@ -29,6 +29,7 @@ SHARNESS_LIB="lib/sharness/sharness.sh"
29 # Please put go-ipfs specific shell functions below
30
31 test "$TEST_NO_FUSE" != 1 && test_set_prereq FUSE
32 +test "$TEST_EXPENSIVE" = 1 && test_set_prereq EXPENSIVE
33
34 test_cmp_repeat_10_sec() {
35 for i in 1 2 3 4 5 6 7 8 9 10
test/t0040-add-and-cat.sh
+12 -14
@@ -42,47 +42,45 @@ test_expect_success "go-random is installed" '
42 type random
43 '
44
45 -test_expect_success "generate 100MB file using go-random" '
45 +test_expect_success EXPENSIVE "generate 100MB file using go-random" '
46 random 104857600 42 >mountdir/bigfile
47 '
48
49 -test_expect_success "sha1 of the file looks ok" '
49 +test_expect_success EXPENSIVE "sha1 of the file looks ok" '
50 echo "885b197b01e0f7ff584458dc236cb9477d2e736d mountdir/bigfile" >sha1_expected &&
51 shasum mountdir/bigfile >sha1_actual &&
52 test_cmp sha1_expected sha1_actual
53 '
54
55 -test_expect_success "ipfs add bigfile succeeds" '
55 +test_expect_success EXPENSIVE "ipfs add bigfile succeeds" '
56 ipfs add mountdir/bigfile >actual
57 '
58
59 -test_expect_success "ipfs add bigfile output looks good" '
59 +test_expect_success EXPENSIVE "ipfs add bigfile output looks good" '
60 HASH="QmWXysX1oysyjTqd5xGM2T1maBaVXnk5svQv4GKo5PsGPo" &&
61 echo "added $HASH mountdir/bigfile" >expected &&
62 test_cmp expected actual
63 '
64
65 -test_expect_success "ipfs cat succeeds" '
65 +test_expect_success EXPENSIVE "ipfs cat succeeds" '
66 ipfs cat $HASH | shasum >sha1_actual
67 '
68
69 -# this test commented out to run faster.
70 -# uncomment to produce and examine output
71 -# test_expect_success "ipfs cat output looks good" '
72 -# ipfs cat $HASH >actual &&
73 -# test_cmp mountdir/bigfile actual
74 -# '
69 +test_expect_success EXPENSIVE "ipfs cat output looks good" '
70 + ipfs cat $HASH >actual &&
71 + test_cmp mountdir/bigfile actual
72 +'
73
76 -test_expect_success "ipfs cat output shasum looks good" '
74 +test_expect_success EXPENSIVE "ipfs cat output shasum looks good" '
75 echo "885b197b01e0f7ff584458dc236cb9477d2e736d -" >sha1_expected &&
76 test_cmp sha1_expected sha1_actual
77 '
78
81 -test_expect_success FUSE "cat ipfs/bigfile succeeds" '
79 +test_expect_success FUSE,EXPENSIVE "cat ipfs/bigfile succeeds" '
80 cat ipfs/$HASH | shasum >sha1_actual
81 '
82
85 -test_expect_success FUSE "cat ipfs/bigfile looks good" '
83 +test_expect_success FUSE,EXPENSIVE "cat ipfs/bigfile looks good" '
84 test_cmp sha1_expected sha1_actual
85 '
86