Skip to content
This repository was archived by the owner on Sep 11, 2020. It is now read-only.

Commit 160e6d5

Browse files
authored
Merge pull request #786 from mcuadros/test-short
*: skip time consuming tests
2 parents a39fae6 + 4127002 commit 160e6d5

File tree

4 files changed

+48
-0
lines changed

4 files changed

+48
-0
lines changed

plumbing/format/packfile/encoder_advanced_test.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package packfile_test
33
import (
44
"bytes"
55
"math/rand"
6+
"testing"
67

78
"gopkg.in/src-d/go-git.v4/plumbing"
89
. "gopkg.in/src-d/go-git.v4/plumbing/format/packfile"
@@ -21,6 +22,10 @@ type EncoderAdvancedSuite struct {
2122
var _ = Suite(&EncoderAdvancedSuite{})
2223

2324
func (s *EncoderAdvancedSuite) TestEncodeDecode(c *C) {
25+
if testing.Short() {
26+
c.Skip("skipping test in short mode.")
27+
}
28+
2429
fixs := fixtures.Basic().ByTag("packfile").ByTag(".git")
2530
fixs = append(fixs, fixtures.ByURL("https://github.com/src-d/go-git.git").
2631
ByTag("packfile").ByTag(".git").One())
@@ -33,6 +38,10 @@ func (s *EncoderAdvancedSuite) TestEncodeDecode(c *C) {
3338
}
3439

3540
func (s *EncoderAdvancedSuite) TestEncodeDecodeNoDeltaCompression(c *C) {
41+
if testing.Short() {
42+
c.Skip("skipping test in short mode.")
43+
}
44+
3645
fixs := fixtures.Basic().ByTag("packfile").ByTag(".git")
3746
fixs = append(fixs, fixtures.ByURL("https://github.com/src-d/go-git.git").
3847
ByTag("packfile").ByTag(".git").One())

repository_test.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import (
1010
"os/exec"
1111
"path/filepath"
1212
"strings"
13+
"testing"
1314
"time"
1415

1516
"gopkg.in/src-d/go-git.v4/config"
@@ -430,6 +431,10 @@ func (s *RepositorySuite) TestPlainCloneContext(c *C) {
430431
}
431432

432433
func (s *RepositorySuite) TestPlainCloneWithRecurseSubmodules(c *C) {
434+
if testing.Short() {
435+
c.Skip("skipping test in short mode.")
436+
}
437+
433438
dir, err := ioutil.TempDir("", "plain-clone-submodule")
434439
c.Assert(err, IsNil)
435440
defer os.RemoveAll(dir)
@@ -1396,10 +1401,18 @@ func (s *RepositorySuite) testRepackObjects(
13961401
}
13971402

13981403
func (s *RepositorySuite) TestRepackObjects(c *C) {
1404+
if testing.Short() {
1405+
c.Skip("skipping test in short mode.")
1406+
}
1407+
13991408
s.testRepackObjects(c, time.Time{}, 1)
14001409
}
14011410

14021411
func (s *RepositorySuite) TestRepackObjectsWithNoDelete(c *C) {
1412+
if testing.Short() {
1413+
c.Skip("skipping test in short mode.")
1414+
}
1415+
14031416
s.testRepackObjects(c, time.Unix(0, 1), 3)
14041417
}
14051418

submodule_test.go

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"io/ioutil"
66
"os"
77
"path/filepath"
8+
"testing"
89

910
"gopkg.in/src-d/go-git.v4/plumbing"
1011

@@ -66,6 +67,10 @@ func (s *SubmoduleSuite) TestInit(c *C) {
6667
}
6768

6869
func (s *SubmoduleSuite) TestUpdate(c *C) {
70+
if testing.Short() {
71+
c.Skip("skipping test in short mode.")
72+
}
73+
6974
sm, err := s.Worktree.Submodule("basic")
7075
c.Assert(err, IsNil)
7176

@@ -118,6 +123,10 @@ func (s *SubmoduleSuite) TestUpdateWithNotFetch(c *C) {
118123
}
119124

120125
func (s *SubmoduleSuite) TestUpdateWithRecursion(c *C) {
126+
if testing.Short() {
127+
c.Skip("skipping test in short mode.")
128+
}
129+
121130
sm, err := s.Worktree.Submodule("itself")
122131
c.Assert(err, IsNil)
123132

@@ -134,6 +143,10 @@ func (s *SubmoduleSuite) TestUpdateWithRecursion(c *C) {
134143
}
135144

136145
func (s *SubmoduleSuite) TestUpdateWithInitAndUpdate(c *C) {
146+
if testing.Short() {
147+
c.Skip("skipping test in short mode.")
148+
}
149+
137150
sm, err := s.Worktree.Submodule("basic")
138151
c.Assert(err, IsNil)
139152

@@ -193,6 +206,10 @@ func (s *SubmoduleSuite) TestSubmodulesStatus(c *C) {
193206
}
194207

195208
func (s *SubmoduleSuite) TestSubmodulesUpdateContext(c *C) {
209+
if testing.Short() {
210+
c.Skip("skipping test in short mode.")
211+
}
212+
196213
sm, err := s.Worktree.Submodules()
197214
c.Assert(err, IsNil)
198215

worktree_test.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88
"path/filepath"
99
"regexp"
1010
"runtime"
11+
"testing"
1112

1213
"gopkg.in/src-d/go-git.v4/config"
1314
"gopkg.in/src-d/go-git.v4/plumbing"
@@ -196,6 +197,10 @@ func (s *WorktreeSuite) TestPullProgress(c *C) {
196197
}
197198

198199
func (s *WorktreeSuite) TestPullProgressWithRecursion(c *C) {
200+
if testing.Short() {
201+
c.Skip("skipping test in short mode.")
202+
}
203+
199204
path := fixtures.ByTag("submodule").One().Worktree().Root()
200205

201206
dir, err := ioutil.TempDir("", "plain-clone-submodule")
@@ -613,6 +618,10 @@ func (s *WorktreeSuite) TestCheckoutTag(c *C) {
613618
}
614619

615620
func (s *WorktreeSuite) TestCheckoutBisect(c *C) {
621+
if testing.Short() {
622+
c.Skip("skipping test in short mode.")
623+
}
624+
616625
s.testCheckoutBisect(c, "https://github.com/src-d/go-git.git")
617626
}
618627

0 commit comments

Comments
 (0)