| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 6a3c95b commit c572a8d
5 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -4,6 +4,7 @@ environment: | |||
| 4 | 4 | matrix: | |
| 5 | 5 | - PYTHON: "C:\\Python27" | |
| 6 | 6 | PYTHON_VERSION: "2.7" | |
| 7 | + GIT_PATH: "C:\\Program Files\\Git\\mingw64\\libexec\\git-core" | ||
| 7 | 8 | - PYTHON: "C:\\Miniconda" | |
| 8 | 9 | PYTHON_VERSION: "2.7" | |
| 9 | 10 | IS_CONDA: "yes" | |
@@ -12,12 +13,14 @@ environment: | |||
| 12 | 13 | - PYTHON: "C:\\Miniconda3-x64" | |
| 13 | 14 | PYTHON_VERSION: "3.4" | |
| 14 | 15 | IS_CONDA: "yes" | |
| 16 | + GIT_PATH: "C:\\Program Files\\Git\\mingw64\\libexec\\git-core" | ||
| 15 | 17 | - PYTHON: "C:\\Python34" | |
| 16 | 18 | PYTHON_VERSION: "3.4" | |
| 17 | 19 | GIT_PATH: "C:\\cygwin64\\bin" | |
| 18 | 20 | ||
| 19 | 21 | - PYTHON: "C:\\Python35-x64" | |
| 20 | 22 | PYTHON_VERSION: "3.5" | |
| 23 | + GIT_PATH: "C:\\Program Files\\Git\\mingw64\\libexec\\git-core" | ||
| 21 | 24 | - PYTHON: "C:\\Python35-x64" | |
| 22 | 25 | PYTHON_VERSION: "3.5" | |
| 23 | 26 | GIT_PATH: "C:\\cygwin64\\bin" | |
@@ -29,8 +32,7 @@ install: | |||
| 29 | 32 | # | |
| 30 | 33 | - | | |
| 31 | 34 | uname -a | |
| 32 | - where git | ||
| 33 | - where python pip | ||
| 35 | + where git git-daemon python pip | ||
| 34 | 36 | python --version | |
| 35 | 37 | python -c "import struct; print(struct.calcsize('P') * 8)" | |
| 36 | 38 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -61,9 +61,17 @@ as they are kept alive solely by their users, or not. | |||
| 61 | 61 | ||
| 62 | 62 | ### RUNNING TESTS | |
| 63 | 63 | ||
| 64 | - *Important*: Right after cloning this repository, please be sure to have executed the `./init-tests-after-clone.sh` script in the repository root. Otherwise you will encounter test failures. | ||
| 64 | + *Important*: Right after cloning this repository, please be sure to have executed | ||
| 65 | + the `./init-tests-after-clone.sh` script in the repository root. Otherwise | ||
| 66 | + you will encounter test failures. | ||
| 65 | 67 | ||
| 66 | - The easiest way to run test is by using [tox](https://pypi.python.org/pypi/tox) a wrapper around virtualenv. It will take care of setting up environnements with the proper dependencies installed and execute test commands. To install it simply: | ||
| 68 | + On *Windows*, make sure you have `git-daemon` in your PATH. For MINGW-git, the `git-daemon.exe` | ||
| 69 | + exists in `Git\mingw64\libexec\git-core\`; CYGWIN has no daemon, but should get along fine | ||
| 70 | + with MINGW's. | ||
| 71 | + | ||
| 72 | + The easiest way to run tests is by using [tox](https://pypi.python.org/pypi/tox) | ||
| 73 | + a wrapper around virtualenv. It will take care of setting up environnements with the proper | ||
| 74 | + dependencies installed and execute test commands. To install it simply: | ||
| 67 | 75 | ||
| 68 | 76 | pip install tox | |
| 69 | 77 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -140,6 +140,28 @@ def repo_creator(self): | |||
| 140 | 140 | return argument_passer | |
| 141 | 141 | ||
| 142 | 142 | ||
| 143 | + def launch_git_daemon(temp_dir, ip, port): | ||
| 144 | + if is_win(): | ||
| 145 | + ## On MINGW-git, daemon exists in .\Git\mingw64\libexec\git-core\, | ||
| 146 | + # but if invoked as 'git daemon', it detaches from parent `git` cmd, | ||
| 147 | + # and then CANNOT DIE! | ||
| 148 | + # So, invoke it as a single command. | ||
| 149 | + ## Cygwin-git has no daemon. | ||
| 150 | + # | ||
| 151 | + daemon_cmd = ['git-daemon', temp_dir, | ||
| 152 | + '--enable=receive-pack', | ||
| 153 | + '--listen=%s' % ip, | ||
| 154 | + '--port=%s' % port] | ||
| 155 | + gd = Git().execute(daemon_cmd, as_process=True) | ||
| 156 | + else: | ||
| 157 | + gd = Git().daemon(temp_dir, | ||
| 158 | + enable='receive-pack', | ||
| 159 | + listen=ip, | ||
| 160 | + port=port, | ||
| 161 | + as_process=True) | ||
| 162 | + return gd | ||
| 163 | + | ||
| 164 | + | ||
| 143 | 165 | def with_rw_and_rw_remote_repo(working_tree_ref): | |
| 144 | 166 | """ | |
| 145 | 167 | Same as with_rw_repo, but also provides a writable remote repository from which the | |
@@ -167,6 +189,7 @@ def case(self, rw_repo, rw_remote_repo) | |||
| 167 | 189 | assert isinstance(working_tree_ref, string_types), "Decorator requires ref name for working tree checkout" | |
| 168 | 190 | ||
| 169 | 191 | def argument_passer(func): | |
| 192 | + | ||
| 170 | 193 | def remote_repo_creator(self): | |
| 171 | 194 | remote_repo_dir = _mktemp("remote_repo_%s" % func.__name__) | |
| 172 | 195 | repo_dir = _mktemp("remote_clone_non_bare_repo") | |
@@ -202,9 +225,7 @@ def remote_repo_creator(self): | |||
| 202 | 225 | d_remote.config_writer.set('url', remote_repo_url) | |
| 203 | 226 | ||
| 204 | 227 | temp_dir = osp(_mktemp()) | |
| 205 | - # On MINGW-git, daemon exists, in Cygwin-git, this will fail. | ||
| 206 | - gd = Git().daemon(temp_dir, enable='receive-pack', listen='127.0.0.1', port=GIT_DAEMON_PORT, | ||
| 207 | - as_process=True) | ||
| 228 | + gd = launch_git_daemon(temp_dir, '127.0.0.1', GIT_DAEMON_PORT) | ||
| 208 | 229 | try: | |
| 209 | 230 | # yes, I know ... fortunately, this is always going to work if sleep time is just large enough | |
| 210 | 231 | time.sleep(0.5) | |
@@ -223,8 +244,10 @@ def remote_repo_creator(self): | |||
| 223 | 244 | rw_repo.git_dir, e) | |
| 224 | 245 | if is_win(): | |
| 225 | 246 | msg = textwrap.dedent(""" | |
| 226 | - MINGW yet has problems with paths, CYGWIN additionally is missing `git-daemon` | ||
| 227 | - needed to run this test. Anyhow, try starting `git-daemon` manually:""") | ||
| 247 | + MINGW yet has problems with paths, and `git-daemon.exe` must be in PATH | ||
| 248 | + (look into .\Git\mingw64\libexec\git-core\); | ||
| 249 | + CYGWIN has no daemon, but if one exists, it gets along fine (has also paths problems) | ||
| 250 | + Anyhow, alternatively try starting `git-daemon` manually:""") | ||
| 228 | 251 | else: | |
| 229 | 252 | msg = "Please try starting `git-daemon` manually:" | |
| 230 | 253 | ||
@@ -233,7 +256,8 @@ def remote_repo_creator(self): | |||
| 233 | 256 | You can also run the daemon on a different port by passing --port=<port>" | |
| 234 | 257 | and setting the environment variable GIT_PYTHON_TEST_GIT_DAEMON_PORT to <port> | |
| 235 | 258 | """ % temp_dir) | |
| 236 | - raise AssertionError(msg) | ||
| 259 | + from nose import SkipTest | ||
| 260 | + raise SkipTest(msg) if is_win else AssertionError(msg) | ||
| 237 | 261 | # END make assertion | |
| 238 | 262 | # END catch ls remote error | |
| 239 | 263 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -112,7 +112,6 @@ def test_with_rw_repo(self, rw_repo): | |||
| 112 | 112 | assert not rw_repo.config_reader("repository").getboolean("core", "bare") | |
| 113 | 113 | assert os.path.isdir(os.path.join(rw_repo.working_tree_dir, 'lib')) | |
| 114 | 114 | ||
| 115 | - @skipIf(is_win(), "git-daemon proc stuck on Appveyor!") | ||
| 116 | 115 | @with_rw_and_rw_remote_repo('0.1.6') | |
| 117 | 116 | def test_with_rw_remote_and_rw_repo(self, rw_repo, rw_remote_repo): | |
| 118 | 117 | assert not rw_repo.config_reader("repository").getboolean("core", "bare") | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -26,8 +26,7 @@ | |||
| 26 | 26 | GitCommandError | |
| 27 | 27 | ) | |
| 28 | 28 | from git.util import IterableList | |
| 29 | - from git.compat import string_types, is_win | ||
| 30 | - from unittest import skipIf | ||
| 29 | + from git.compat import string_types | ||
| 31 | 30 | import tempfile | |
| 32 | 31 | import shutil | |
| 33 | 32 | import os | |
@@ -100,7 +99,6 @@ def assert_received_message(self): | |||
| 100 | 99 | assert self._num_progress_messages | |
| 101 | 100 | ||
| 102 | 101 | ||
| 103 | - @skipIf(is_win(), "git-daemon proc stuck on Appveyor!") | ||
| 104 | 102 | class TestRemote(TestBase): | |
| 105 | 103 | ||
| 106 | 104 | def tearDown(self): | |
| Back | FazBrowse Home | New Git URL |
0 commit comments