AutoGPT icon indicating copy to clipboard operation
AutoGPT copied to clipboard

Add tests for Agent

Open bobisme opened this issue 2 years ago • 5 comments

Background

agent.py is barely covered by tests. This is my beginning take at adding tests, starting slow with smaller functions and doing refactoring to get familiar with the module before taking on the massive start_interaction_loop.

Changes

  • Added tests for Agent._resolve_pathlike_command_args
  • Refactored Agent.get_self_feedback_loop to use formatted strings to hopefully be a little clearer.
  • Added a test for Agent.get_self_feedback_loop which checks the format for specific information.
  • Removed duplicate tests in tests/unit/test_get_self_feedback.py

Documentation

Added tests. Behavior and documentation unchanged.

Test Plan

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

bobisme avatar May 01 '23 19:05 bobisme

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
docs ⬜️ Ignored (Inspect) May 1, 2023 7:24pm

vercel[bot] avatar May 01 '23 19:05 vercel[bot]

Codecov Report

Patch coverage: 100.00% and project coverage change: -9.75 :warning:

Comparison is base (a30e5a8) 70.31% compared to head (28d401d) 60.57%.

:exclamation: Current head 28d401d differs from pull request most recent head 3e24f80. Consider uploading reports for the commit 3e24f80 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3639      +/-   ##
==========================================
- Coverage   70.31%   60.57%   -9.75%     
==========================================
  Files          71       69       -2     
  Lines        3504     3186     -318     
  Branches      561      530      -31     
==========================================
- Hits         2464     1930     -534     
- Misses        868     1122     +254     
+ Partials      172      134      -38     
Impacted Files Coverage Δ
autogpt/agent/agent.py 47.40% <100.00%> (-11.42%) :arrow_down:

... and 77 files with indirect coverage changes

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

codecov[bot] avatar May 01 '23 19:05 codecov[bot]

This is a mass message from the AutoGPT core team. Our apologies for the ongoing delay in processing PRs. This is because we are re-architecting the AutoGPT core!

For more details (and for infor on joining our Discord), please refer to: https://github.com/Significant-Gravitas/Auto-GPT/wiki/Architecting

p-i- avatar May 05 '23 00:05 p-i-

This pull request has conflicts with the base branch, please resolve those so we can evaluate the pull request.

github-actions[bot] avatar May 05 '23 19:05 github-actions[bot]

this is something that looks useful and compact in its current form, so could probably be considered as a candidate to be reviewed/integrated despite the ongoing re-arch effort - especially since, testing is needed for the re-arch as well

Boostrix avatar May 07 '23 06:05 Boostrix

Conflicts have been resolved! 🎉 A maintainer will review the pull request shortly.

github-actions[bot] avatar Jun 15 '23 00:06 github-actions[bot]

Deploy Preview for auto-gpt-docs ready!

Name Link
Latest commit 3e24f80ccc689a53e3be05a2997fece069260c27
Latest deploy log https://app.netlify.com/sites/auto-gpt-docs/deploys/648b920d5370230008da356e
Deploy Preview https://deploy-preview-3639--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 settings.

netlify[bot] avatar Jun 15 '23 00:06 netlify[bot]

Conflicts are resolved, but one test fails. @bobisme would you mind fixing the error so we can continue with review/merge?

Pwuts avatar Jun 15 '23 00:06 Pwuts

This pull request has conflicts with the base branch, please resolve those so we can evaluate the pull request.

github-actions[bot] avatar Jun 15 '23 22:06 github-actions[bot]

Conflicts have been resolved! 🎉 A maintainer will review the pull request shortly.

github-actions[bot] avatar Jun 15 '23 22:06 github-actions[bot]

This pull request has conflicts with the base branch, please resolve those so we can evaluate the pull request.

github-actions[bot] avatar Jul 13 '23 02:07 github-actions[bot]

The functionality corresponding to these tests has been removed, so I'll close this. Still, thanks for submitting! If you ever feel like contributing again, let us know on Discord. :)

Pwuts avatar Jul 17 '23 17:07 Pwuts