From 22e35fab5505b4652c1d89ffcadd650fae9db2ad Mon Sep 17 00:00:00 2001 From: Merwane Hamadi Date: Wed, 31 May 2023 10:36:26 -0700 Subject: [PATCH 01/11] Cache Python Packages in CI --- .github/workflows/ci.yml | 23 +++++++++++++++++-- .../integration/challenges/current_score.json | 6 +---- .../test_information_retrieval_challenge_b.py | 3 +++ 3 files changed, 25 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5219b9826bd..b01b68a146a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -32,6 +32,16 @@ jobs: with: python-version: ${{ env.min-python-version }} + - name: Set Date + run: echo "DATE=$(date +'%Y-%m-%d')" >> $GITHUB_ENV + shell: bash + + - name: Cache Python packages + uses: actions/cache@v3 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}-${{ env.DATE }} + - name: Install dependencies run: | python -m pip install --upgrade pip @@ -112,6 +122,16 @@ jobs: with: python-version: ${{ matrix.python-version }} + - name: Set Date + run: echo "DATE=$(date +'%Y-%m-%d')" >> $GITHUB_ENV + shell: bash + + - name: Cache Python packages + uses: actions/cache@v3 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}-${{ env.DATE }} + - name: Install dependencies run: | python -m pip install --upgrade pip @@ -138,7 +158,7 @@ jobs: git config --global user.email "github-bot@agpt.co" git add tests/integration/challenges/current_score.json - if ! git diff-index --quiet HEAD; then + if ! git diff --quiet -- tests/integration/challenges/current_score.json; then git commit -m "Update current score" git push origin HEAD:refs/heads/$current_branch else @@ -162,7 +182,6 @@ jobs: git push origin HEAD:refs/heads/$current_branch else echo "No cassettes changes to commit" - exit 0 fi - name: Update cassette submodule to submodule branch if PR event diff --git a/tests/integration/challenges/current_score.json b/tests/integration/challenges/current_score.json index 726613991d4..778c05c26e9 100644 --- a/tests/integration/challenges/current_score.json +++ b/tests/integration/challenges/current_score.json @@ -19,10 +19,6 @@ "information_retrieval_challenge_a": { "max_level": 3, "max_level_beaten": 1 - }, - "information_retrieval_challenge_b": { - "max_level": 1, - "max_level_beaten": 1 } }, "kubernetes": { @@ -45,4 +41,4 @@ "max_level_beaten": 1 } } -} \ No newline at end of file +} diff --git a/tests/integration/challenges/information_retrieval/test_information_retrieval_challenge_b.py b/tests/integration/challenges/information_retrieval/test_information_retrieval_challenge_b.py index feac95a0f64..ffc08a2aa87 100644 --- a/tests/integration/challenges/information_retrieval/test_information_retrieval_challenge_b.py +++ b/tests/integration/challenges/information_retrieval/test_information_retrieval_challenge_b.py @@ -14,6 +14,9 @@ CYCLE_COUNT = 3 +@pytest.mark.skip( + "This test uses the browse website functionality, which VCR doesn't support yet, this means it's slower, costs money and is less reliable. It will be unskipped once VCR support browse_website" +) @pytest.mark.vcr @requires_api_key("OPENAI_API_KEY") @challenge From d55071dfea2b9fa68c226b2b9d711bdc51f8d91a Mon Sep 17 00:00:00 2001 From: merwanehamadi Date: Fri, 2 Jun 2023 13:35:23 -0700 Subject: [PATCH 02/11] remove pytest skip --- .../test_information_retrieval_challenge_b.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/tests/integration/challenges/information_retrieval/test_information_retrieval_challenge_b.py b/tests/integration/challenges/information_retrieval/test_information_retrieval_challenge_b.py index ffc08a2aa87..feac95a0f64 100644 --- a/tests/integration/challenges/information_retrieval/test_information_retrieval_challenge_b.py +++ b/tests/integration/challenges/information_retrieval/test_information_retrieval_challenge_b.py @@ -14,9 +14,6 @@ CYCLE_COUNT = 3 -@pytest.mark.skip( - "This test uses the browse website functionality, which VCR doesn't support yet, this means it's slower, costs money and is less reliable. It will be unskipped once VCR support browse_website" -) @pytest.mark.vcr @requires_api_key("OPENAI_API_KEY") @challenge From 863b1b0f7abd74b4619e0a29e6109c36a9b51387 Mon Sep 17 00:00:00 2001 From: merwanehamadi Date: Fri, 2 Jun 2023 13:36:10 -0700 Subject: [PATCH 03/11] remove run bash --- .github/workflows/ci.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b01b68a146a..b8eda74bfad 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -34,7 +34,6 @@ jobs: - name: Set Date run: echo "DATE=$(date +'%Y-%m-%d')" >> $GITHUB_ENV - shell: bash - name: Cache Python packages uses: actions/cache@v3 @@ -124,7 +123,6 @@ jobs: - name: Set Date run: echo "DATE=$(date +'%Y-%m-%d')" >> $GITHUB_ENV - shell: bash - name: Cache Python packages uses: actions/cache@v3 From dc1ec986fa2a0110013cd9c2baf4cea3d2c304d3 Mon Sep 17 00:00:00 2001 From: merwanehamadi Date: Sat, 3 Jun 2023 06:24:47 -0700 Subject: [PATCH 04/11] put a line to previous step to simplify conflict resolution --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b8eda74bfad..4d7714bcc5d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -156,8 +156,8 @@ jobs: git config --global user.email "github-bot@agpt.co" git add tests/integration/challenges/current_score.json - if ! git diff --quiet -- tests/integration/challenges/current_score.json; then - git commit -m "Update current score" + if ! git diff-index --quiet HEAD; then + git commit -m "Update current score" git push origin HEAD:refs/heads/$current_branch else echo "The current score didn't change." From e0a48ff721f2a83cbcf35e363172554e2e0f7172 Mon Sep 17 00:00:00 2001 From: merwanehamadi Date: Sat, 3 Jun 2023 06:25:15 -0700 Subject: [PATCH 05/11] fix indentation --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4d7714bcc5d..356787b415c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -157,7 +157,7 @@ jobs: git add tests/integration/challenges/current_score.json if ! git diff-index --quiet HEAD; then - git commit -m "Update current score" + git commit -m "Update current score" git push origin HEAD:refs/heads/$current_branch else echo "The current score didn't change." From 319581bd8dc3e1ec687e7c543c23d333fb361db9 Mon Sep 17 00:00:00 2001 From: merwanehamadi Date: Sat, 3 Jun 2023 06:26:01 -0700 Subject: [PATCH 06/11] put back exit 0 to simplify conflict resolution --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 356787b415c..7d2545f7e15 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -161,6 +161,7 @@ jobs: git push origin HEAD:refs/heads/$current_branch else echo "The current score didn't change." + exit 0 fi cd tests/Auto-GPT-test-cassettes From d828e04e52b08423cf73ca1c90892f56d767ea76 Mon Sep 17 00:00:00 2001 From: merwanehamadi Date: Sat, 3 Jun 2023 06:26:46 -0700 Subject: [PATCH 07/11] put back exit 0 to simplify conflict resolution --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7d2545f7e15..8651931c0d2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -161,7 +161,6 @@ jobs: git push origin HEAD:refs/heads/$current_branch else echo "The current score didn't change." - exit 0 fi cd tests/Auto-GPT-test-cassettes @@ -181,6 +180,7 @@ jobs: git push origin HEAD:refs/heads/$current_branch else echo "No cassettes changes to commit" + exit 0 fi - name: Update cassette submodule to submodule branch if PR event From 0d42fb8a3fcb6b096f5608224145e28fd6c903aa Mon Sep 17 00:00:00 2001 From: merwanehamadi Date: Sat, 3 Jun 2023 06:27:13 -0700 Subject: [PATCH 08/11] remove new line From fe8ff8f9a4af0a773e00c0432b00999ed2e74898 Mon Sep 17 00:00:00 2001 From: merwanehamadi Date: Sat, 3 Jun 2023 06:28:11 -0700 Subject: [PATCH 09/11] remove new line From 82e8602ff36c2c36d1391d2c41e56b62dc09587e Mon Sep 17 00:00:00 2001 From: merwanehamadi Date: Sat, 3 Jun 2023 06:32:15 -0700 Subject: [PATCH 10/11] Put back information retrieval challenge --- tests/integration/challenges/current_score.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/integration/challenges/current_score.json b/tests/integration/challenges/current_score.json index 778c05c26e9..8412e908119 100644 --- a/tests/integration/challenges/current_score.json +++ b/tests/integration/challenges/current_score.json @@ -19,6 +19,10 @@ "information_retrieval_challenge_a": { "max_level": 3, "max_level_beaten": 1 + }, + "information_retrieval_challenge_b": { + "max_level": 1, + "max_level_beaten": 1 } }, "kubernetes": { From 253130dea42fc63074c1eabb394ae607a2beab34 Mon Sep 17 00:00:00 2001 From: merwanehamadi Date: Sat, 3 Jun 2023 06:32:50 -0700 Subject: [PATCH 11/11] attempt to remove line