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

Fix test_index_advanced_filter API test re-running #17547

Merged

Conversation

nsoranzo
Copy link
Member

At the end of this test one history is made public. So, when re-running the API tests locally without wiping the database, the public history was also included in the results from the searches, causing the following error:

            name_contains = "history"
            query = f"?search={name_contains}"
            index_response = self._get(f"histories{query}").json()
>           assert len(index_response) == 3
E           AssertionError: assert 4 == 3
E            +  where 4 = len([{'annotation': None, 'archived': False, 'contents_url': '/api/histories/3393d74dbae390cc/contents', 'count': 0, ...}, {'annotation': None, 'archived': False, 'contents_url': '/api/histories/8cf91205f2f737f4/contents', 'count': 0, ...}, {'annotation': None, 'archived': False, 'contents_url': '/api/histories/b5065b03be4c41dc/contents', 'count': 0, ...}, {'annotation': None, 'archived': False, 'contents_url': '/api/histories/d9abeb98649a6a7e/contents', 'count': 0, ...}])

lib/galaxy_test/api/test_histories.py:194: AssertionError

Similarly, in the last part of the test the number of published histories was growing at each re-run.

Also removed a redundant test.

How to test the changes?

(Select all options that apply)

  • I've included appropriate automated tests.
  • This is a refactoring of components with existing test coverage.
  • Instructions for manual testing are as follows:
    1. [add testing steps and prerequisites here if you didn't write automated tests covering all your changes]

License

  • I agree to license these and all my past contributions to the core galaxy codebase under the MIT license.

At the end of this test one history is made public.
So, when re-running the API tests locally without wiping the database, the
public history was also included in the results from the searches, causing
the following error:

```
            name_contains = "history"
            query = f"?search={name_contains}"
            index_response = self._get(f"histories{query}").json()
>           assert len(index_response) == 3
E           AssertionError: assert 4 == 3
E            +  where 4 = len([{'annotation': None, 'archived': False, 'contents_url': '/api/histories/3393d74dbae390cc/contents', 'count': 0, ...}, {'annotation': None, 'archived': False, 'contents_url': '/api/histories/8cf91205f2f737f4/contents', 'count': 0, ...}, {'annotation': None, 'archived': False, 'contents_url': '/api/histories/b5065b03be4c41dc/contents', 'count': 0, ...}, {'annotation': None, 'archived': False, 'contents_url': '/api/histories/d9abeb98649a6a7e/contents', 'count': 0, ...}])

lib/galaxy_test/api/test_histories.py:194: AssertionError
```

Similarly, in the last part of the test the number of published histories
was growing at each re-run.

Also removed a redundant test.
@davelopez davelopez merged commit 5de7b6f into galaxyproject:dev Feb 27, 2024
52 of 54 checks passed
@nsoranzo nsoranzo deleted the fix_test_index_advanced_filter branch February 27, 2024 09:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants