Skip to content

Commit

Permalink
add reasoner-validator checks in prod trapi tests
Browse files Browse the repository at this point in the history
  • Loading branch information
vemonet committed Sep 8, 2023
1 parent 8bef1cd commit 1171e68
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 19 deletions.
23 changes: 12 additions & 11 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,11 @@ train = [
"matplotlib ==3.4.3",
"pyRDF2vec ==0.0.5",
"python-multipart >=0.0.5",
# "httpx >=0.21.1",
"kgx",
]
test = [
"pytest >=7.1.3,<8.0.0",
"pytest-cov >=2.12.0,<4.0.0",
"pytest",
"pytest-cov",
"httpx",
"typer >=0.7.0",
"pre-commit >=3.2.0",
Expand All @@ -80,7 +79,7 @@ test = [
"types-requests",
]
test-prod = [
"reasoner-validator >=3.1.4",
"reasoner-validator >=3.9.0",
]
doc = [
"mkdocs >=1.4.2",
Expand All @@ -106,23 +105,25 @@ Source = "https://github.com/MaastrichtU-IDS/translator-openpredict"
# openpredict = "openpredict.__main__:main"


# HATCH CONFIG: ENVIRONMENTS AND SCRIPTS
# HATCH CONFIG: ENVS AND SCRIPTS
[tool.hatch.envs.default]
# type = "container"
# image = "ghcr.io/maastrichtu-ids/openpredict-api:0.1.0"
# command = ["/bin/sleep", "infinity"]
# start-on-creation = false
features = [
"test",
# "test-prod",
"test-prod",
"doc",
"train",
# "train",
]
post-install-commands = [
"pre-commit install",
"dvc pull"
]
# type = "container"
# image = "ghcr.io/maastrichtu-ids/openpredict-api:0.1.0"
# command = ["/bin/sleep", "infinity"]
# start-on-creation = false


# NOTE: we can't run training and integration out of docker (require python 3.8)
[tool.hatch.envs.default.scripts]
docs = "mkdocs serve -a localhost:8001 {args}"
fmt = "pre-commit run --all --all-files"
Expand Down
14 changes: 6 additions & 8 deletions tests/production/test_production_api.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import os

import requests
from reasoner_validator import TRAPIResponseValidator

from reasoner_validator.validator import TRAPIResponseValidator
from trapi_predict_kit import settings


# NOTE: Validate only prod because validate requires py3.9+ and OpenPredict requires 3.8
validator = TRAPIResponseValidator(
trapi_version=settings.TRAPI_VERSION,
Expand All @@ -15,11 +13,11 @@
biolink_version=settings.BIOLINK_VERSION,

# 'sources' are set to trigger checking of expected edge knowledge source provenance
sources={
# "ara_source": "infores:molepro",
# "kp_source": "infores:knowledge-collaboratory",
# "kp_source_type": "primary"
},
# sources={
# "ara_source": "infores:molepro",
# "kp_source": "infores:knowledge-collaboratory",
# "kp_source_type": "primary"
# },
# Optional flag: if omitted or set to 'None', we let the system decide the
# default validation strictness by validation context unless we override it here
strict_validation=None
Expand Down

0 comments on commit 1171e68

Please sign in to comment.