From 27e7a53f844c8ab02969b25dd306790f0de679ca Mon Sep 17 00:00:00 2001 From: Alex Waygood Date: Thu, 14 Aug 2025 00:02:50 +0100 Subject: [PATCH 1/2] [ty] Remove py-fuzzer skips for seeds that are no longer slow --- python/py-fuzzer/fuzz.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/python/py-fuzzer/fuzz.py b/python/py-fuzzer/fuzz.py index 1c49702c989dd..895e74dad8996 100644 --- a/python/py-fuzzer/fuzz.py +++ b/python/py-fuzzer/fuzz.py @@ -152,16 +152,13 @@ def print_description(self, index: int, num_seeds: int) -> None: def fuzz_code(seed: Seed, args: ResolvedCliArgs) -> FuzzResult: """Return a `FuzzResult` instance describing the fuzzing result from this seed.""" - # TODO(carljm) remove once we debug the slowness of these seeds - skip_check = seed in {120, 160, 314, 335} - code = generate_random_code(seed) bug_found = False minimizer_callback: Callable[[str], bool] | None = None if args.baseline_executable_path is None: only_new_bugs = False - if not skip_check and contains_bug( + if contains_bug( code, executable=args.executable, executable_path=args.test_executable_path ): bug_found = True @@ -172,7 +169,7 @@ def fuzz_code(seed: Seed, args: ResolvedCliArgs) -> FuzzResult: ) else: only_new_bugs = True - if not skip_check and contains_new_bug( + if contains_new_bug( code, executable=args.executable, test_executable_path=args.test_executable_path, From 74fc85baf084b01545a9b7ce28f6df33abc5c089 Mon Sep 17 00:00:00 2001 From: Alex Waygood Date: Thu, 14 Aug 2025 00:13:23 +0100 Subject: [PATCH 2/2] run py-fuzzer jobs on changes that affect py-fuzzer --- .github/workflows/ci.yaml | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index e6ed6f74cfa09..aa6e5646b1852 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -38,7 +38,8 @@ jobs: fuzz: ${{ steps.check_fuzzer.outputs.changed }} # Flag that is set to "true" when code related to ty changes. ty: ${{ steps.check_ty.outputs.changed }} - + # Flag that is set to "true" when code related to the py-fuzzer folder changes. + py-fuzzer: ${{ steps.check_py_fuzzer.outputs.changed }} # Flag that is set to "true" when code related to the playground changes. playground: ${{ steps.check_playground.outputs.changed }} steps: @@ -68,7 +69,6 @@ jobs: ':crates/ruff_text_size/**' \ ':crates/ruff_python_ast/**' \ ':crates/ruff_python_parser/**' \ - ':python/py-fuzzer/**' \ ':.github/workflows/ci.yaml' \ ; then echo "changed=false" >> "$GITHUB_OUTPUT" @@ -138,6 +138,18 @@ jobs: echo "changed=true" >> "$GITHUB_OUTPUT" fi + - name: Check if the py-fuzzer code changed + id: check_py_fuzzer + env: + MERGE_BASE: ${{ steps.merge_base.outputs.sha }} + run: | + if git diff --quiet "${MERGE_BASE}...HEAD" -- 'python/py_fuzzer/**' \ + ; then + echo "changed=false" >> "$GITHUB_OUTPUT" + else + echo "changed=true" >> "$GITHUB_OUTPUT" + fi + - name: Check if there was any code related change id: check_code env: @@ -443,7 +455,7 @@ jobs: needs: - cargo-test-linux - determine_changes - if: ${{ !contains(github.event.pull_request.labels.*.name, 'no-test') && needs.determine_changes.outputs.parser == 'true' }} + if: ${{ !contains(github.event.pull_request.labels.*.name, 'no-test') && (needs.determine_changes.outputs.parser == 'true' || needs.determine_changes.outputs.py-fuzzer == 'true') }} timeout-minutes: 20 env: FORCE_COLOR: 1 @@ -633,7 +645,7 @@ jobs: - cargo-test-linux - determine_changes # Only runs on pull requests, since that is the only we way we can find the base version for comparison. - if: ${{ !contains(github.event.pull_request.labels.*.name, 'no-test') && github.event_name == 'pull_request' && needs.determine_changes.outputs.ty == 'true' }} + if: ${{ !contains(github.event.pull_request.labels.*.name, 'no-test') && github.event_name == 'pull_request' && (needs.determine_changes.outputs.ty == 'true' || needs.determine_changes.outputs.py-fuzzer == 'true') }} timeout-minutes: 20 steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2