Skip to content

Open-source Python library for AI browser agents, plus Browser Use Cloud: stealth browsers and a hosted agent API.

ci: split tests into parallel browser & model jobs

dha-aa09d12c8ddf6b
diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml
index abdf90246..78a9bab43 100644
--- a/.github/workflows/test.yaml
+++ b/.github/workflows/test.yaml
@@ -6,18 +6,38 @@ on:
jobs:
test:
+ name: ${{ matrix.test }}
runs-on: ubuntu-latest
+ strategy:
+ matrix:
+ test: [tests/browser, tests/models, tests/functionality, tests/all]
+
+
steps:
- uses: actions/checkout@v4
- - uses: astral-sh/setup-uv@v5
- # TODO: Fix the ignored pytests.
- # openai.OpenAIError: The api_key client option must be set either by passing
- # api_key to the client or by setting the OPENAI_API_KEY environment variable
- - run: uv run --with=dotenv pytest
- --ignore=tests/test_dropdown_error.py
- --ignore=tests/test_gif_path.py
- --ignore=tests/test_models.py
- --ignore=tests/test_react_dropdown.py
- --ignore=tests/test_save_conversation.py
- --ignore=tests/test_vision.py
- --ignore=tests/test_wait_for_element.py || true
+ - name: Setup uv and cache packages
+ uses: astral-sh/setup-uv@v5
+ - name: Run lint task
+ run: |
+ case "${{ matrix.test }}" in
+ tests/browser) uv run --with=dotenv pytest tests/test_browser.py || true ;;
+ tests/models) uv run --with=dotenv pytest tests/test_models.py || true ;;
+ tests/functionality) uv run --with=dotenv pytest test_core_functionality.py || true ;;
+ tests/all) uv run --with=dotenv pytest || true ;;
+ esac
+
+
+# TODO: Fix the ignored pytests.
+# openai.OpenAIError: The api_key client option must be set either by passing
+# api_key to the client or by setting the OPENAI_API_KEY environment variable
+ # uv run --with=dotenv pytest
+ # --ignore=tests/test_dropdown_error.py
+ # --ignore=tests/test_gif_path.py
+ # --ignore=tests/test_models.py
+ # --ignore=tests/test_react_dropdown.py
+ # --ignore=tests/test_save_conversation.py
+ # --ignore=tests/test_vision.py
+ # --ignore=tests/test_wait_for_element.py || true ;;
+
+
+