Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chore: run fuzzer along with unit tests #11404

Merged
merged 1 commit into from Feb 19, 2019
Merged

Conversation

not-an-aardvark
Copy link
Member

What is the purpose of this pull request? (put an "X" next to item)

[x] Other, please explain:

What changes did you make? (Give an overview)

This commit turns on our existing fuzzer tool to run a small number of iterations when the user runs npm test. This is intended to prevent bugs like #11402 where a rule completely breaks when it encounters a particular syntax, but the author doesn't think to test for that kind of syntax.

When there are no fuzzing errors, this adds about 5 seconds to the npm test time. (When there are fuzzing errors, it takes more time because the fuzzer does extra work to try to find the minimal config that reproduces the bug.)

The fuzzer actually has two modes: "crash" (where it only tries to detect rule crashes), and "autofix" (where it additionally tries to detect cases where a rule's autofixer creates a syntax error). For now, this PR just enables "crash" mode when running npm test, because I remember "autofix" mode had some false positives (although they might have been fixed due to parser upgrades).

Is there anything you'd like reviewers to focus on?

The tests will fail on this PR until #11403 is merged, because the fuzzer successfully detects the bug reported in #11402.

@not-an-aardvark not-an-aardvark added the chore This change is not user-facing label Feb 16, 2019
This commit turns on our existing fuzzer tool to run a small number of iterations when the user runs `npm test`. This is intended to prevent bugs like #11402 where a rule completely breaks when it encounters a particular syntax, but the author doesn't think to test for that kind of syntax.

When there are no fuzzing errors, this adds about 5 seconds to the `npm test` time. (When there are fuzzing errors, it takes more time because the fuzzer does extra work to try to find the minimal config that reproduces the bug.)

The fuzzer actually has two modes: "crash" (where it only tries to detect rule crashes), and "autofix" (where it additionally tries to detect cases where a rule's autofixer creates a syntax error). For now, this PR just enables "crash" mode, because I remember "autofix" mode had some false positives (although they might have been fixed due to parser upgrades).
@aladdin-add
Copy link
Member

just rebased and force-pushed, to let the build passing.

@not-an-aardvark not-an-aardvark merged commit b9aabe3 into master Feb 19, 2019
@aladdin-add aladdin-add deleted the enable-fuzzer-in-tests branch February 19, 2019 05:28
@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Aug 19, 2019
@eslint-deprecated eslint-deprecated bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Aug 19, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
archived due to age This issue has been archived; please open a new issue for any further discussion chore This change is not user-facing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants