Skip to content

Commit

Permalink
Update docs and travis
Browse files Browse the repository at this point in the history
  • Loading branch information
alichtman committed Nov 16, 2018
1 parent bd2643b commit 2c828b3
Show file tree
Hide file tree
Showing 7 changed files with 67 additions and 20 deletions.
5 changes: 5 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[run]
omit =
# omit anything in a .local directory anywhere
*/.local/*
tests/*
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ shallow_backup.egg-info/*
build/bdist.macosx-10.6-intel
build/lib
.vscode
.coverage
8 changes: 3 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,13 @@ sudo: false
language: python
python:
- "3.6"
git:
depth: false

install:
- pip install pipenv
- pipenv install --dev

# command to run tests
script:
- cd tests
- pipenv run python3 -m pytest
- pytest # --cov

git:
depth: false
1 change: 1 addition & 0 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ inquirer = "*"
gitpython = "*"
colorama = "*"
pytest = "*"
pytest-cov = "*"

[dev-packages]

Expand Down
57 changes: 48 additions & 9 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 6 additions & 4 deletions docs/development-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,13 @@
### Testing

```shell
$ cd tests
$ pipenv run python3 -m pytest
$ pipenv shell
$ pipenv install
$ pytest
```

If you want to look at code coverage, use `pytest --cov`. **NOTE: This causes some tests to fail, but I'm not sure why.**

Make sure all existing tests pass before opening a PR!
Also, add any necessary tests for new code. I'd like to have a lot more of this code base under CI testing, as opposed to manual testing.

Expand All @@ -24,9 +27,8 @@ All files should end with a new line.

PRs with changes in indentation style _will not be merged._ Tabs (width of 4 spaces) should be used.

### Code Analysis
### Continuous Integration Testing and Static Analysis

+ [Travis CI](https://travis-ci.com/alichtman/shallow-backup)
+ [CodeClimate](https://codeclimate.com/github/alichtman/shallow-backup)
+ [Coveralls](https://coveralls.io/github/alichtman/shallow-backup)

5 changes: 3 additions & 2 deletions tests/test_backups.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import shutil
sys.path.insert(0, "../shallow_backup")
from shallow_backup.backup import backup_dotfiles
from shallow_backup.config import safe_create_config, get_config_path
from shallow_backup.config import safe_create_config

BACKUP_DIR = 'shallow-backup-test-backups-dir'
FAKE_HOME_DIR = 'shallow-backup-test-backups-src-dir'
Expand Down Expand Up @@ -37,7 +37,7 @@ def setup_method():
for directory in DIRS:
try:
os.mkdir(directory)
except FileExistsError as e:
except Exception:
shutil.rmtree(directory)
os.mkdir(directory)

Expand Down Expand Up @@ -65,6 +65,7 @@ def test_backup_dotfiles(self):
backup_dotfiles(dotfiles_path, home_path=FAKE_HOME_DIR, skip=True)
assert os.path.isdir(dotfiles_path)
for path in DOTFILES:
print(os.listdir(dotfiles_path))
print(path + " was backed up.")
backed_up_dot = os.path.join(dotfiles_path, os.path.split(path)[-1])
assert os.path.isfile(backed_up_dot)

0 comments on commit 2c828b3

Please sign in to comment.