Skip to content

Commit 3c6e5ad

Browse files
committed
chore(tests): test-initialization via script
Fixes #478
1 parent de89429 commit 3c6e5ad

File tree

3 files changed

+29
-6
lines changed

3 files changed

+29
-6
lines changed

Diff for: .travis.yml

+1-6
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,7 @@ install:
1919
- pip install coveralls flake8 sphinx
2020

2121
# generate some reflog as git-python tests need it (in master)
22-
- git tag __testing_point__
23-
- git checkout master || git checkout -b master
24-
- git reset --hard HEAD~1
25-
- git reset --hard HEAD~1
26-
- git reset --hard HEAD~1
27-
- git reset --hard __testing_point__
22+
- ./init-tests-after-clone.sh
2823

2924
# as commits are performed with the default user, it needs to be set for travis too
3025
- git config --global user.email "travis@ci.com"

Diff for: README.md

+13
Original file line numberDiff line numberDiff line change
@@ -34,16 +34,29 @@ Both commands will install the required package dependencies.
3434
A distribution package can be obtained for manual installation at:
3535

3636
http://pypi.python.org/pypi/GitPython
37+
38+
If you like to clone from source, you can do it like so:
39+
40+
```bash
41+
git clone https://github.com/gitpython-developers/GitPython
42+
git submodule update --init --recursive
43+
./init-tests-after-clone.sh
44+
```
3745

3846
### RUNNING TESTS
3947

48+
*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.
49+
4050
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:
4151

4252
pip install tox
4353

4454
Then run:
4555

4656
tox
57+
58+
59+
For more fine-grained control, you can use `nose`.
4760

4861
### Contributions
4962

Diff for: init-tests-after-clone.sh

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/bash -e
2+
3+
if [[ -z "$TRAVIS" ]]; then
4+
read -p "This operation will destroy locally modified files. Continue ? [N/y]: " answer
5+
if [[ ! $answer =~ [yY] ]]; then
6+
exit 2
7+
fi
8+
fi
9+
10+
git tag __testing_point__
11+
git checkout master || git checkout -b master
12+
git reset --hard HEAD~1
13+
git reset --hard HEAD~1
14+
git reset --hard HEAD~1
15+
git reset --hard __testing_point__

0 commit comments

Comments
 (0)