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

Unit tests with VCR cassettes no longer work #690

Closed
LeXofLeviafan opened this issue Jun 28, 2023 · 3 comments
Closed

Unit tests with VCR cassettes no longer work #690

LeXofLeviafan opened this issue Jun 28, 2023 · 3 comments
Labels

Comments

@LeXofLeviafan
Copy link
Collaborator

It appears that tests are failing because vcr-cassettes are broken now (locally as well… at least on clean environment).

Here's the summary of a recent test run on CI:

=========================== short test summary info ============================
ERROR tests/test_buku.py::test_network_handler_with_url[http:/example.com.-exp_res0] - ValueError: No cassettes found.
ERROR tests/test_buku.py::test_network_handler_with_url[about:new_page-exp_res3] - ValueError: No cassettes found.
ERROR tests/test_buku.py::test_network_handler_with_url[chrome:/version/-exp_res4] - ValueError: No cassettes found.
ERROR tests/test_buku.py::test_network_handler_with_url[chrome:/version/-exp_res5] - ValueError: No cassettes found.
ERROR tests/test_bukuDb.py::TestBukuDb::test_search_and_open_all_in_browser - ValueError: No cassettes found.
ERROR tests/test_bukuDb.py::TestBukuDb::test_search_by_multiple_tags_search_all - ValueError: No cassettes found.
ERROR tests/test_bukuDb.py::TestBukuDb::test_search_by_multiple_tags_search_any - ValueError: No cassettes found.
ERROR tests/test_bukuDb.py::TestBukuDb::test_search_by_tags_enforces_space_seprations_exclusion - ValueError: No cassettes found.
ERROR tests/test_bukuDb.py::test_delete_rec_range_and_delay_commit[0-0-True-y-exp_res0] - ValueError: No cassettes found.
ERROR tests/test_bukuDb.py::test_delete_rec_range_and_delay_commit[0-0-True-x-exp_res1] - ValueError: No cassettes found.
ERROR tests/test_bukuDb.py::test_delete_rec_range_and_delay_commit[0-0-False-y-exp_res2] - ValueError: No cassettes found.
ERROR tests/test_bukuDb.py::test_delete_rec_range_and_delay_commit[0-0-False-x-exp_res3] - ValueError: No cassettes found.
ERROR tests/test_bukuDb.py::test_browse_by_index - ValueError: No cassettes found.
====== 510 passed, 2 skipped, 41 warnings, 13 errors in 67.36s (0:01:07) =======

Some of these have no cassette file at all (even though the test is marked with one; i.e. that's the case for tests/test_bukuDb.py::TestBukuDb::test_search_and_open_all_in_browser). I'm guessing this is no longer valid?

Others have a cassette file but they ignore the path passed into the annotation; i.e., the test tests/test_bukuDb.py::TestBukuDb::test_search_by_multiple_tags_search_all declares that its cassette file should be named tests/vcr_cassettes/test_search_by_multiple_tags_search_all.yaml, but the actual location where pytest is looking for it now is tests/vcr_cassettes/tests.test_bukuDb/TestBukuDb.test_search_by_multiple_tags_search_all.yaml (the annotation parameter is outright ignored, regardless of the value).

Oddly enough, in case of tests/test_buku.py::test_network_handler_with_url, only the test cases without existing cassettes are failing; so it seems like the existing ones are located properly (…though the path specified in the annotation appears to not match their actual location 😅).

@jarun
Copy link
Owner

jarun commented Jun 30, 2023

Is there a way to fix or workaround these? Otherwise, can we block the tests?

@LeXofLeviafan
Copy link
Collaborator Author

It's unclear whether it's currently possible to disable the check for non-existent files (will need to investigate), but the existing ones can simply be moved/renamed (though it's better to check first if there's a working way to specify file location in the current version).

@LeXofLeviafan
Copy link
Collaborator Author

…Incidentally, this one no longer seems to be an issue.

@github-actions github-actions bot locked and limited conversation to collaborators Oct 13, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants