Skip to content

Commit

Permalink
chore(ci): handle when the URLs in ontos are not yet public (#229)
Browse files Browse the repository at this point in the history
In case a PR adds self referencing ontologies or references URLs
that will eventually be there once merge, check for those file locally.
  • Loading branch information
bfabio authored Nov 16, 2023
1 parent b2f9729 commit 190c097
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/test_urls.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import os
import re
import time
from os import environ
Expand Down Expand Up @@ -49,6 +50,12 @@ def test_vocab_url(fpath, url):
pytest.skip(f"See {issue_url}")

ret = request_rl(requests.head, url)

# The file exists locally, so it will exist when a PR is merged
url_filename = url.replace("https://raw.githubusercontent.com/italia/daf-ontologie-vocabolari-controllati/master/", "")
if ret.status_code == 404 and os.path.exists(url_filename):
return

assert ret.status_code in (200, 301, 302)


Expand All @@ -72,4 +79,10 @@ def test_onto_url(fpath, url):
pytest.skip(f"See {issue_url}")

ret = request_rl(requests.head, url)

# The file exists locally, so it will exist when a PR is merged
url_filename = url.replace("https://raw.githubusercontent.com/italia/daf-ontologie-vocabolari-controllati/master/", "")
if ret.status_code == 404 and os.path.exists(url_filename):
return

assert ret.status_code in (200, 301, 302)

0 comments on commit 190c097

Please sign in to comment.