Skip to content

Commit

Permalink
disable scicrunch unreliable test
Browse files Browse the repository at this point in the history
  • Loading branch information
pcrespov committed Sep 30, 2021
1 parent 5c3b2ab commit 7001eb7
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class ResolverResponseBody(BaseModel):


class ResolvedItem(BaseModel):
""" Result model for resolve_rrid """
"""Result model for resolve_rrid"""

description: str
name: str
Expand Down Expand Up @@ -95,6 +95,15 @@ async def resolve_rrid(
if resolved.hits.total == 0:
return None

# FIXME: Not sure why the same RRID can have multiple hits.
# We have experience that the order of hits is not preserve and
# therefore selecting the first hit is not the right way to go ...
#
# WARNING: Since Sep.2021, hits returned by resolver does not guarantee order.
# For instance, https://scicrunch.org/resolver/RRID:CVCL_0033.json changes
# the order every call and the first hit flips between
# '(BCRJ Cat# 0226, RRID:CVCL_0033)' and '(ATCC Cat# HTB-30, RRID:CVCL_0033)'
#
hit = resolved.hits.hits[0].source

if resolved.hits.total > 1:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ def _split(citation: str) -> Tuple[str, str]:
# https://web.expasy.org/cellosaurus/CVCL_0033
CELL_LINE_CITATIONS = split_citations(["(ATCC Cat# HTB-30, RRID:CVCL_0033)"])

#
# WARNING: Since Sep.2021, the order of the resolved hits list returned by
# https://scicrunch.org/resolver/RRID:CVCL_0033.json changes per call and
# sometimes (BCRJ Cat# 0226, RRID:CVCL_0033) appears as first hit instead

# https://scicrunch.org/resources/Tools/search?q=SCR_018315&l=SCR_018315
TOOL_CITATIONS = split_citations(
[
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,7 @@

@pytest.mark.parametrize(
"name,rrid",
TOOL_CITATIONS
+ ANTIBODY_CITATIONS
+ PLAMID_CITATIONS
+ ORGANISM_CITATIONS
+ CELL_LINE_CITATIONS,
TOOL_CITATIONS + ANTIBODY_CITATIONS + PLAMID_CITATIONS + ORGANISM_CITATIONS,
)
async def test_scicrunch_resolves_all_valid_rrids(
name: str, rrid: str, settings: SciCrunchSettings
Expand All @@ -47,6 +43,15 @@ async def test_scicrunch_resolves_all_valid_rrids(
assert resolved.proper_citation == f"RRID:{rrid}"
else:
# includes name and rrid

#
# NOTE: why CELL_LINE_CITATIONS are removed from test parametrization ?
# Since Sep.2021, test is not repeatable since the list order returned by
# https://scicrunch.org/resolver/RRID:CVCL_0033.json changes per call and
# sometimes (BCRJ Cat# 0226, RRID:CVCL_0033) appears as first hit instead
# of the reference in CELL_LINE_CITATIONS
#

assert resolved.proper_citation in (
f"({name}, RRID:{rrid})",
f"({name},RRID:{rrid})",
Expand Down

0 comments on commit 7001eb7

Please sign in to comment.