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

CI tests failing with "Test_ArgoDocs::test_search[docid=None-where=abstract] - KeyError: 'AB'" #393

Open
gmaze opened this issue Sep 19, 2024 · 0 comments
Labels
bug Something isn't working CI Continuous Integration tools

Comments

@gmaze
Copy link
Member

gmaze commented Sep 19, 2024

Some CI tests, apparently quite randomly, fail with a:

FAILED argopy/tests/test_related.py::Test_ArgoDocs::test_search[docid=None-where=abstract] - KeyError: 'AB'

eg with:
https://github.com/euroargodev/argopy/actions/runs/10940750386/job/30373858695#step:11:1683

gives the error trace:

=================================== FAILURES ===================================
_____________ Test_ArgoDocs.test_search[docid=None-where=abstract] _____________

self = <argopy.tests.test_related.Test_ArgoDocs object at 0x7fd32a518a90>
where = 'abstract'
an_instance = <argopy.ArgoDocs>
- 26 documents with a DOI are available in the catalogue
> Use the method 'search' to find a document id
> Use the property 'list' to check out the catalogue content

    @pytest.mark.parametrize("where", ['title', 'abstract'], indirect=False,
                             ids=["where=%s" % t for t in ['title', 'abstract']])
    @pytest.mark.parametrize("an_instance", [None], indirect=True, ids=["docid=%s" % t for t in [None]])
    def test_search(self, where, an_instance):
        txt = "CDOM"
>       results = an_instance.search(txt, where=where)

argopy/tests/test_related.py:261: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
argopy/related/argo_documentation.py:232: in search
    if txt.lower() in ArgoDocs(docid).abstract.lower():
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <[KeyError('UR') raised in repr()] ArgoDocs object at 0x7fd2d77c7d90>

    @property
    def abstract(self):
        """Abstract of a document"""
        if self.docid is not None:
>           return self.ris['AB']
E           KeyError: 'AB'

argopy/related/argo_documentation.py:163: KeyError

that is very weird because this test is supposedly using a mocked http server, hence correct and always available data !

Most of the time, re-launching the failed test will make it pass on the 2nd attempt

@gmaze gmaze added bug Something isn't working CI Continuous Integration tools labels Sep 19, 2024
@gmaze gmaze changed the title CI tests failing because of "FAILED argopy/tests/test_related.py::Test_ArgoDocs::test_search[docid=None-where=abstract] - KeyError: 'AB'" CI tests failing with "Test_ArgoDocs::test_search[docid=None-where=abstract] - KeyError: 'AB'" Sep 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working CI Continuous Integration tools
Projects
None yet
Development

No branches or pull requests

1 participant