Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent remote query examples from running during testing #90

Open
zwelz3 opened this issue Jan 22, 2021 · 2 comments
Open

Prevent remote query examples from running during testing #90

zwelz3 opened this issue Jan 22, 2021 · 2 comments
Labels
bug Something isn't working test improvements Tickets that increase test coverage, test architecture, fixtures, etc.

Comments

@zwelz3
Copy link
Member

zwelz3 commented Jan 22, 2021

Currently the remote query examples access URLs such as DBPedia.org. This can impact testing when services are unavailable.

Ticket scopes in the prevention of this code from running during testing/CI. Maybe an env variable?

@zwelz3 zwelz3 added this to the 🌞 Release 0.1.3 milestone Jan 22, 2021
@zwelz3 zwelz3 added bug Something isn't working test improvements Tickets that increase test coverage, test architecture, fixtures, etc. labels Jan 22, 2021
@zwelz3
Copy link
Member Author

zwelz3 commented Jan 22, 2021

Culprit

def test_remote_query():
sparql = SPARQLWrapper(DBPEDIA_ENDPOINT)
sparql.setQuery(DBPEDIA_LABEL_QUERY)
sparql.setReturnFormat(JSON)
results = sparql.query().convert()
res = [] # cache results
for result in results["results"]["bindings"]:
res.append(result["label"]["value"])
# check if results are returned and length 5 (LIMIT 5 in query)
assert len(res) > 0 and len(res) == 5
def test_federated_query():
graph = rdflib.Graph()
res = graph.query(LINKEDDATA_QUERY)
res = list(res)
for i in res:
assert len(i) == 3

@zwelz3
Copy link
Member Author

zwelz3 commented Jan 22, 2021

Appears to have some flake.

@zwelz3 zwelz3 removed this from the 🌞 Release 0.1.3 milestone Apr 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working test improvements Tickets that increase test coverage, test architecture, fixtures, etc.
Projects
None yet
Development

No branches or pull requests

1 participant