AutoGPT
AutoGPT copied to clipboard
VCR Fix for debug_code_challenge_a
Background
When using @pytest.vcr.mark, and then using docker, the test hangs as vcr intercepts the docker call, and is stuck inside an infinite loop. This is due to the vcr library checking if the instance is part of the vcr class, and if it isn't it's stuck inside a while loop. The test is from @merwanehamadi
Changes
I modified the vcr library to skip the while loop if the instance is docker. This prevents the hang, and tests using @pytest.vcr.mark work correctly now. As a result, I modified requirements.txt to use my slightly modified version of vcr with the fix, find pr here: https://github.com/kevin1024/vcrpy/pull/692
Documentation
The test comes from @merwanehamadi, and I modified the vcrpy library to allow @pytest.mark.vcr to work without hanging the test.
Test Plan
I have tested the test with my version of vcrpy, and everything works perfectly.
PR Quality Checklist
- [x] My pull request is atomic and focuses on a single change.
- [x] I have thoroughly tested my changes with multiple different prompts.
- [x] I have considered potential risks and mitigations for my changes.
- [x] I have documented my changes clearly and comprehensively.
- [x] I have not snuck in any "extra" small tweaks changes
I have not added tests as all I have done is fix the vcr hanging issue, which will not affect the functionality of vcr if the instance is not docker.
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Comments | Updated (UTC) |
---|---|---|---|---|
docs | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | May 6, 2023 9:11pm |
This PR exceeds the recommended size of 200 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size
Fantastic! I'll try to test this later today. Most likely for tomorrow.
This pull request has conflicts with the base branch, please resolve those so we can evaluate the pull request.
A bajilion years later. This appears to work. The agent removes all errors by re-writing the code.py with a single print statement, but the test still passes for some reason. I'm gonna try to figure out why.
You must manually remove the existing vcrpy lib though, so we will need to figure out why that is and how to mitigate that going forward
Conflicts have been resolved! 🎉 A maintainer will review the pull request shortly.
This pull request has conflicts with the base branch, please resolve those so we can evaluate the pull request.
Already picked up in another PR according to Wayne. Closing :)