mirror of
https://github.com/Significant-Gravitas/AutoGPT.git
synced 2026-01-09 23:28:07 -05:00
This pull request introduces a comprehensive backend testing guide and adds new tests for analytics logging and various API endpoints, focusing on snapshot testing. It also includes corresponding snapshot files for these tests. Below are the most significant changes: ### Documentation Updates: * Added a detailed `TESTING.md` file to the backend, providing a guide for running tests, snapshot testing, writing API route tests, and best practices. It includes examples for mocking, fixtures, and CI/CD integration. ### Analytics Logging Tests: * Implemented tests for logging raw metrics and analytics in `analytics_test.py`, covering success scenarios, various input values, invalid requests, and complex nested data. These tests utilize snapshot testing for response validation. * Added snapshot files for analytics logging tests, including responses for success cases, various metric values, and complex analytics data. [[1]](diffhunk://#diff-654bc5aa1951008ec5c110a702279ef58709ee455ba049b9fa825fa60f7e3869R1-R3) [[2]](diffhunk://#diff-e0a434b107abc71aeffb7d7989dbfd8f466b5e53f8dea25a87937ec1b885b122R1-R3) [[3]](diffhunk://#diff-dd0bc0b72264de1a0c0d3bd0c54ad656061317f425e4de461018ca51a19171a0R1-R3) [[4]](diffhunk://#diff-63af007073db553d04988544af46930458a768544cabd08412265e0818320d11R1-R30) ### Snapshot Files for API Endpoints: * Added snapshot files for various API endpoint tests, such as: - Graph-related operations (`graphs_get_single_response`, `graphs_get_all_response`, `blocks_get_all_response`). [[1]](diffhunk://#diff-b25dba271606530cfa428c00073d7e016184a7bb22166148ab1726b3e113dda8R1-R29) [[2]](diffhunk://#diff-1054e58ec3094715660f55bfba1676d65b6833a81a91a08e90ad57922444d056R1-R31) [[3]](diffhunk://#diff-cfd403ab6f3efc89188acaf993d85e6f792108d1740c7e7149eb05efb73d918dR1-R14) - User-related operations (`auth_get_or_create_user_response`, `auth_update_email_response`). [[1]](diffhunk://#diff-49e65ab1eb6af4d0163a6c54ed10be621ce7336b2ab5d47d47679bfaefdb7059R1-R5) [[2]](diffhunk://#diff-ac1216f96878bd4356454c317473654d5d5c7c180125663b80b0b45aa5ab52cbR1-R3) - Credit-related operations (`credits_get_balance_response`, `credits_get_auto_top_up_response`, `credits_top_up_request_response`). [[1]](diffhunk://#diff-189488f8da5be74d80ac3fb7f84f1039a408573184293e9ba2e321d535c57cddR1-R3) [[2]](diffhunk://#diff-ba3c4a6853793cbed24030cdccedf966d71913451ef8eb4b2c4f426ef18ed87aR1-R4) [[3]](diffhunk://#diff-43d7daa0c82070a9b6aee88a774add8e87533e630bbccbac5a838b7a7ae56a75R1-R3) - Graph execution and deletion (`blocks_execute_response`, `graphs_delete_response`). [[1]](diffhunk://#diff-a2ade7d646ad85a2801e7ff39799a925a612548a1cdd0ed99b44dd870d1465b5R1-R12) [[2]](diffhunk://#diff-c0d1cd0a8499ee175ce3007c3a87ba5f3235ce02d38ce837560b36a44fdc4a22R1-R3)## Summary - add pytest-snapshot to backend dev requirements - snapshot server route response JSONs - mention how to update stored snapshots ## Testing - `poetry run format` - `poetry run test` ### Checklist 📋 #### For code changes: - [x] I have clearly listed my changes in the PR description - [x] I have made a test plan - [x] I have tested my changes according to the test plan: <!-- Put your test plan here: --> - [x] run poetry run test --------- Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: Nicholas Tindle <nicholas.tindle@agpt.co>
189 lines
6.2 KiB
YAML
189 lines
6.2 KiB
YAML
site_name: AutoGPT Documentation
|
|
site_url: https://docs.agpt.co/
|
|
repo_url: https://github.com/Significant-Gravitas/AutoGPT
|
|
repo_name: AutoGPT
|
|
edit_uri: edit/master/docs/content
|
|
docs_dir: content
|
|
nav:
|
|
- Home: index.md
|
|
|
|
- The AutoGPT Platform 🆕:
|
|
- Getting Started:
|
|
- Setup AutoGPT (Local-Host): platform/getting-started.md
|
|
- Edit an Agent: platform/edit-agent.md
|
|
- Delete an Agent: platform/delete-agent.md
|
|
- Download & Import and Agent: platform/download-agent-from-marketplace-local.md
|
|
- Create a Basic Agent: platform/create-basic-agent.md
|
|
- Submit an Agent to the Marketplace: platform/submit-agent-to-marketplace.md
|
|
- Advanced Setup: platform/advanced_setup.md
|
|
- Agent Blocks: platform/agent-blocks.md
|
|
- Build your own Blocks: platform/new_blocks.md
|
|
- Using Ollama: platform/ollama.md
|
|
- Using D-ID: platform/d_id.md
|
|
- Blocks: platform/blocks/blocks.md
|
|
- Contributing:
|
|
- Tests: platform/contributing/tests.md
|
|
- AutoGPT Classic:
|
|
- Introduction: classic/index.md
|
|
- Setup:
|
|
- Setting up AutoGPT: classic/setup/index.md
|
|
- Set up with Docker: classic/setup/docker.md
|
|
- For Developers: classic/setup/for-developers.md
|
|
- Configuration:
|
|
- Options: classic/configuration/options.md
|
|
- Search: classic/configuration/search.md
|
|
- Voice: classic/configuration/voice.md
|
|
- Usage: classic/usage.md
|
|
- Help us improve AutoGPT:
|
|
- Share your debug logs with us: classic/share-your-logs.md
|
|
- Contribution guide: contributing.md
|
|
- Running tests: classic/testing.md
|
|
- Code of Conduct: code-of-conduct.md
|
|
- Benchmark:
|
|
- Readme: https://github.com/Significant-Gravitas/AutoGPT/blob/master/classic/benchmark/README.md
|
|
- Forge:
|
|
- Introduction: forge/get-started.md
|
|
- Components:
|
|
- Introduction: forge/components/introduction.md
|
|
- Agents: forge/components/agents.md
|
|
- Components: forge/components/components.md
|
|
- Protocols: forge/components/protocols.md
|
|
- Commands: forge/components/commands.md
|
|
- Built in Components: forge/components/built-in-components.md
|
|
- Creating Components: forge/components/creating-components.md
|
|
- Frontend:
|
|
- Readme: https://github.com/Significant-Gravitas/AutoGPT/blob/master/classic/frontend/README.md
|
|
|
|
- Contribute:
|
|
- Introduction: contribute/index.md
|
|
- Testing: autogpt_platform/backend/TESTING.md
|
|
|
|
# - Challenges:
|
|
# - Introduction: challenges/introduction.md
|
|
# - List of Challenges:
|
|
# - Memory:
|
|
# - Introduction: challenges/memory/introduction.md
|
|
# - Memory Challenge A: challenges/memory/challenge_a.md
|
|
# - Memory Challenge B: challenges/memory/challenge_b.md
|
|
# - Memory Challenge C: challenges/memory/challenge_c.md
|
|
# - Memory Challenge D: challenges/memory/challenge_d.md
|
|
# - Information retrieval:
|
|
# - Introduction: challenges/information_retrieval/introduction.md
|
|
# - Information Retrieval Challenge A: challenges/information_retrieval/challenge_a.md
|
|
# - Information Retrieval Challenge B: challenges/information_retrieval/challenge_b.md
|
|
# - Submit a Challenge: challenges/submit.md
|
|
# - Beat a Challenge: challenges/beat.md
|
|
|
|
- License: https://github.com/Significant-Gravitas/AutoGPT/blob/master/LICENSE
|
|
|
|
theme:
|
|
name: material
|
|
custom_dir: overrides
|
|
language: en
|
|
icon:
|
|
repo: fontawesome/brands/github
|
|
logo: material/book-open-variant
|
|
edit: material/pencil
|
|
view: material/eye
|
|
favicon: assets/favicon.png
|
|
features:
|
|
- navigation.sections
|
|
- navigation.footer
|
|
- navigation.top
|
|
- navigation.tracking
|
|
- navigation.tabs
|
|
# - navigation.path
|
|
- toc.follow
|
|
- toc.integrate
|
|
- content.action.edit
|
|
- content.action.view
|
|
- content.code.copy
|
|
- content.code.annotate
|
|
- content.tabs.link
|
|
palette:
|
|
# Palette toggle for light mode
|
|
- media: "(prefers-color-scheme: light)"
|
|
scheme: default
|
|
toggle:
|
|
icon: material/weather-night
|
|
name: Switch to dark mode
|
|
|
|
# Palette toggle for dark mode
|
|
- media: "(prefers-color-scheme: dark)"
|
|
scheme: slate
|
|
toggle:
|
|
icon: material/weather-sunny
|
|
name: Switch to light mode
|
|
|
|
markdown_extensions:
|
|
# Python Markdown
|
|
- abbr
|
|
- admonition
|
|
- attr_list
|
|
- def_list
|
|
- footnotes
|
|
- md_in_html
|
|
- toc:
|
|
permalink: true
|
|
- tables
|
|
|
|
# Python Markdown Extensions
|
|
- pymdownx.arithmatex:
|
|
generic: true
|
|
- pymdownx.betterem:
|
|
smart_enable: all
|
|
- pymdownx.critic
|
|
- pymdownx.caret
|
|
- pymdownx.details
|
|
- pymdownx.emoji:
|
|
emoji_index: !!python/name:material.extensions.emoji.twemoji
|
|
emoji_generator: !!python/name:material.extensions.emoji.to_svg
|
|
- pymdownx.highlight
|
|
- pymdownx.inlinehilite
|
|
- pymdownx.keys
|
|
- pymdownx.mark
|
|
- pymdownx.smartsymbols
|
|
- pymdownx.snippets:
|
|
base_path: ['.','../']
|
|
check_paths: true
|
|
dedent_subsections: true
|
|
- pymdownx.superfences:
|
|
custom_fences:
|
|
- name: mermaid
|
|
class: mermaid
|
|
format: !!python/name:pymdownx.superfences.fence_code_format
|
|
- pymdownx.tabbed:
|
|
alternate_style: true
|
|
- pymdownx.tasklist:
|
|
custom_checkbox: true
|
|
- pymdownx.tilde
|
|
|
|
plugins:
|
|
- table-reader
|
|
- search
|
|
- git-revision-date-localized:
|
|
enable_creation_date: true
|
|
|
|
extra:
|
|
social:
|
|
- icon: fontawesome/brands/github
|
|
link: https://github.com/Significant-Gravitas/AutoGPT
|
|
- icon: fontawesome/brands/x-twitter
|
|
link: https://x.com/Auto_GPT
|
|
- icon: fontawesome/brands/instagram
|
|
link: https://www.instagram.com/autogpt/
|
|
- icon: fontawesome/brands/discord
|
|
link: https://discord.gg/autogpt
|
|
|
|
extra:
|
|
analytics:
|
|
provider: google
|
|
property: G-XKPNKB9XG6
|
|
|
|
extra_javascript:
|
|
- https://unpkg.com/tablesort@5.3.0/dist/tablesort.min.js
|
|
- _javascript/tablesort.js
|
|
- _javascript/mathjax.js
|
|
- https://cdnjs.cloudflare.com/polyfill/v3/polyfill.min.js?features=es6
|
|
- https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js
|