Feature: Pytest In A Subprocess - #1
Merged
Merged
Conversation
JamesVorder
marked this pull request as draft
July 13, 2024 14:11
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The goal of this PR is to improve our test execution methodology in two ways:
As of commit b0fd195, we have a fully working but messy implementation of a Pytest runner utilizing plugins for test output capture and generated module reload. The reason this is messy is because we have to interact directly with the Python import internals to reload the generated module on each iteration (so that it tests the newly generated code.) This implementation choice means our pytests are not allowed to do imports a la
from generated.test_class import .... This is a huge bummer, as most people do imports this way. In addition, it is necessary to have an emptygenerated/test_class.pyfile sitting around on the first run. That empty file requires management too, which is annoying.The changes in this PR introduce a
GenericTestRunnerclass, which can be implemented and injected into thechatfunction trivially. In addition, a "test result interpreter" has been added. This is another LLM invocation, which provides advice about what to change in the code under test. With these two things combined, we have a system that can easily be extended to test different types of code. We also gain the ability to do our imports however we want in the tests. :)