From d561db8f4b93287cbd131ec3f34ed626b2e07877 Mon Sep 17 00:00:00 2001 From: SRI VILLIAM SAI Date: Sat, 21 Nov 2026 18:22:33 +0530 Subject: [PATCH 1/2] test(ci): assert test-scripts runs directory Assert that test-scripts in test-parser.yml runs the whole .github/scripts/tests directory rather than a fixed list of files. --- .../scripts/tests/test_test_parser_workflow.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 .github/scripts/tests/test_test_parser_workflow.py 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" From 54b247e129aac902dad550bf8c03005e9beca527 Mon Sep 17 00:00:00 2001 From: SRI VILLIAM SAI Date: Sat, 21 Nov 2026 18:24:36 +0530 Subject: [PATCH 2/2] ci: run all script tests and allow uppercase (#977) Run the whole .github/scripts/tests directory in test-scripts instead of a fixed file list, ensuring new test files run in CI automatically. Update test_subject_uppercase in test_lintcommit.py to expect no error, matching the behavior since uppercase subjects were allowed in #382. --- .github/scripts/tests/test_lintcommit.py | 2 +- .github/workflows/test-parser.yml | 13 +------------ 2 files changed, 2 insertions(+), 13 deletions(-) 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/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