Skip to content

Commit 914a873

Browse files
committed
Update workflow and get tests to pass.
1 parent 169cb5c commit 914a873

File tree

3 files changed

+10
-34
lines changed

3 files changed

+10
-34
lines changed

.github/workflows/main.yaml

Lines changed: 3 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99
- main
1010

1111
jobs:
12-
test-apiserver:
12+
test-pytest:
1313
runs-on: ubuntu-latest
1414

1515
strategy:
@@ -28,34 +28,9 @@ jobs:
2828
- name: Install dependencies
2929
run: |
3030
python -m pip install --upgrade pip
31-
pip install -r apiserver/requirements.txt
31+
pip install -r requirements.txt
3232
33-
- name: Run pytest in ./apiserver
34-
working-directory: ./apiserver
33+
- name: Run pytest
3534
run: |
3635
pytest
3736
38-
test-puppeteer:
39-
runs-on: ubuntu-latest
40-
needs: [] # Runs in parallel with test-apiserver
41-
42-
defaults:
43-
run:
44-
working-directory: ./computers/puppeteer
45-
46-
steps:
47-
- name: Check out repository
48-
uses: actions/checkout@v4
49-
50-
- name: Set up Node.js
51-
uses: actions/setup-node@v4
52-
with:
53-
node-version: '22.x'
54-
cache: 'npm'
55-
cache-dependency-path: computers/puppeteer/package-lock.json
56-
57-
- name: Install npm dependencies for Puppeteer
58-
run: npm ci
59-
60-
- name: Run npm tests for Puppeteer
61-
run: npm test

requirements.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ pydantic==2.11.4
44
playwright==1.52.0
55
browserbase==1.3.0
66
rich
7-
hud-python==0.2.10
7+
hud-python==0.2.10
8+
pytest

test_agent.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def setUp(self):
3131
self.agent._client = MagicMock()
3232

3333
def test_multiply_numbers(self):
34-
self.assertEqual(multiply_numbers(2, 3), {"result": 5})
34+
self.assertEqual(multiply_numbers(2, 3), {"result": 6})
3535

3636
def test_handle_action_open_web_browser(self):
3737
action = types.FunctionCall(name="open_web_browser", args={})
@@ -86,8 +86,8 @@ def test_run_one_iteration_no_function_calls(self, mock_get_model_response):
8686
self.assertEqual(self.agent._contents[1], mock_candidate.content)
8787

8888
@patch('agent.BrowserAgent.get_model_response')
89-
@patch('agent.BrowserAgent._execute_function_call')
90-
def test_run_one_iteration_with_function_call(self, mock_execute_function_call, mock_get_model_response):
89+
@patch('agent.BrowserAgent.handle_action')
90+
def test_run_one_iteration_with_function_call(self, mock_handle_action, mock_get_model_response):
9191
mock_response = MagicMock()
9292
mock_candidate = MagicMock()
9393
function_call = types.FunctionCall(name="navigate", args={"url": "https://example.com"})
@@ -96,12 +96,12 @@ def test_run_one_iteration_with_function_call(self, mock_execute_function_call,
9696
mock_get_model_response.return_value = mock_response
9797

9898
mock_env_state = EnvState(screenshot=b"screenshot", url="https://example.com")
99-
mock_execute_function_call.return_value = mock_env_state
99+
mock_handle_action.return_value = mock_env_state
100100

101101
result = self.agent.run_one_iteration()
102102

103103
self.assertEqual(result, "CONTINUE")
104-
mock_execute_function_call.assert_called_once_with(function_call)
104+
mock_handle_action.assert_called_once_with(function_call)
105105
self.assertEqual(len(self.agent._contents), 3)
106106

107107

0 commit comments

Comments
 (0)