AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.
Quicker logs in pytest (#4486)
merwanehamadi3081f56ecb15
diff --git a/.github/workflows/benchmarks.yml b/.github/workflows/benchmarks.ymldeleted file mode 100644index 272fca17bd..0000000000--- a/.github/workflows/benchmarks.yml+++ /dev/null@@ -1,31 +0,0 @@-name: Run Benchmarks--on:- workflow_dispatch:--jobs:- build:- runs-on: ubuntu-latest-- env:- python-version: '3.10'-- steps:- - name: Checkout repository- uses: actions/checkout@v3-- - name: Set up Python ${{ env.python-version }}- uses: actions/setup-python@v4- with:- python-version: ${{ env.python-version }}-- - name: Install dependencies- run: |- python -m pip install --upgrade pip- pip install -r requirements.txt-- - name: benchmark- env:- OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}- run: |- python benchmark/benchmark_entrepreneur_gpt_with_undecisive_user.pydiff --git a/.github/workflows/ci.yml b/.github/workflows/ci.ymlindex cf851ef380..8e3d548449 100644--- a/.github/workflows/ci.yml+++ b/.github/workflows/ci.yml@@ -156,6 +156,7 @@ jobs:PROXY: ${{ secrets.PROXY }}AGENT_MODE: ${{ secrets.AGENT_MODE }}AGENT_TYPE: ${{ secrets.AGENT_TYPE }}+ PLAIN_OUTPUT: True- name: Upload coverage reports to Codecovuses: codecov/codecov-action@v3diff --git a/.github/workflows/docker-ci.yml b/.github/workflows/docker-ci.ymlindex ff43666c44..cacb58c566 100644--- a/.github/workflows/docker-ci.yml+++ b/.github/workflows/docker-ci.yml@@ -102,6 +102,7 @@ jobs:- id: testname: Run testsenv:+ PLAIN_OUTPUT: TrueCI: trueOPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}run: |diff --git a/tests/conftest.py b/tests/conftest.pyindex 0ee023b58d..8e607c393c 100644--- a/tests/conftest.py+++ b/tests/conftest.py@@ -1,3 +1,4 @@+import osfrom pathlib import Pathimport pytest@@ -5,6 +6,7 @@ from pytest_mock import MockerFixturefrom autogpt.config.config import Configfrom autogpt.llm.api_manager import ApiManager+from autogpt.logs import TypingConsoleHandlerfrom autogpt.workspace import Workspacepytest_plugins = [@@ -43,3 +45,15 @@ def api_manager() -> ApiManager:if ApiManager in ApiManager._instances:del ApiManager._instances[ApiManager]return ApiManager()++[email protected](autouse=True)+def patch_emit(monkeypatch):+ # convert plain_output to a boolean++ if bool(os.environ.get("PLAIN_OUTPUT")):++ def quick_emit(self, record: str):+ print(self.format(record))++ monkeypatch.setattr(TypingConsoleHandler, "emit", quick_emit)