| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -11,8 +11,10 @@ install: | |||
| 11 | 11 | - git submodule update --init --recursive | |
| 12 | 12 | - git fetch --tags | |
| 13 | 13 | - pip install coveralls | |
| 14 | + | ||
| 14 | 15 | # for now we have to make sure there is a master branch - at some point we should just have it by default | |
| 15 | 16 | - git branch master 0.3 | |
| 17 | + | ||
| 16 | 18 | # generate some reflog as git-python tests need it | |
| 17 | 19 | - git reset --hard HEAD~1 | |
| 18 | 20 | - git reset --hard HEAD~1 | |
@@ -21,8 +23,13 @@ install: | |||
| 21 | 23 | - git checkout master | |
| 22 | 24 | - git reset --hard HEAD~1 | |
| 23 | 25 | - git reset --hard HEAD~1 | |
| 26 | + - git reset --hard HEAD~1 | ||
| 24 | 27 | - git reset --hard origin/0.3 | |
| 25 | 28 | - git checkout 0.3 | |
| 29 | + | ||
| 30 | + # as commits are performed with the default user, it needs to be set for travis too | ||
| 31 | + - git config --global user.email "travis@ci.com" | ||
| 32 | + - git config --global user.name "Travis Runner" | ||
| 26 | 33 | script: | |
| 27 | 34 | - nosetests -v --with-coverage | |
| 28 | 35 | after_success: | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -8,6 +8,7 @@ | |||
| 8 | 8 | import sys | |
| 9 | 9 | from git import Repo, Remote, GitCommandError, Git | |
| 10 | 10 | from unittest import TestCase | |
| 11 | + import time | ||
| 11 | 12 | import tempfile | |
| 12 | 13 | import shutil | |
| 13 | 14 | import cStringIO | |
@@ -191,6 +192,8 @@ def remote_repo_creator(self): | |||
| 191 | 192 | # On windows, this will fail ... we deal with failures anyway and default to telling the user to do it | |
| 192 | 193 | try: | |
| 193 | 194 | gd = Git().daemon(temp_dir, as_process=True) | |
| 195 | + # yes, I know ... fortunately, this is always going to work if sleep time is just large enough | ||
| 196 | + time.sleep(0.5) | ||
| 194 | 197 | except Exception as err: | |
| 195 | 198 | gd = None | |
| 196 | 199 | # end | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,6 +1,7 @@ | |||
| 1 | 1 | """Contains library functions""" | |
| 2 | 2 | import os | |
| 3 | 3 | from git.test.lib import * | |
| 4 | + from gitdb.test.lib import skip_on_travis_ci | ||
| 4 | 5 | import shutil | |
| 5 | 6 | import tempfile | |
| 6 | 7 | import logging | |
@@ -36,11 +37,11 @@ class TestBigRepoR(TestBase): | |||
| 36 | 37 | """ | |
| 37 | 38 | ||
| 38 | 39 | #{ Invariants | |
| 39 | - head_sha_2k = '235d521da60e4699e5bd59ac658b5b48bd76ddca' | ||
| 40 | - head_sha_50 = '32347c375250fd470973a5d76185cac718955fd5' | ||
| 41 | 40 | #} END invariants | |
| 42 | 41 | ||
| 43 | 42 | def setUp(self): | |
| 43 | + # This will raise on travis, which is what we want to happen early as to prevent us to do any work | ||
| 44 | + skip_on_travis_ci(lambda *args: None)(self) | ||
| 44 | 45 | try: | |
| 45 | 46 | super(TestBigRepoR, self).setUp() | |
| 46 | 47 | except AttributeError: | |
@@ -54,14 +55,14 @@ def setUp(self): | |||
| 54 | 55 | self.gitrorepo = Repo(repo_path, odbt=GitCmdObjectDB) | |
| 55 | 56 | self.puregitrorepo = Repo(repo_path, odbt=GitDB) | |
| 56 | 57 | ||
| 57 | - | ||
| 58 | 58 | class TestBigRepoRW(TestBigRepoR): | |
| 59 | 59 | ||
| 60 | 60 | """As above, but provides a big repository that we can write to. | |
| 61 | 61 | ||
| 62 | 62 | Provides ``self.gitrwrepo`` and ``self.puregitrwrepo``""" | |
| 63 | 63 | ||
| 64 | 64 | def setUp(self): | |
| 65 | + self.gitrwrepo = None | ||
| 65 | 66 | try: | |
| 66 | 67 | super(TestBigRepoRW, self).setUp() | |
| 67 | 68 | except AttributeError: | |
@@ -72,6 +73,7 @@ def setUp(self): | |||
| 72 | 73 | self.puregitrwrepo = Repo(dirname, odbt=GitDB) | |
| 73 | 74 | ||
| 74 | 75 | def tearDown(self): | |
| 75 | - shutil.rmtree(self.gitrwrepo.working_dir) | ||
| 76 | + if self.gitrwrepo is not None: | ||
| 77 | + shutil.rmtree(self.gitrwrepo.working_dir) | ||
| 76 | 78 | ||
| 77 | 79 | #} END base classes | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -8,7 +8,6 @@ | |||
| 8 | 8 | from git import * | |
| 9 | 9 | from gitdb import IStream | |
| 10 | 10 | from git.test.test_commit import assert_commit_serialization | |
| 11 | - from gitdb.test.lib import skip_on_travis_ci | ||
| 12 | 11 | from cStringIO import StringIO | |
| 13 | 12 | from time import time | |
| 14 | 13 | import sys | |
@@ -29,7 +28,6 @@ def _query_commit_info(self, c): | |||
| 29 | 28 | c.message | |
| 30 | 29 | c.parents | |
| 31 | 30 | ||
| 32 | - @skip_on_travis_ci | ||
| 33 | 31 | def test_iteration(self): | |
| 34 | 32 | no = 0 | |
| 35 | 33 | nc = 0 | |
@@ -51,39 +49,36 @@ def test_iteration(self): | |||
| 51 | 49 | print >> sys.stderr, "Traversed %i Trees and a total of %i unchached objects in %s [s] ( %f objs/s )" % ( | |
| 52 | 50 | nc, no, elapsed_time, no / elapsed_time) | |
| 53 | 51 | ||
| 54 | - @skip_on_travis_ci | ||
| 55 | 52 | def test_commit_traversal(self): | |
| 56 | 53 | # bound to cat-file parsing performance | |
| 57 | 54 | nc = 0 | |
| 58 | 55 | st = time() | |
| 59 | - for c in self.gitrorepo.commit(self.head_sha_2k).traverse(branch_first=False): | ||
| 56 | + for c in self.gitrorepo.commit().traverse(branch_first=False): | ||
| 60 | 57 | nc += 1 | |
| 61 | 58 | self._query_commit_info(c) | |
| 62 | 59 | # END for each traversed commit | |
| 63 | 60 | elapsed_time = time() - st | |
| 64 | 61 | print >> sys.stderr, "Traversed %i Commits in %s [s] ( %f commits/s )" % (nc, elapsed_time, nc / elapsed_time) | |
| 65 | 62 | ||
| 66 | - @skip_on_travis_ci | ||
| 67 | 63 | def test_commit_iteration(self): | |
| 68 | 64 | # bound to stream parsing performance | |
| 69 | 65 | nc = 0 | |
| 70 | 66 | st = time() | |
| 71 | - for c in Commit.iter_items(self.gitrorepo, self.head_sha_2k): | ||
| 67 | + for c in Commit.iter_items(self.gitrorepo, self.gitrorepo.head): | ||
| 72 | 68 | nc += 1 | |
| 73 | 69 | self._query_commit_info(c) | |
| 74 | 70 | # END for each traversed commit | |
| 75 | 71 | elapsed_time = time() - st | |
| 76 | 72 | print >> sys.stderr, "Iterated %i Commits in %s [s] ( %f commits/s )" % (nc, elapsed_time, nc / elapsed_time) | |
| 77 | 73 | ||
| 78 | - @skip_on_travis_ci | ||
| 79 | 74 | def test_commit_serialization(self): | |
| 80 | - assert_commit_serialization(self.gitrwrepo, self.head_sha_2k, True) | ||
| 75 | + assert_commit_serialization(self.gitrwrepo, self.gitrwrepo.head, True) | ||
| 81 | 76 | ||
| 82 | 77 | rwrepo = self.gitrwrepo | |
| 83 | 78 | make_object = rwrepo.odb.store | |
| 84 | 79 | # direct serialization - deserialization can be tested afterwards | |
| 85 | 80 | # serialization is probably limited on IO | |
| 86 | - hc = rwrepo.commit(self.head_sha_2k) | ||
| 81 | + hc = rwrepo.commit(rwrepo.head) | ||
| 87 | 82 | ||
| 88 | 83 | nc = 5000 | |
| 89 | 84 | st = time() | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2,7 +2,6 @@ | |||
| 2 | 2 | ||
| 3 | 3 | from time import time | |
| 4 | 4 | import sys | |
| 5 | - from gitdb.test.lib import skip_on_travis_ci | ||
| 6 | 5 | ||
| 7 | 6 | from lib import ( | |
| 8 | 7 | TestBigRepoR | |
@@ -11,13 +10,12 @@ | |||
| 11 | 10 | ||
| 12 | 11 | class TestObjDBPerformance(TestBigRepoR): | |
| 13 | 12 | ||
| 14 | - @skip_on_travis_ci | ||
| 15 | 13 | def test_random_access(self): | |
| 16 | 14 | results = [["Iterate Commits"], ["Iterate Blobs"], ["Retrieve Blob Data"]] | |
| 17 | 15 | for repo in (self.gitrorepo, self.puregitrorepo): | |
| 18 | 16 | # GET COMMITS | |
| 19 | 17 | st = time() | |
| 20 | - root_commit = repo.commit(self.head_sha_2k) | ||
| 18 | + root_commit = repo.commit(repo.head) | ||
| 21 | 19 | commits = list(root_commit.traverse()) | |
| 22 | 20 | nc = len(commits) | |
| 23 | 21 | elapsed = time() - st | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -3,7 +3,6 @@ | |||
| 3 | 3 | from git.test.lib import * | |
| 4 | 4 | from gitdb import * | |
| 5 | 5 | from gitdb.util import bin_to_hex | |
| 6 | - from gitdb.test.lib import skip_on_travis_ci | ||
| 7 | 6 | ||
| 8 | 7 | from time import time | |
| 9 | 8 | import os | |
@@ -22,7 +21,6 @@ class TestObjDBPerformance(TestBigRepoR): | |||
| 22 | 21 | large_data_size_bytes = 1000 * 1000 * 10 # some MiB should do it | |
| 23 | 22 | moderate_data_size_bytes = 1000 * 1000 * 1 # just 1 MiB | |
| 24 | 23 | ||
| 25 | - @skip_on_travis_ci | ||
| 26 | 24 | @with_rw_repo('HEAD', bare=True) | |
| 27 | 25 | def test_large_data_streaming(self, rwrepo): | |
| 28 | 26 | # TODO: This part overlaps with the same file in gitdb.test.performance.test_stream | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2,16 +2,13 @@ | |||
| 2 | 2 | from time import time | |
| 3 | 3 | import sys | |
| 4 | 4 | ||
| 5 | - from gitdb.test.lib import skip_on_travis_ci | ||
| 6 | - | ||
| 7 | 5 | from lib import ( | |
| 8 | 6 | TestBigRepoR | |
| 9 | 7 | ) | |
| 10 | 8 | ||
| 11 | 9 | ||
| 12 | 10 | class TestUtilPerformance(TestBigRepoR): | |
| 13 | 11 | ||
| 14 | - @skip_on_travis_ci | ||
| 15 | 12 | def test_access(self): | |
| 16 | 13 | # compare dict vs. slot access | |
| 17 | 14 | class Slotty(object): | |
@@ -66,7 +63,6 @@ def __init__(self): | |||
| 66 | 63 | cls.__name__, na, elapsed, na / elapsed) | |
| 67 | 64 | # END for each sequence | |
| 68 | 65 | ||
| 69 | - @skip_on_travis_ci | ||
| 70 | 66 | def test_instantiation(self): | |
| 71 | 67 | ni = 100000 | |
| 72 | 68 | max_num_items = 4 | |
@@ -109,7 +105,6 @@ def test_instantiation(self): | |||
| 109 | 105 | elapsed = time() - st | |
| 110 | 106 | print >> sys.stderr, "Created %i tuples tuple((1,2,3,4)) in %f s ( %f tuples / s)" % (ni, elapsed, ni / elapsed) | |
| 111 | 107 | ||
| 112 | - @skip_on_travis_ci | ||
| 113 | 108 | def test_unpacking_vs_indexing(self): | |
| 114 | 109 | ni = 1000000 | |
| 115 | 110 | list_items = [1, 2, 3, 4] | |
@@ -141,7 +136,6 @@ def test_unpacking_vs_indexing(self): | |||
| 141 | 136 | ni, type(sequence).__name__, len(sequence), elapsed, ni / elapsed) | |
| 142 | 137 | # END for each sequence | |
| 143 | 138 | ||
| 144 | - @skip_on_travis_ci | ||
| 145 | 139 | def test_large_list_vs_iteration(self): | |
| 146 | 140 | # what costs more: alloc/realloc of lists, or the cpu strain of iterators ? | |
| 147 | 141 | def slow_iter(ni): | |
@@ -166,7 +160,6 @@ def slow_iter(ni): | |||
| 166 | 160 | print >> sys.stderr, "Iterated %i items from iterator in %f s ( %f acc / s)" % (ni, elapsed, ni / elapsed) | |
| 167 | 161 | # END for each number of iterations | |
| 168 | 162 | ||
| 169 | - @skip_on_travis_ci | ||
| 170 | 163 | def test_type_vs_inst_class(self): | |
| 171 | 164 | class NewType(object): | |
| 172 | 165 | pass | |
| Back | FazBrowse Home | New Git URL |
0 commit comments