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

Controlling for pymupdf version in test_pdf_reader_match_doc_details VCR #538

Merged
merged 2 commits into from
Oct 7, 2024

Conversation

jamesbraza
Copy link
Collaborator

As we see in this CI run, test_pdf_reader_match_doc_details has failed again. But it has a VCR, so why was it failing?

I traced it to going from pymupdf==1.24.10 to pymupdf==1.24.11 invalidating the VCR. So we can fix this now-failing test in one of two ways:

  1. Pinning pymupdf in dev dependencies
  2. Adding pymupdf to VCR key for this test

In this PR, I did the folowing:

  • Adjusted the test_pdf_reader_match_doc_details's VCR name to include pymupdf.__version__ in the name
  • Removed less specific match_on configuration from our conftest, and regenerated all VCR cassettes

@jamesbraza jamesbraza added the bug Something isn't working label Oct 7, 2024
@jamesbraza jamesbraza self-assigned this Oct 7, 2024
@dosubot dosubot bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Oct 7, 2024
@@ -45,7 +47,6 @@ def fixture_vcr_config() -> dict[str, Any]:
ANTHROPIC_API_KEY_HEADER,
"cookie",
],
"match_on": ["method", "host", "path", "query"],
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mskarlin do you know why we overrode the default match_on here? The default has 6 entries, why did we down-specify to 4?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huge win here lol, a latent bug was captured in this

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It has me slightly concerned that the version of pymupdf is in the name of this cassette
Will it break on the next version?

the others don't seem to have the same

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens is when a future dev/Renovate runs uv.lock (and assuming a new pymupdf version is out), CI will break until you regenerate this cassette

You're right that other tests don't have this naming special case, but it's because other tests were unaffected by the pymupdf version

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Oct 7, 2024
@jamesbraza jamesbraza merged commit 88a6e37 into main Oct 7, 2024
5 checks passed
@jamesbraza jamesbraza deleted the pinning-pymupdf branch October 7, 2024 15:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working lgtm This PR has been approved by a maintainer size:S This PR changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants