diff --git a/.github/scripts/tests/test_lintcommit.py b/.github/scripts/tests/test_lintcommit.py index 6abed47d0..17f681960 100644 --- a/.github/scripts/tests/test_lintcommit.py +++ b/.github/scripts/tests/test_lintcommit.py @@ -110,7 +110,7 @@ def test_scope_uppercase() -> None: def test_subject_uppercase() -> None: - assert validate_subject("feat: Add new feature") == "subject must be lowercase" + assert validate_subject("feat: Add new feature") is None # region validate_message diff --git a/.github/scripts/tests/test_test_parser_workflow.py b/.github/scripts/tests/test_test_parser_workflow.py new file mode 100644 index 000000000..4ef07ab77 --- /dev/null +++ b/.github/scripts/tests/test_test_parser_workflow.py @@ -0,0 +1,18 @@ +from pathlib import Path +from typing import Any + +import pytest +import yaml + +WORKFLOW_PATH = Path(__file__).parents[2] / "workflows" / "test-parser.yml" + + +@pytest.fixture(name="workflow") +def workflow_fixture() -> dict[Any, Any]: + return yaml.safe_load(WORKFLOW_PATH.read_text()) + + +def test_test_scripts_runs_all_tests_in_directory(workflow: dict[Any, Any]) -> None: + steps = workflow["jobs"]["test-scripts"]["steps"] + run_step = next(step for step in steps if step.get("name") == "Run script tests") + assert run_step["run"].strip() == "python -m pytest .github/scripts/tests" diff --git a/.github/workflows/test-parser.yml b/.github/workflows/test-parser.yml index dce3ee15a..826c004a8 100644 --- a/.github/workflows/test-parser.yml +++ b/.github/workflows/test-parser.yml @@ -71,15 +71,4 @@ jobs: run: uv pip install packaging pytest PyYAML==6.0.2 - name: Run script tests - run: | - python -m pytest \ - .github/scripts/tests/test_ai_pr_review_workflow.py \ - .github/scripts/tests/test_check_otel_wheel_dependencies.py \ - .github/scripts/tests/test_current_latest_version.py \ - .github/scripts/tests/test_js_examples.py \ - .github/scripts/tests/test_opentelemetry_conformance_workflow.py \ - .github/scripts/tests/test_parse_sdk_branch.py \ - .github/scripts/tests/test_parse_testing_version.py \ - .github/scripts/tests/test_release_workflow_dependencies.py \ - .github/scripts/tests/e2e/test_ecr_release_workflow.py \ - .github/scripts/tests/test_shared_workflow_runners.py + run: python -m pytest .github/scripts/tests