-
Notifications
You must be signed in to change notification settings - Fork 178
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #134 from marcusianlevine/master
Add Travis CI setup and simple tests
- Loading branch information
Showing
13 changed files
with
395 additions
and
125 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
[run] | ||
parallel = True | ||
branch = False | ||
omit = | ||
ldapauthenticator/tests/* | ||
|
||
[report] | ||
exclude_lines = | ||
if self.debug: | ||
pragma: no cover | ||
raise NotImplementedError | ||
if __name__ == .__main__.: | ||
ignore_errors = True | ||
omit = | ||
ldapauthenticator/tests/* | ||
*/site-packages/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
[flake8] | ||
# Ignore style and complexity | ||
# E: style errors | ||
# W: style warnings | ||
# C: complexity | ||
# F401: module imported but unused | ||
# F403: import * | ||
# F811: redefinition of unused `name` from line `N` | ||
# F841: local variable assigned but never used | ||
# E402: module level import not at top of file | ||
# I100: Import statements are in the wrong order | ||
# I101: Imported names are in the wrong order. Should be | ||
ignore = E, C, W, F401, F403, F811, F841, E402, I100, I101, D400 | ||
builtins = c, get_config | ||
exclude = | ||
.cache, | ||
.github, | ||
onbuild, | ||
scripts, | ||
share, | ||
tools, | ||
setup.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
repos: | ||
- repo: https://github.com/asottile/reorder_python_imports | ||
rev: v1.3.5 | ||
hooks: | ||
- id: reorder-python-imports | ||
language_version: python3.6 | ||
- repo: https://github.com/ambv/black | ||
rev: 18.9b0 | ||
hooks: | ||
- id: black | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v2.1.0 | ||
hooks: | ||
- id: end-of-file-fixer | ||
- id: check-json | ||
- id: check-yaml | ||
- id: check-case-conflict | ||
- id: check-executables-have-shebangs | ||
- id: requirements-txt-fixer | ||
- id: flake8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
dist: xenial | ||
language: python | ||
sudo: false | ||
cache: | ||
- pip | ||
python: | ||
- 3.7 | ||
- 3.6 | ||
env: | ||
global: | ||
- ASYNC_TEST_TIMEOUT=15 | ||
- LDAP_HOST=127.0.0.1 | ||
services: | ||
- docker | ||
|
||
# installing dependencies | ||
before_install: | ||
- set -e | ||
install: | ||
- pip install --upgrade pip | ||
- pip install --upgrade --pre -r dev-requirements.txt . | ||
- pip freeze | ||
- | | ||
# start LDAP server | ||
if [[ -z "$TEST" ]]; then | ||
ci/docker-ldap.sh | ||
fi | ||
# running tests | ||
script: | ||
- | | ||
# run tests | ||
if [[ -z "$TEST" ]]; then | ||
pytest -v --maxfail=2 --cov=ldapauthenticator ldapauthenticator/tests | ||
fi | ||
- | | ||
# run autoformat | ||
if [[ "$TEST" == "lint" ]]; then | ||
pre-commit run --all-files | ||
fi | ||
after_success: | ||
- codecov | ||
after_failure: | ||
- | | ||
# point to auto-lint-fix | ||
if [[ "$TEST" == "lint" ]]; then | ||
echo "You can install pre-commit hooks to automatically run formatting" | ||
echo "on each commit with:" | ||
echo " pre-commit install" | ||
echo "or you can run by hand on staged files with" | ||
echo " pre-commit run" | ||
echo "or after-the-fact on already committed files with" | ||
echo " pre-commit run --all-files" | ||
fi | ||
matrix: | ||
fast_finish: true | ||
include: | ||
- python: 3.6 | ||
env: TEST=lint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/usr/bin/env bash | ||
# source this file to setup LDAP | ||
# for local testing (as similar as possible to docker) | ||
|
||
set -e | ||
|
||
NAME="hub-test-ldap" | ||
DOCKER_RUN="docker run -d --name $NAME" | ||
RUN_ARGS="-p 389:389 -p 636:636 rroemhild/test-openldap" | ||
|
||
docker rm -f "$NAME" 2>/dev/null || true | ||
|
||
$DOCKER_RUN $RUN_ARGS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
beautifulsoup4 | ||
codecov | ||
coverage | ||
cryptography | ||
html5lib # needed for beautifulsoup | ||
mock | ||
notebook | ||
pre-commit | ||
pytest-asyncio | ||
pytest-cov | ||
pytest>=3.3 | ||
requests-mock | ||
virtualenv |
Oops, something went wrong.