diff --git a/.github/workflows/_check_code.yaml b/.github/workflows/_check_code.yaml index bb6b24e508..be9db96778 100644 --- a/.github/workflows/_check_code.yaml +++ b/.github/workflows/_check_code.yaml @@ -30,10 +30,10 @@ jobs: name: Lint check uses: apify/workflows/.github/workflows/python_lint_check.yaml@main with: - python-versions: '["3.10", "3.11", "3.12", "3.13", "3.14"]' + python_versions: '["3.10", "3.11", "3.12", "3.13", "3.14"]' type_check: name: Type check uses: apify/workflows/.github/workflows/python_type_check.yaml@main with: - python-versions: '["3.10", "3.11", "3.12", "3.13", "3.14"]' + python_versions: '["3.10", "3.11", "3.12", "3.13", "3.14"]' diff --git a/.github/workflows/_tests.yaml b/.github/workflows/_tests.yaml index 3165a30c0d..2582500647 100644 --- a/.github/workflows/_tests.yaml +++ b/.github/workflows/_tests.yaml @@ -11,11 +11,10 @@ jobs: unit_tests: name: Unit tests uses: apify/workflows/.github/workflows/python_unit_tests.yaml@main - secrets: - httpbin_url: ${{ secrets.APIFY_HTTPBIN_TOKEN && format('https://httpbin.apify.actor?token={0}', secrets.APIFY_HTTPBIN_TOKEN) || 'https://httpbin.org' }} - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + secrets: inherit with: - python-versions: '["3.10", "3.11", "3.12", "3.13", "3.14"]' - operating-systems: '["ubuntu-latest", "windows-latest", "macos-latest"]' - python-version-for-codecov: "3.14" - operating-system-for-codecov: ubuntu-latest + python_versions: '["3.10", "3.11", "3.12", "3.13", "3.14"]' + operating_systems: '["ubuntu-latest", "windows-latest", "macos-latest"]' + python_version_for_codecov: "3.14" + operating_system_for_codecov: ubuntu-latest + tests_concurrency: "2" diff --git a/.github/workflows/on_schedule_tests.yaml b/.github/workflows/on_schedule_tests.yaml index fa50bdc468..de9fcdc733 100644 --- a/.github/workflows/on_schedule_tests.yaml +++ b/.github/workflows/on_schedule_tests.yaml @@ -15,6 +15,7 @@ concurrency: env: NODE_VERSION: 22 PYTHON_VERSION: 3.14 + TESTS_CONCURRENCY: 1 jobs: end_to_end_tests: diff --git a/pyproject.toml b/pyproject.toml index f228294f24..e3c2322781 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -217,10 +217,10 @@ builtins-ignorelist = ["id"] known-first-party = ["crawlee"] [tool.pytest.ini_options] -addopts = "-ra" +addopts = "-r a --verbose" asyncio_default_fixture_loop_scope = "function" asyncio_mode = "auto" -timeout = 300 +timeout = 1800 markers = [ "run_alone: marks tests that must run in isolation", ] @@ -277,18 +277,39 @@ shell = "uv run ruff check --fix && uv run ruff format" [tool.poe.tasks.unit-tests] shell = """ -uv run pytest --numprocesses=1 --verbose -m "run_alone" tests/unit && \ -uv run pytest --numprocesses=auto --verbose -m "not run_alone" tests/unit +uv run pytest \ + --numprocesses=1 \ + -m "run_alone" \ + tests/unit && \ +uv run pytest \ + --numprocesses=${TESTS_CONCURRENCY:-auto} \ + -m "not run_alone" \ + tests/unit """ [tool.poe.tasks.unit-tests-cov] shell = """ -uv run pytest --numprocesses=1 --verbose -m "run_alone" --cov=src/crawlee --cov-report=xml:coverage-unit.xml tests/unit && \ -uv run pytest --numprocesses=auto --verbose -m "not run_alone" --cov=src/crawlee --cov-report=xml:coverage-unit.xml --cov-append tests/unit +uv run pytest \ + --numprocesses=1 \ + -m "run_alone" \ + --cov=src/crawlee \ + --cov-report=xml:coverage-unit.xml \ + tests/unit && \ +uv run pytest \ + --numprocesses=${TESTS_CONCURRENCY:-auto} \ + -m "not run_alone" \ + --cov=src/crawlee \ + --cov-report=xml:coverage-unit.xml \ + --cov-append \ + tests/unit """ [tool.poe.tasks.e2e-templates-tests] -cmd = "uv run pytest --numprocesses=${E2E_TESTS_CONCURRENCY:-1} --verbose tests/e2e/project_template --timeout=600" +cmd = """ +uv run pytest \ + --numprocesses=${TESTS_CONCURRENCY:-auto} \ + tests/e2e/project_template +""" [tool.poe.tasks.build-docs] shell = "./build_api_reference.sh && corepack enable && yarn && yarn build"