From bd1d0c05a7e399fe6f774403370430871eb93f87 Mon Sep 17 00:00:00 2001 From: Merwane Hamadi Date: Tue, 30 May 2023 19:49:12 -0700 Subject: [PATCH 1/6] test ci --- .github/workflows/ci.yml | 37 +++++++++++++++++-- .../integration/challenges/current_score.json | 2 +- 2 files changed, 34 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5219b9826bd6..49a2bb7f28be 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -119,7 +119,7 @@ jobs: - name: Run pytest tests with coverage run: | - pytest -n auto --cov=autogpt --cov-report term-missing --cov-branch --cov-report xml --cov-report term + pytest tests/integration/challenges/basic_abilities/test_write_file.py python tests/integration/challenges/utils/build_current_score.py env: CI: true @@ -127,9 +127,6 @@ jobs: AGENT_MODE: ${{ vars.AGENT_MODE }} AGENT_TYPE: ${{ vars.AGENT_TYPE }} - - name: Upload coverage reports to Codecov - uses: codecov/codecov-action@v3 - - name: Update cassette submodule to push target if push event if: ${{ github.event_name == 'push' }} run: | @@ -165,6 +162,9 @@ jobs: exit 0 fi + + + - name: Update cassette submodule to submodule branch if PR event if: ${{ github.event_name == 'pull_request_target' }} run: | @@ -193,6 +193,35 @@ jobs: echo "DIFF_EXISTS=false" >> $GITHUB_ENV fi + - name: Run pytest tests with coverage + if: ${{ env.DIFF_EXISTS == 'true' }} + run: | + pytest -n auto tests/integration/challenges --beat-challenges --cov=autogpt --cov-report term-missing --cov-branch --cov-report xml --cov-report term + python tests/integration/challenges/utils/build_current_score.py + + - name: Upload coverage reports to Codecov + uses: codecov/codecov-action@v3 + + - name: Beat challenges - Update cassette submodule to submodule branch if PR event + if: ${{ env.DIFF_EXISTS == 'true' }} + run: | + new_branch="${{ github.event.pull_request.user.login }}-${{ github.event.pull_request.head.ref }}" + + cd tests/Auto-GPT-test-cassettes + git config --global user.name "Auto-GPT-Bot" + git config --global user.email "github-bot@agpt.co" + git add . + + # Check if there are any changes + if ! git diff-index --quiet HEAD; then + git commit -m "Auto-update cassettes after merging PR #$pr_number (Beat challenges)" + git push -f origin HEAD:refs/heads/$new_branch + + else + echo "No changes to commit" + exit 0 + fi + - name: Apply or remove behaviour change label and comment if: ${{ github.event_name == 'pull_request_target' }} run: | diff --git a/tests/integration/challenges/current_score.json b/tests/integration/challenges/current_score.json index 726613991d48..a8c2a2d133a0 100644 --- a/tests/integration/challenges/current_score.json +++ b/tests/integration/challenges/current_score.json @@ -42,7 +42,7 @@ }, "memory_challenge_c": { "max_level": 5, - "max_level_beaten": 1 + "max_level_beaten": null } } } \ No newline at end of file From e9a672d008774e9f219d65c6f8830d92679b0b0c Mon Sep 17 00:00:00 2001 From: Auto-GPT-Bot Date: Wed, 31 May 2023 02:51:07 +0000 Subject: [PATCH 2/6] Update current score --- .../integration/challenges/current_score.json | 40 ------------------- 1 file changed, 40 deletions(-) diff --git a/tests/integration/challenges/current_score.json b/tests/integration/challenges/current_score.json index a8c2a2d133a0..ab2ea4123e06 100644 --- a/tests/integration/challenges/current_score.json +++ b/tests/integration/challenges/current_score.json @@ -1,48 +1,8 @@ { "basic_abilities": { - "browse_website": { - "max_level": 1, - "max_level_beaten": 1 - }, "write_file": { "max_level": 1, "max_level_beaten": 1 } - }, - "debug_code": { - "debug_code_challenge_a": { - "max_level": 1, - "max_level_beaten": 1 - } - }, - "information_retrieval": { - "information_retrieval_challenge_a": { - "max_level": 3, - "max_level_beaten": 1 - }, - "information_retrieval_challenge_b": { - "max_level": 1, - "max_level_beaten": 1 - } - }, - "kubernetes": { - "kubernetes_template_challenge_a": { - "max_level": 1, - "max_level_beaten": null - } - }, - "memory": { - "memory_challenge_a": { - "max_level": 3, - "max_level_beaten": 3 - }, - "memory_challenge_b": { - "max_level": 5, - "max_level_beaten": null - }, - "memory_challenge_c": { - "max_level": 5, - "max_level_beaten": null - } } } \ No newline at end of file From 2a6ba9dcae879d9dd38b7aec9a377870eed430df Mon Sep 17 00:00:00 2001 From: Merwane Hamadi Date: Tue, 30 May 2023 19:52:33 -0700 Subject: [PATCH 3/6] test ci --- tests/integration/agent_factory.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/integration/agent_factory.py b/tests/integration/agent_factory.py index 30d9cc13b2aa..4b5756ef3e0b 100644 --- a/tests/integration/agent_factory.py +++ b/tests/integration/agent_factory.py @@ -81,7 +81,7 @@ def writer_agent(agent_test_config, memory_none: NoMemory, workspace: Workspace) ai_role="an AI designed to use the write_to_file command to write 'Hello World' into a file named \"hello_world.txt\" and then use the task_complete command to complete the task.", ai_goals=[ "Use the write_to_file command to write 'Hello World' into a file named \"hello_world.txt\".", - "Use the task_complete command to complete the task.", + "Use the task_complete command to complete the task!!!", "Do not use any other commands.", ], ) From 4c6d4d81175c08d953c5b210a36880e647a0e636 Mon Sep 17 00:00:00 2001 From: Merwane Hamadi Date: Tue, 30 May 2023 20:02:52 -0700 Subject: [PATCH 4/6] test ci --- .github/workflows/ci.yml | 5 +++++ tests/integration/agent_factory.py | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 49a2bb7f28be..03923da53c4b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -198,6 +198,11 @@ jobs: run: | pytest -n auto tests/integration/challenges --beat-challenges --cov=autogpt --cov-report term-missing --cov-branch --cov-report xml --cov-report term python tests/integration/challenges/utils/build_current_score.py + env: + CI: true + PROXY: ${{ secrets.PROXY }} + AGENT_MODE: ${{ vars.AGENT_MODE }} + AGENT_TYPE: ${{ vars.AGENT_TYPE }} - name: Upload coverage reports to Codecov uses: codecov/codecov-action@v3 diff --git a/tests/integration/agent_factory.py b/tests/integration/agent_factory.py index 4b5756ef3e0b..6370bdf6da35 100644 --- a/tests/integration/agent_factory.py +++ b/tests/integration/agent_factory.py @@ -81,7 +81,7 @@ def writer_agent(agent_test_config, memory_none: NoMemory, workspace: Workspace) ai_role="an AI designed to use the write_to_file command to write 'Hello World' into a file named \"hello_world.txt\" and then use the task_complete command to complete the task.", ai_goals=[ "Use the write_to_file command to write 'Hello World' into a file named \"hello_world.txt\".", - "Use the task_complete command to complete the task!!!", + "Use the task_complete command to complete the task!!!!", "Do not use any other commands.", ], ) From a099dcc652c27e6e78fd51c9cd84547893bafec2 Mon Sep 17 00:00:00 2001 From: Merwane Hamadi Date: Tue, 30 May 2023 20:08:37 -0700 Subject: [PATCH 5/6] test ci From 31f196e51f8748a9aaa52dd31902a47f39a8c0bc Mon Sep 17 00:00:00 2001 From: Merwane Hamadi Date: Tue, 30 May 2023 20:08:42 -0700 Subject: [PATCH 6/6] test ci --- tests/integration/agent_factory.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/integration/agent_factory.py b/tests/integration/agent_factory.py index 6370bdf6da35..f57162705d84 100644 --- a/tests/integration/agent_factory.py +++ b/tests/integration/agent_factory.py @@ -81,7 +81,7 @@ def writer_agent(agent_test_config, memory_none: NoMemory, workspace: Workspace) ai_role="an AI designed to use the write_to_file command to write 'Hello World' into a file named \"hello_world.txt\" and then use the task_complete command to complete the task.", ai_goals=[ "Use the write_to_file command to write 'Hello World' into a file named \"hello_world.txt\".", - "Use the task_complete command to complete the task!!!!", + "Use the task_complete command to complete the task!!!!!", "Do not use any other commands.", ], )