From 02f546d2bc9cb0744da9badab7d1fe5f51ac1446 Mon Sep 17 00:00:00 2001 From: merwanehamadi Date: Wed, 26 Apr 2023 18:45:03 -0700 Subject: [PATCH] Run the integration tests in the CI pipeline BUT without API keys (#3359) * integration tests in ci pipeline * Update CONTRIBUTING.md Co-authored-by: Reinier van der Leer --------- Co-authored-by: Reinier van der Leer --- .github/workflows/ci.yml | 2 - CONTRIBUTING.md | 15 + tests/integration/__init__.py | 0 .../test_local_cache/test_get_relevant.yaml | 500 ++++++++++++++++++ ...t_generate_aiconfig_automatic_default.yaml | 93 ++++ ..._generate_aiconfig_automatic_fallback.yaml | 87 +++ ...t_generate_aiconfig_automatic_typical.yaml | 97 ++++ tests/{ => integration}/test_local_cache.py | 1 + tests/integration/test_setup.py | 78 +++ tests/test_image_gen.py | 6 + tests/unit/test_commands.py | 1 + tests/unit/test_setup.py | 78 --- tests/utils.py | 23 +- 13 files changed, 897 insertions(+), 84 deletions(-) create mode 100644 tests/integration/__init__.py create mode 100644 tests/integration/cassettes/test_local_cache/test_get_relevant.yaml create mode 100644 tests/integration/cassettes/test_setup/test_generate_aiconfig_automatic_default.yaml create mode 100644 tests/integration/cassettes/test_setup/test_generate_aiconfig_automatic_fallback.yaml create mode 100644 tests/integration/cassettes/test_setup/test_generate_aiconfig_automatic_typical.yaml rename tests/{ => integration}/test_local_cache.py (99%) create mode 100644 tests/integration/test_setup.py delete mode 100644 tests/unit/test_setup.py diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2815bb13173c..ede81c2cfa89 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -72,8 +72,6 @@ jobs: - name: Run unittest tests with coverage run: | pytest --cov=autogpt --cov-report term-missing --cov-branch --cov-report xml --cov-report term - env: - OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} - name: Upload coverage reports to Codecov uses: codecov/codecov-action@v3 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 10043ecb6ac6..1ac320bd93f9 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -105,3 +105,18 @@ To increase coverage if necessary, [write tests using `pytest`]. For more info on running tests, please refer to ["Running tests"](https://significant-gravitas.github.io/Auto-GPT/testing/). [write tests using `pytest`]: https://realpython.com/pytest-python-testing/ + + +In Pytest, we use VCRpy. It's a package that allows us to save OpenAI and other API providers' responses. +When you run Pytest locally: + +- If no prompt change: you will not consume API tokens because there are no new OpenAI calls required. +- If the prompt changes in a way that the cassettes are not reusable: + - If no API key, the test fails. It requires a new cassette. So, add an API key to .env. + - If the API key is present, the tests will make a real call to OpenAI. + - If the test ends up being successful, your prompt changes didn't introduce regressions. This is good. Commit your cassettes to your PR. + - If the test is unsuccessful: + - Either: Your change made Auto-GPT less capable, in that case, you have to change your code. + - Or: The test might be poorly written. In that case, you can make suggestions to change the test. + +In our CI pipeline, Pytest will use the cassettes and not call paid API providers, so we need your help to record the replays that you break. diff --git a/tests/integration/__init__.py b/tests/integration/__init__.py new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/tests/integration/cassettes/test_local_cache/test_get_relevant.yaml b/tests/integration/cassettes/test_local_cache/test_get_relevant.yaml new file mode 100644 index 000000000000..8bd349291512 --- /dev/null +++ b/tests/integration/cassettes/test_local_cache/test_get_relevant.yaml @@ -0,0 +1,500 @@ +interactions: +- request: + body: '{"input": ["Sample text 1"], "model": "text-embedding-ada-002", "encoding_format": + "base64"}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '92' + Content-Type: + - application/json + method: POST + uri: https://api.openai.com/v1/embeddings + response: + body: + string: !!binary | + H4sIAAAAAAAAA1R6SxOyOrfm/PsVu/aU/kpFJIs9AwG5miB4o6urSwQREJFLAuTU+e9d+p463T1x + ALGiycpzW/mPf/31199NUmb34e9//vr7VfTD3//j+yy9Dbe///nrf/7rr7/++us/fp//38isTrI0 + Ld75b/jvZfFOs+nvf/5a/veT/zvon7/+NuPiQ5nS1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CI3aUN6399cvB/ecfifnNU2elpc2PH/H0zccG+BxakLPThRGl2SWzfhlnpXGkFUv3 + 01sfZ+/RIDlIAyp/83++cLIAQt+byZ5d1t4vfwdrP03MMHZbPmTFIADfLlyyjZwVGpaWUmxaHzxy + 4ShIeOL51fq0KjFthXvCp0tpiZBi+u2fnMqIRVsewLcfTB+WNib9LPsydKN3xcu8OaM5D+8Vqh/H + BTl885XhmwcoR3udY3m7p8msxKxFzd6rqODyqZxscwXQLbY5Xk/zp5sCpxTh+/6Pv2kq+Rmib/+T + bXt/k8xMMoVfv5D96bf+8tpv/kqMcnsv52+/GnD+qsg26jgfU6S7v7wQr7n8LLnvNQJ895fOga8n + 4q+efDgmTP/4u2QthZ4AD02U8Rw8HnwIVKkF6yC8mauedt3MHHOLqt6n/6Vflq2FIYi1J9O//WD+ + 6WuMgsTI2DagWjJibm/h79+tgP/8119//a/fDYO6SbPX92LAkE3Dv//7qsC/b+nt38ul+G8m/rmJ + QPtbnv39z39dQvj70zX1Z/jfQ1Nl7/7vf/6S/tw2+Htohtvr/3n8r+9c//mv/wMAAP//AwCkxTP2 + 4SAAAA== + headers: + CF-Cache-Status: + - DYNAMIC + CF-RAY: + - 7be211a83807169e-SJC + Connection: + - keep-alive + Content-Encoding: + - gzip + Content-Type: + - application/json + Date: + - Wed, 26 Apr 2023 21:55:16 GMT + Server: + - cloudflare + access-control-allow-origin: + - '*' + alt-svc: + - h3=":443"; ma=86400, h3-29=":443"; ma=86400 + openai-organization: + - user-adtx4fhfg1qsiyzdoaxciooj + openai-processing-ms: + - '311' + openai-version: + - '2020-10-01' + strict-transport-security: + - max-age=15724800; includeSubDomains + x-ratelimit-limit-requests: + - '3000' + x-ratelimit-remaining-requests: + - '2999' + x-ratelimit-reset-requests: + - 20ms + x-request-id: + - 665023d2f6ce38148bbb6db93c66bb82 + status: + code: 200 + message: OK +- request: + body: '{"input": ["Sample text 2"], "model": "text-embedding-ada-002", "encoding_format": + "base64"}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '92' + Content-Type: + - application/json + method: POST + uri: https://api.openai.com/v1/embeddings + response: + body: + string: !!binary | + H4sIAAAAAAAAA1R6W9O6vJbn/f4Ub723zi4BkYR9x0nOJCiKOjU1BYgICMghAdLV331K/7t6um+e + Cx6EWmHld1r5j3/89dffXVrl2fT3v/76+12O09//63vtkUzJ3//663//46+//vrrP35//8edeZPm + j0fZFr/bf/8s20e+/P2vv7j/uvL/b/rXX3+PA19Q5yVYKZuW7ix1zX5Dre0xABNeX2e5CviZms81 + 0sd7il0Y1XxL8bzt9YkEuIBShzOyRHOYzvviHcJ7sOcQ3y4LY7wDOJB7rY9VVxe80ffjEppne8WO + dMf6qAmbEKjHViZygrSUlXZ5hkrRC1Q1PAKIs0ENOOJnhbbCbklZthVjyDYSILtj1nsLFTY3sL0J + B4qj+w5Mwno0ZPNq6jRQYBPR7XlW5Jfmd9jdEDNdYL3fwPQcytRA5MCWtxfYQDIuBtWG5KbPqXAZ + oXZmL1S/RSdlt4tygm53wNSQhjKaHq3fQLFe3vhg3a/6sr5LDv7eb0GlTKduVVYJ3bwzql1cgrVQ + +wSeQs2mRhJZw+dsKTc44scbq3tzieZtznzoDlpBHUfGw8yu7Ax68/lAgiK+PCadphkYu7JGrNF4 + j5TMVaD9sCV6YXFUdYEQ3KA2Nhh774dXkSZWbzB6XB3sBTUDK6lEAX4cN8XeoxMrdpy8G0hl2mAD + 33iwuscxgzgSUsLhG8+WxAhCCdHPQg2nQMPaPlYXdst1okqf0GEq2SrI19exxepbGyuWCkIJHHQ7 + YV/lzYhNSxHDodEgPtz8MBpVSWqgfEkQqQ7eNVpfwzGE8SoX1DRVzhsDVSqlOn3qRAyrXp97pPhy + kSU6NQYVRuQ1HE+gUDcX6itXGbBHFyMoZ+KAxGyn6Fx492eYXbMXtt7bI1vTSY/h3EUFPvgtGdYy + pSI4xNUTFQJ5D+vrWfvw4oEKuw7ZDlTcXV3I53mCA/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NLplbRPFEhBz88BXfx + w1YV9yYsicAToG5P+vjbj++i5r7zPNGb7PhYy8W6z8gbI/dPXgRvC+fRZ6ca+jolWw1883eypVoe + sfCd9NA5yU+Kglmpdms4JHuY9Tfsm5t7Shdb6qHjPVT6+FQr+Pz8JRC/XfrF/z/5tRQfQ6ojpFb8 + +i4FaGbdGStfPOieaG8CDbxdHIz7Evz0mSRcUUjKbaV6/OtMN8A1/N2Xz0qdgmXu5EUxMLa3Vum9 + el5GEu3UAPvnwgQfUXI4iAsUY2Pc2Pq6As+EQYsC1GBCopl/jsYvv6L27IfVgtdPDDUFXbDZiAsb + /WrugLwPG2yUaz9MWiWOf/ZLt3fjgb2FQ7c/SMTG7lx+9JXtzBl+uOqI5oExQDh37OHxfFGJwPwW + LJJTJbJb1CvNv/7nm1f4MC9vwne+W6bsFEvn3++xkfFbj5GXAGFwCVUaypyRLpvNNv/x30//DMQM + qxMYWYfxk2qb9Dc/A48zq8jwzW8moRk1uGseOfZdNkbjPlZPoNY3DckyKg5UUu4a5DvJwb5qnjy2 + e2sJ9O7nFqei7Xtr7O9CuT5tX188GdP5AMD6q5ca7XGqlnuj3+CnbA/Y2EPire/xlIPUX59fPFfS + OSuMDl7U2aTaN0+fc0uJ//SPfidbfX0So4T31cxxYHJBtZj0Iv6Zz6pqzfTFS0wNtmf6RGJJ22hh + e7uHhoMeSCpyIxX6q1uDZ9QhwuLJGPhhuCN4d+IOSb2ZpH2ZttJPL1KsDbpHIziKv/pR/XZ4nfm3 + MYGynmvUu4sOWKwd6n/4SP0tIX/4EP79OxXwn//466//8zth0HSP/P09GDDly/TP/zoq8M/kkfyT + 44R/UuHPSQQyJkX+97/+fQjh78/QNZ/p/05dnbfj3//6S/xz2uDvqZuS93+7/I/vu/7zH/8PAAD/ + /wMAVLQZa+EgAAA= + headers: + CF-Cache-Status: + - DYNAMIC + CF-RAY: + - 7be211ab1afd169e-SJC + Connection: + - keep-alive + Content-Encoding: + - gzip + Content-Type: + - application/json + Date: + - Wed, 26 Apr 2023 21:55:16 GMT + Server: + - cloudflare + access-control-allow-origin: + - '*' + alt-svc: + - h3=":443"; ma=86400, h3-29=":443"; ma=86400 + openai-organization: + - user-adtx4fhfg1qsiyzdoaxciooj + openai-processing-ms: + - '172' + openai-version: + - '2020-10-01' + strict-transport-security: + - max-age=15724800; includeSubDomains + x-ratelimit-limit-requests: + - '3000' + x-ratelimit-remaining-requests: + - '2999' + x-ratelimit-reset-requests: + - 20ms + x-request-id: + - 5b810c395d48248e473bc4e53de0eafa + status: + code: 200 + message: OK +- request: + body: '{"input": ["Sample text 1"], "model": "text-embedding-ada-002", "encoding_format": + "base64"}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '92' + Content-Type: + - application/json + method: POST + uri: https://api.openai.com/v1/embeddings + response: + body: + string: !!binary | + H4sIAAAAAAAAA1R6SxOyOrfm/PsVu/aU/kpFJIs9AwG5miB4o6urSwQREJFLAuTU+e9d+p463T1x + ALGiycpzW/mPf/31199NUmb34e9//vr7VfTD3//j+yy9Dbe///nrf/7rr7/++us/fp//38isTrI0 + Ld75b/jvZfFOs+nvf/5a/veT/zvon7/+NuPiQ5nS1Anz5acM4uJ1ZNpa6bouyZMjLJdQMZs0H071 + gcrA3keVHUtt4GxxmpbKpd8Q5urcTppOaEXZRcct8U/hJ+LRfchQhzZv4iqmnoz4sN3CaV17ePPq + P15npqcc9Pf9yLCTWmi8r4mBLoLgMxWNqKR6tKTwcM83rLRb8OZ4jLcgX4URN/ux8KgSvxtUsFJl + ji1XiBfJs1dO/JwwcyO5+oS8tQGQGluyS6ibDOB1N3AIDfAQNarXy5f4iE5iTpgpd5bOk8GtoPH0 + HsOptJOxux9cqNitYI6nd2WR7zcusGJ7JGpq5px/KtyjfIMRUzeG7bHJkVto/O1AVxpqk1m0BRFN + SbH/vdeHi6MBXGZXI/jlC5wv2PWIOOlvTDvOQTJpbiSjOiUWBn67JNy/Xn3wyyUi2HaSjk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HOLqt6n/6Vflq2FIYi1J9O//WD+ + 6WuMgsTI2DagWjJibm/h79+tgP/8119//a/fDYO6SbPX92LAkE3Dv//7qsC/b+nt38ul+G8m/rmJ + QPtbnv39z39dQvj70zX1Z/jfQ1Nl7/7vf/6S/tw2+Htohtvr/3n8r+9c//mv/wMAAP//AwCkxTP2 + 4SAAAA== + headers: + CF-Cache-Status: + - DYNAMIC + CF-RAY: + - 7be211ac8cdd169e-SJC + Connection: + - keep-alive + Content-Encoding: + - gzip + Content-Type: + - application/json + Date: + - Wed, 26 Apr 2023 21:55:16 GMT + Server: + - cloudflare + access-control-allow-origin: + - '*' + alt-svc: + - h3=":443"; ma=86400, h3-29=":443"; ma=86400 + openai-organization: + - user-adtx4fhfg1qsiyzdoaxciooj + openai-processing-ms: + - '114' + openai-version: + - '2020-10-01' + strict-transport-security: + - max-age=15724800; includeSubDomains + x-ratelimit-limit-requests: + - '3000' + x-ratelimit-remaining-requests: + - '2999' + x-ratelimit-reset-requests: + - 20ms + x-request-id: + - d39b785f954e1f1cc64746735c44b522 + status: + code: 200 + message: OK +version: 1 diff --git a/tests/integration/cassettes/test_setup/test_generate_aiconfig_automatic_default.yaml b/tests/integration/cassettes/test_setup/test_generate_aiconfig_automatic_default.yaml new file mode 100644 index 000000000000..e8cbefa10e63 --- /dev/null +++ b/tests/integration/cassettes/test_setup/test_generate_aiconfig_automatic_default.yaml @@ -0,0 +1,93 @@ +interactions: +- request: + body: '{"model": "gpt-3.5-turbo", "messages": [{"role": "system", "content": "\nYour + task is to devise up to 5 highly effective goals and an appropriate role-based + name (_GPT) for an autonomous agent, ensuring that the goals are optimally aligned + with the successful completion of its assigned task.\n\nThe user will provide + the task, you will provide only the output in the exact format specified below + with no explanation or conversation.\n\nExample input:\nHelp me with marketing + my business\n\nExample output:\nName: CMOGPT\nDescription: a professional digital + marketer AI that assists Solopreneurs in growing their businesses by providing + world-class expertise in solving marketing problems for SaaS, content products, + agencies, and more.\nGoals:\n- Engage in effective problem-solving, prioritization, + planning, and supporting execution to address your marketing needs as your virtual + Chief Marketing Officer.\n\n- Provide specific, actionable, and concise advice + to help you make informed decisions without the use of platitudes or overly + wordy explanations.\n\n- Identify and prioritize quick wins and cost-effective + campaigns that maximize results with minimal time and budget investment.\n\n- + Proactively take the lead in guiding you and offering suggestions when faced + with unclear information or uncertainty to ensure your marketing strategy remains + on track.\n"}, {"role": "user", "content": "Task: ''Write a wikipedia style + article about the project: https://github.com/significant-gravitas/Auto-GPT''\nRespond + only with the output in the exact format specified in the system prompt, with + no explanation or conversation.\n"}], "temperature": 0.0, "max_tokens": null}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '1671' + Content-Type: + - application/json + method: POST + uri: https://api.openai.com/v1/chat/completions + response: + body: + string: !!binary | + H4sIAAAAAAAAA1xSS2/UMBC+8ytGvnBJVt3tgzZHoBQkXgdQKyiqHHuSTOvMpPZkt6uq/x3FWfrg + aHvme/rekDeVcZ1V1w+hfHPSffy0Hz6ff6sPls3p9cHtr4tv2y8/6e3FWWMKI/U1Ot1tLJz0Q0Al + YVMYF9EqelMtj45XhweHR0fHhenFYzCVaQct9xeHpY6xlnJvf29pCjMm26Kp7s0QpR/0SuUGOZlq + dbJfmCfsx/vl6qQwKmrD49XBavVQGNcJOUym+n1vekz/YKMENJWxKVFSyzqJFFbkycBX22MF53RD + Z99/XPJ7TC7SMPFVYBnsqMLSy5jAtsgKHhO1jB5UYEYEYtAOIRsnYZAm4w3oyZZJtwHBRiUXMEG9 + hSHKmjxxCxuJwZcu2JQA7waMSgknuIgJbXRdAZtIStwWYNlDI7G3Op0Xl3wmNqTqkkt4J+xHp6Cd + RBnb7nEdZFbW0hoZVAZyk2zkNEYE69wYrdtm6F3MyJjSZIB4JiPhxcRxHkkROmq78na0gXQLuwxB + O6tACZBb22atj8trnIVvMIQyaRydjhF9AY2EIJspg6xvJI+BGFOenkryNvr0Isks40PGzUu7SCcb + EnOcKk/TrxPskmf/DH/S5sKYx4coA0ZwpNnmzB2xwYjsMC3maEOwtUSrCBvSLjOPCeNERuwkDvOj + dkgRGkRfW3eToXp7g8Dopo8YtxBxTSnzqDw3kHlO50pylM/N9YiaXrhiUVtTLuC/2KYKArVUB5x+ + CgxjHcjNFZqHwjTElLqriDYJm8oklcEUhtjjnan2Hv48vPoLAAD//wMAbCMiNQcEAAA= + headers: + CF-Cache-Status: + - DYNAMIC + CF-RAY: + - 7be206beca7ccfbc-SJC + Cache-Control: + - no-cache, must-revalidate + Connection: + - keep-alive + Content-Encoding: + - gzip + Content-Type: + - application/json + Date: + - Wed, 26 Apr 2023 21:47:58 GMT + Server: + - cloudflare + access-control-allow-origin: + - '*' + alt-svc: + - h3=":443"; ma=86400, h3-29=":443"; ma=86400 + openai-model: + - gpt-3.5-turbo-0301 + openai-organization: + - user-adtx4fhfg1qsiyzdoaxciooj + openai-processing-ms: + - '9927' + openai-version: + - '2020-10-01' + strict-transport-security: + - max-age=15724800; includeSubDomains + x-ratelimit-limit-requests: + - '3500' + x-ratelimit-remaining-requests: + - '3499' + x-ratelimit-reset-requests: + - 17ms + x-request-id: + - 575539561e8025c9a37920ffb4d1b354 + status: + code: 200 + message: OK +version: 1 diff --git a/tests/integration/cassettes/test_setup/test_generate_aiconfig_automatic_fallback.yaml b/tests/integration/cassettes/test_setup/test_generate_aiconfig_automatic_fallback.yaml new file mode 100644 index 000000000000..6ddfe32ab5fe --- /dev/null +++ b/tests/integration/cassettes/test_setup/test_generate_aiconfig_automatic_fallback.yaml @@ -0,0 +1,87 @@ +interactions: +- request: + body: '{"model": "gpt-3.5-turbo", "messages": [{"role": "system", "content": "\nYour + task is to devise up to 5 highly effective goals and an appropriate role-based + name (_GPT) for an autonomous agent, ensuring that the goals are optimally aligned + with the successful completion of its assigned task.\n\nThe user will provide + the task, you will provide only the output in the exact format specified below + with no explanation or conversation.\n\nExample input:\nHelp me with marketing + my business\n\nExample output:\nName: CMOGPT\nDescription: a professional digital + marketer AI that assists Solopreneurs in growing their businesses by providing + world-class expertise in solving marketing problems for SaaS, content products, + agencies, and more.\nGoals:\n- Engage in effective problem-solving, prioritization, + planning, and supporting execution to address your marketing needs as your virtual + Chief Marketing Officer.\n\n- Provide specific, actionable, and concise advice + to help you make informed decisions without the use of platitudes or overly + wordy explanations.\n\n- Identify and prioritize quick wins and cost-effective + campaigns that maximize results with minimal time and budget investment.\n\n- + Proactively take the lead in guiding you and offering suggestions when faced + with unclear information or uncertainty to ensure your marketing strategy remains + on track.\n"}, {"role": "user", "content": "Task: ''T&GF\u00a3OIBECC()!*''\nRespond + only with the output in the exact format specified in the system prompt, with + no explanation or conversation.\n"}], "temperature": 0.0, "max_tokens": null}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '1592' + Content-Type: + - application/json + method: POST + uri: https://api.openai.com/v1/chat/completions + response: + body: + string: !!binary | + H4sIAAAAAAAAA0yOTUsDMRCG7/6KYS5esqUf1tqcFdSLHoqCIjKbne6mzWZCMusHpf9dCmp7e3m/ + eHboG7ToOlLXp1Atlt3t6unbtbebl5vVc/2wWmiYbbfu+n54QINSb9jp72LkpE+B1UtEgy4zKTdo + J5dX0/nF/HKxNNhLwwEttkmr2Whe6ZBrqcaz8QQNDoVaRrvDlKVP+q6y5VjQTq/GBo/f//5sYlBF + KZw4k71B14l3XNC+7rDn8veaJTBapFJ8UYp6YJSoHA/8d+c9FMn528AdOIpRFFKWD98wUAQZNA0K + n147GRQIPij4BpTKdgSPganwsX4Swloy9Awq0HLkTMpAKWVJ2R90KxQKUGyA4MBX1VS4gUg9j3Bv + cO2jL917ZioS0WJRSWjQx4a/0I73b/uzHwAAAP//AwBPrscAswEAAA== + headers: + CF-Cache-Status: + - DYNAMIC + CF-RAY: + - 7be20701ea0a9669-SJC + Cache-Control: + - no-cache, must-revalidate + Connection: + - keep-alive + Content-Encoding: + - gzip + Content-Type: + - application/json + Date: + - Wed, 26 Apr 2023 21:48:01 GMT + Server: + - cloudflare + access-control-allow-origin: + - '*' + alt-svc: + - h3=":443"; ma=86400, h3-29=":443"; ma=86400 + openai-model: + - gpt-3.5-turbo-0301 + openai-organization: + - user-adtx4fhfg1qsiyzdoaxciooj + openai-processing-ms: + - '1833' + openai-version: + - '2020-10-01' + strict-transport-security: + - max-age=15724800; includeSubDomains + x-ratelimit-limit-requests: + - '3500' + x-ratelimit-remaining-requests: + - '3499' + x-ratelimit-reset-requests: + - 17ms + x-request-id: + - c9bf165259547ec59a88bd16b5f691f2 + status: + code: 200 + message: OK +version: 1 diff --git a/tests/integration/cassettes/test_setup/test_generate_aiconfig_automatic_typical.yaml b/tests/integration/cassettes/test_setup/test_generate_aiconfig_automatic_typical.yaml new file mode 100644 index 000000000000..980a0a1070a4 --- /dev/null +++ b/tests/integration/cassettes/test_setup/test_generate_aiconfig_automatic_typical.yaml @@ -0,0 +1,97 @@ +interactions: +- request: + body: '{"model": "gpt-3.5-turbo", "messages": [{"role": "system", "content": "\nYour + task is to devise up to 5 highly effective goals and an appropriate role-based + name (_GPT) for an autonomous agent, ensuring that the goals are optimally aligned + with the successful completion of its assigned task.\n\nThe user will provide + the task, you will provide only the output in the exact format specified below + with no explanation or conversation.\n\nExample input:\nHelp me with marketing + my business\n\nExample output:\nName: CMOGPT\nDescription: a professional digital + marketer AI that assists Solopreneurs in growing their businesses by providing + world-class expertise in solving marketing problems for SaaS, content products, + agencies, and more.\nGoals:\n- Engage in effective problem-solving, prioritization, + planning, and supporting execution to address your marketing needs as your virtual + Chief Marketing Officer.\n\n- Provide specific, actionable, and concise advice + to help you make informed decisions without the use of platitudes or overly + wordy explanations.\n\n- Identify and prioritize quick wins and cost-effective + campaigns that maximize results with minimal time and budget investment.\n\n- + Proactively take the lead in guiding you and offering suggestions when faced + with unclear information or uncertainty to ensure your marketing strategy remains + on track.\n"}, {"role": "user", "content": "Task: ''Help me create a rock opera + about cybernetic giraffes''\nRespond only with the output in the exact format + specified in the system prompt, with no explanation or conversation.\n"}], "temperature": + 0.0, "max_tokens": null}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '1625' + Content-Type: + - application/json + method: POST + uri: https://api.openai.com/v1/chat/completions + response: + body: + string: !!binary | + H4sIAAAAAAAAA4yU0W/bRgzG3/dXEPcsB04ad53ehg1riwFNthXYgGUo6BMlcT4dVZJy4gT534uT + ZWcr9rAXAZZ5Hz/++J2eAjehDrFHj8OYVt9+1//0y+XP797n6w/DbnvTdts/9reXwzr9Fj+GKsj2 + b4q+nLiIMoyJnCWHKkQldGpCffn6zdXmerPZXFVhkIZSqEM3+urVxWblk25ltX61vgxVmAw7CvVT + GFWG0T+57ChbqK/eXFfhRfvl/eXrKrg4pvOrzXr9XIXYC0eyUP/5FAayk6xKolAHNGNzzF5MSnbK + ZYAPOFANv97cvr39eJd/JIvKY2lXA2b4/j3M8/CeIEq2KRUB8B4dbKTImPiRDDhDT2nk3AGqs7kB + 5gaGyTgyZoOtlv+8J1aYMn+eCPZsLNnABRK3dLGYALajdMsRUzpAQ8ZdpqYUHmco7bynxZpkkBZU + 4g5kJEWrYFTZc1M60sNI6tBN3GCONLuyaRxFyxQqU9fL5LMaZWelcjaS2cVdfiuYrL7LK/hBUsKt + KDrBPXsPB5mKnYb2lGQEhLImSqm0NBc9JM50xBRx9EnJjj3MqNiQFuJhS5rJOULHim1LR2YzKQP2 + E5iTzyPNCtJBOVo1F+/ZJkzFbLF507akLwuzqevIfIZciluiZosF0xHff+jJnhRTKhCaKc5sXYCy + TbqMUw6+sC7Lotxhx7mrCkFSR87zr6JHgxSReY9KJhmzL2bfURpnjmhGwzYRIDimotGAEw4F0jlA + FRjnjrT4jC66+F2yoQb3vUDEvATtIJMuATtjPNYn3pMCQs9dv/o8YWI/wEjaig4lIYu72zlB9L+C + o9QTqmGai/6BbolSdb4bS2wK5ShDET2AbM0xpmX7X6NuOeN5HYU2gutEMKA56ch0dvy76O5f4Sxf + E3H6emNzxiZO5fn4CKgy5QbYDZQSoVEFiUoMujnMUu44DNQwlntFdq47RcZ7UhhQd+TlROwxZ0rz + vVbC2APCfUGJU8N0QtlRpvk60UNkp4GyX4TnKrSc2fpPSmiSQx3MZQxV4NzQQ6jXz389f/MFAAD/ + /wMAE8xLs6wFAAA= + headers: + CF-Cache-Status: + - DYNAMIC + CF-RAY: + - 7be203e8793fcfa4-SJC + Cache-Control: + - no-cache, must-revalidate + Connection: + - keep-alive + Content-Encoding: + - gzip + Content-Type: + - application/json + Date: + - Wed, 26 Apr 2023 21:46:11 GMT + Server: + - cloudflare + access-control-allow-origin: + - '*' + alt-svc: + - h3=":443"; ma=86400, h3-29=":443"; ma=86400 + openai-model: + - gpt-3.5-turbo-0301 + openai-organization: + - user-adtx4fhfg1qsiyzdoaxciooj + openai-processing-ms: + - '19109' + openai-version: + - '2020-10-01' + strict-transport-security: + - max-age=15724800; includeSubDomains + x-ratelimit-limit-requests: + - '3500' + x-ratelimit-remaining-requests: + - '3499' + x-ratelimit-reset-requests: + - 17ms + x-request-id: + - 5fe22bc0f23ce6b48845f33187e1a19d + status: + code: 200 + message: OK +version: 1 diff --git a/tests/test_local_cache.py b/tests/integration/test_local_cache.py similarity index 99% rename from tests/test_local_cache.py rename to tests/integration/test_local_cache.py index 597f97145206..5200e026e708 100644 --- a/tests/test_local_cache.py +++ b/tests/integration/test_local_cache.py @@ -89,6 +89,7 @@ def test_get(LocalCache, config, mock_embed_with_ada): assert cache.get("test") == ["test"] +@pytest.mark.vcr @requires_api_key("OPENAI_API_KEY") def test_get_relevant(LocalCache, config) -> None: cache = LocalCache(config) diff --git a/tests/integration/test_setup.py b/tests/integration/test_setup.py new file mode 100644 index 000000000000..b649bb14f157 --- /dev/null +++ b/tests/integration/test_setup.py @@ -0,0 +1,78 @@ +from unittest.mock import patch + +import pytest + +from autogpt.config.ai_config import AIConfig +from autogpt.setup import ( + generate_aiconfig_automatic, + generate_aiconfig_manual, + prompt_user, +) +from tests.utils import requires_api_key + + +@pytest.mark.vcr +@requires_api_key("OPENAI_API_KEY") +def test_generate_aiconfig_automatic_default(): + user_inputs = [""] + with patch("builtins.input", side_effect=user_inputs): + ai_config = prompt_user() + + assert isinstance(ai_config, AIConfig) + assert ai_config.ai_name is not None + assert ai_config.ai_role is not None + assert 1 <= len(ai_config.ai_goals) <= 5 + + +@pytest.mark.vcr +@requires_api_key("OPENAI_API_KEY") +def test_generate_aiconfig_automatic_typical(): + user_prompt = "Help me create a rock opera about cybernetic giraffes" + ai_config = generate_aiconfig_automatic(user_prompt) + + assert isinstance(ai_config, AIConfig) + assert ai_config.ai_name is not None + assert ai_config.ai_role is not None + assert 1 <= len(ai_config.ai_goals) <= 5 + + +@pytest.mark.vcr +@requires_api_key("OPENAI_API_KEY") +def test_generate_aiconfig_automatic_fallback(): + user_inputs = [ + "T&GF£OIBECC()!*", + "Chef-GPT", + "an AI designed to browse bake a cake.", + "Purchase ingredients", + "Bake a cake", + "", + "", + ] + with patch("builtins.input", side_effect=user_inputs): + ai_config = prompt_user() + + assert isinstance(ai_config, AIConfig) + assert ai_config.ai_name == "Chef-GPT" + assert ai_config.ai_role == "an AI designed to browse bake a cake." + assert ai_config.ai_goals == ["Purchase ingredients", "Bake a cake"] + + +@pytest.mark.vcr +@requires_api_key("OPENAI_API_KEY") +def test_prompt_user_manual_mode(): + user_inputs = [ + "--manual", + "Chef-GPT", + "an AI designed to browse bake a cake.", + "Purchase ingredients", + "Bake a cake", + "", + "", + ] + with patch("builtins.input", side_effect=user_inputs): + ai_config = prompt_user() + + assert isinstance(ai_config, AIConfig) + assert ai_config.ai_name == "Chef-GPT" + assert ai_config.ai_role == "an AI designed to browse bake a cake." + assert ai_config.ai_goals == ["Purchase ingredients", "Bake a cake"] diff --git a/tests/test_image_gen.py b/tests/test_image_gen.py index c009296d08c6..546cc758d7e8 100644 --- a/tests/test_image_gen.py +++ b/tests/test_image_gen.py @@ -15,6 +15,9 @@ def image_size(request): return request.param +@pytest.mark.xfail( + reason="The image is too big to be put in a cassette for a CI pipeline. We're looking into a solution." +) @requires_api_key("OPENAI_API_KEY") def test_dalle(config, workspace, image_size): """Test DALL-E image generation.""" @@ -26,6 +29,9 @@ def test_dalle(config, workspace, image_size): ) +@pytest.mark.xfail( + reason="The image is too big to be put in a cassette for a CI pipeline. We're looking into a solution." +) @requires_api_key("HUGGINGFACE_API_TOKEN") @pytest.mark.parametrize( "image_model", diff --git a/tests/unit/test_commands.py b/tests/unit/test_commands.py index 8596e1c9bb06..e3b874fb9470 100644 --- a/tests/unit/test_commands.py +++ b/tests/unit/test_commands.py @@ -7,6 +7,7 @@ from tests.utils import requires_api_key +@pytest.mark.vcr @pytest.mark.integration_test @requires_api_key("OPENAI_API_KEY") def test_make_agent() -> None: diff --git a/tests/unit/test_setup.py b/tests/unit/test_setup.py deleted file mode 100644 index 9b907fcff536..000000000000 --- a/tests/unit/test_setup.py +++ /dev/null @@ -1,78 +0,0 @@ -import unittest -from io import StringIO -from unittest.mock import patch - -from autogpt.config.ai_config import AIConfig -from autogpt.setup import ( - generate_aiconfig_automatic, - generate_aiconfig_manual, - prompt_user, -) -from tests.utils import requires_api_key - - -class TestAutoGPT(unittest.TestCase): - @requires_api_key("OPENAI_API_KEY") - def test_generate_aiconfig_automatic_default(self): - user_inputs = [""] - with patch("builtins.input", side_effect=user_inputs): - ai_config = prompt_user() - - self.assertIsInstance(ai_config, AIConfig) - self.assertIsNotNone(ai_config.ai_name) - self.assertIsNotNone(ai_config.ai_role) - self.assertGreaterEqual(len(ai_config.ai_goals), 1) - self.assertLessEqual(len(ai_config.ai_goals), 5) - - @requires_api_key("OPENAI_API_KEY") - def test_generate_aiconfig_automatic_typical(self): - user_prompt = "Help me create a rock opera about cybernetic giraffes" - ai_config = generate_aiconfig_automatic(user_prompt) - - self.assertIsInstance(ai_config, AIConfig) - self.assertIsNotNone(ai_config.ai_name) - self.assertIsNotNone(ai_config.ai_role) - self.assertGreaterEqual(len(ai_config.ai_goals), 1) - self.assertLessEqual(len(ai_config.ai_goals), 5) - - @requires_api_key("OPENAI_API_KEY") - def test_generate_aiconfig_automatic_fallback(self): - user_inputs = [ - "T&GF£OIBECC()!*", - "Chef-GPT", - "an AI designed to browse bake a cake.", - "Purchase ingredients", - "Bake a cake", - "", - "", - ] - with patch("builtins.input", side_effect=user_inputs): - ai_config = prompt_user() - - self.assertIsInstance(ai_config, AIConfig) - self.assertEqual(ai_config.ai_name, "Chef-GPT") - self.assertEqual(ai_config.ai_role, "an AI designed to browse bake a cake.") - self.assertEqual(ai_config.ai_goals, ["Purchase ingredients", "Bake a cake"]) - - @requires_api_key("OPENAI_API_KEY") - def test_prompt_user_manual_mode(self): - user_inputs = [ - "--manual", - "Chef-GPT", - "an AI designed to browse bake a cake.", - "Purchase ingredients", - "Bake a cake", - "", - "", - ] - with patch("builtins.input", side_effect=user_inputs): - ai_config = prompt_user() - - self.assertIsInstance(ai_config, AIConfig) - self.assertEqual(ai_config.ai_name, "Chef-GPT") - self.assertEqual(ai_config.ai_role, "an AI designed to browse bake a cake.") - self.assertEqual(ai_config.ai_goals, ["Purchase ingredients", "Bake a cake"]) - - -if __name__ == "__main__": - unittest.main() diff --git a/tests/utils.py b/tests/utils.py index 8c72f1fac6fb..e0bc74603f33 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -1,17 +1,32 @@ import functools import os +from contextlib import contextmanager import pytest +from autogpt.config import Config + + +@contextmanager +def dummy_openai_api_key(): + # even when we record the VCR cassettes, openAI wants an API key + config = Config() + original_api_key = config.openai_api_key + config.set_openai_api_key("sk-dummy") + + try: + yield + finally: + config.set_openai_api_key(original_api_key) + def requires_api_key(env_var): def decorator(func): @functools.wraps(func) def wrapper(*args, **kwargs): - if not os.environ.get(env_var): - pytest.skip( - f"Environment variable '{env_var}' is not set, skipping the test." - ) + if not os.environ.get(env_var) and env_var == "OPENAI_API_KEY": + with dummy_openai_api_key(): + return func(*args, **kwargs) else: return func(*args, **kwargs)