Skip to content

Commit

Permalink
chore: add runing tests on travis
Browse files Browse the repository at this point in the history
  • Loading branch information
subotic committed Oct 10, 2019
1 parent 45a524c commit 593ac85
Show file tree
Hide file tree
Showing 8 changed files with 161 additions and 83 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Expand Up @@ -105,3 +105,6 @@ venv.bak/
.idea
.vscode
/knora/lists.json

# bazel
/bazel-*
10 changes: 10 additions & 0 deletions .travis.yml
@@ -0,0 +1,10 @@
dist: xenial
sudo: required

services:
- docker

script:
- pyenv shell 3.7.1
- pip3 install -r requirements.txt
- make test
41 changes: 41 additions & 0 deletions BUILD
@@ -0,0 +1,41 @@
py_library(
name = "knora",
srcs = glob(["knora/knora.py"]),
)

py_binary(
name = "knora_create_ontology",
srcs = ["knora/create_ontology.py"],
deps = ["knora"]
)

py_binary(
name = "knora-xml-import",
srcs = ["knora/xml2knora.py"],
deps = ["knora"]
)

py_binary(
name = "knora-reset-triplestore",
srcs = ["knora/reset_triplestore.py"],
deps = ["knora"]
)

py_binary(
name = "knoractl",
srcs = ["knora/knoractl.py"],
deps = ["knora"]
)

py_test(
name = "test_knora",
srcs = ["tests/test_knora.py"],
deps = ["knora"],
)

test_suite(
name = "all_tests",
tests = [
"test_knora",
],
)
3 changes: 3 additions & 0 deletions Makefile
Expand Up @@ -16,6 +16,9 @@ serve-docs: ## serve docs for local viewing
publish-docs: ## build and publish docs to Github Pages
mkdocs gh-deploy

test: ## runs all tests
python3 -m pytest

clean: ## cleans the project directory
rm -rf dist/ build/ knora.egg-info/ .pytest_cache/ site/

Expand Down
Empty file added WORKSPACE
Empty file.
4 changes: 2 additions & 2 deletions knora/create_ontology.py
Expand Up @@ -115,8 +115,8 @@ def program(args):
try:
user_iri = con.create_user(username=user["username"],
email=user["email"],
givenName=user["givenName"],
familyName=user["familyName"],
given_name=user["givenName"],
family_name=user["familyName"],
password="password",
lang=user["lang"] if user.get("lang") is not None else "en")
except KnoraError as err:
Expand Down

0 comments on commit 593ac85

Please sign in to comment.