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

Set subprocess.PIPE on stdin and stderr and just let pytest run the currentt file when running main() #5868

Merged

Conversation

aorwall
Copy link
Contributor

@aorwall aorwall commented Oct 22, 2023

Background

If the agent will write a test based on the instructions it will miss to add stdin=subprocess.PIPE and can't send new moves to the game.

I also added pytest.main([__file__]) as the test otherwise seems to run all test files in the temp_folder.

Changes πŸ—οΈ

Added stdin=subprocess.PIPE and stderr=subprocess.PIPE to instructions.

I also added pytest.main([__file__]) as the test otherwise seems to run all test files in the temp_folder.

PR Quality Scorecard ✨

  • Have you used the PR description template?   +2 pts
  • Is your pull request atomic, focusing on a single change?   +5 pts
  • Have you linked the GitHub issue(s) that this PR addresses?   +5 pts
  • Have you documented your changes clearly and comprehensively?   +5 pts
  • Have you changed or added a feature?   -4 pts
    • Have you added/updated corresponding documentation?   +4 pts
    • Have you added/updated corresponding integration tests?   +5 pts
  • Have you changed the behavior of AutoGPT?   -5 pts
    • Have you also run agbenchmark to verify that these changes do not regress performance?   +10 pts

@aorwall aorwall requested a review from a team October 22, 2023 08:00
@netlify
Copy link

netlify bot commented Oct 22, 2023

βœ… Deploy Preview for auto-gpt-docs ready!

Name Link
πŸ”¨ Latest commit 2f02af2
πŸ” Latest deploy log https://app.netlify.com/sites/auto-gpt-docs/deploys/65d4809f5f4e65000818482f
😎 Deploy Preview https://deploy-preview-5868--auto-gpt-docs.netlify.app
πŸ“± Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Member

@Pwuts Pwuts left a comment

Choose a reason for hiding this comment

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

AutoGPT currently passes this test without issues, but I do agree with you that the spec currently isn't complete.

@@ -38,4 +38,4 @@ def test_game(inputs, expected_output):


if __name__ == "__main__":
pytest.main()
pytest.main([__file__])
Copy link
Member

Choose a reason for hiding this comment

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

I like this

@Pwuts Pwuts merged commit 4ef912d into Significant-Gravitas:master Feb 20, 2024
8 of 10 checks passed
@Pwuts
Copy link
Member

Pwuts commented Feb 20, 2024

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: βœ… Done
Development

Successfully merging this pull request may close these issues.

None yet

2 participants