Skip to content

Commit d324ced

Browse files
authored
[ty] Remove py-fuzzer skips for seeds that are no longer slow (#19906)
1 parent 5a570c8 commit d324ced

File tree

2 files changed

+18
-9
lines changed

2 files changed

+18
-9
lines changed

.github/workflows/ci.yaml

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ jobs:
3838
fuzz: ${{ steps.check_fuzzer.outputs.changed }}
3939
# Flag that is set to "true" when code related to ty changes.
4040
ty: ${{ steps.check_ty.outputs.changed }}
41-
41+
# Flag that is set to "true" when code related to the py-fuzzer folder changes.
42+
py-fuzzer: ${{ steps.check_py_fuzzer.outputs.changed }}
4243
# Flag that is set to "true" when code related to the playground changes.
4344
playground: ${{ steps.check_playground.outputs.changed }}
4445
steps:
@@ -68,7 +69,6 @@ jobs:
6869
':crates/ruff_text_size/**' \
6970
':crates/ruff_python_ast/**' \
7071
':crates/ruff_python_parser/**' \
71-
':python/py-fuzzer/**' \
7272
':.github/workflows/ci.yaml' \
7373
; then
7474
echo "changed=false" >> "$GITHUB_OUTPUT"
@@ -138,6 +138,18 @@ jobs:
138138
echo "changed=true" >> "$GITHUB_OUTPUT"
139139
fi
140140
141+
- name: Check if the py-fuzzer code changed
142+
id: check_py_fuzzer
143+
env:
144+
MERGE_BASE: ${{ steps.merge_base.outputs.sha }}
145+
run: |
146+
if git diff --quiet "${MERGE_BASE}...HEAD" -- 'python/py_fuzzer/**' \
147+
; then
148+
echo "changed=false" >> "$GITHUB_OUTPUT"
149+
else
150+
echo "changed=true" >> "$GITHUB_OUTPUT"
151+
fi
152+
141153
- name: Check if there was any code related change
142154
id: check_code
143155
env:
@@ -443,7 +455,7 @@ jobs:
443455
needs:
444456
- cargo-test-linux
445457
- determine_changes
446-
if: ${{ !contains(github.event.pull_request.labels.*.name, 'no-test') && needs.determine_changes.outputs.parser == 'true' }}
458+
if: ${{ !contains(github.event.pull_request.labels.*.name, 'no-test') && (needs.determine_changes.outputs.parser == 'true' || needs.determine_changes.outputs.py-fuzzer == 'true') }}
447459
timeout-minutes: 20
448460
env:
449461
FORCE_COLOR: 1
@@ -633,7 +645,7 @@ jobs:
633645
- cargo-test-linux
634646
- determine_changes
635647
# Only runs on pull requests, since that is the only we way we can find the base version for comparison.
636-
if: ${{ !contains(github.event.pull_request.labels.*.name, 'no-test') && github.event_name == 'pull_request' && needs.determine_changes.outputs.ty == 'true' }}
648+
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') }}
637649
timeout-minutes: 20
638650
steps:
639651
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

python/py-fuzzer/fuzz.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -152,16 +152,13 @@ def print_description(self, index: int, num_seeds: int) -> None:
152152

153153
def fuzz_code(seed: Seed, args: ResolvedCliArgs) -> FuzzResult:
154154
"""Return a `FuzzResult` instance describing the fuzzing result from this seed."""
155-
# TODO(carljm) remove once we debug the slowness of these seeds
156-
skip_check = seed in {120, 160, 314, 335}
157-
158155
code = generate_random_code(seed)
159156
bug_found = False
160157
minimizer_callback: Callable[[str], bool] | None = None
161158

162159
if args.baseline_executable_path is None:
163160
only_new_bugs = False
164-
if not skip_check and contains_bug(
161+
if contains_bug(
165162
code, executable=args.executable, executable_path=args.test_executable_path
166163
):
167164
bug_found = True
@@ -172,7 +169,7 @@ def fuzz_code(seed: Seed, args: ResolvedCliArgs) -> FuzzResult:
172169
)
173170
else:
174171
only_new_bugs = True
175-
if not skip_check and contains_new_bug(
172+
if contains_new_bug(
176173
code,
177174
executable=args.executable,
178175
test_executable_path=args.test_executable_path,

0 commit comments

Comments
 (0)