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

test: Add betterer #9987

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

Minion3665
Copy link
Member

Betterer is a snapshot test runner which tries to reduce the number of errors. With, for example, eslint, we need to get to 0 errors for the test to pass. This is prohibitive for large changes (e.g. turning on a new eslint option), as you then have to make a lot of changes in the same pull request. For betterer, you only have to avoid making the test fail more, so it's OK to fix errors or leave things alone.


It runs as a part of check, and outputs (but doesn't block) building.

You can also run it manually, in the same way as prettier or eslint

$ make betterer

And get it to update its snapshots, again in the same way as prettier

$ make betterer-write


I avoided adding the betterer precommit, as running eslint takes a long while and this blocked the commit for longer than I considered acceptable. There's probably a way to make this work with eslint-d and a custom test, but even so it's likely custom, brittle and non-ideal.


This is a prerequisite for #9975, which is a prerequisite for #8221

  • Resolves: #
  • Target version: master

Summary

TODO

  • ...

Checklist

  • I have run make prettier-write and formatted the code.
  • All commits have Change-Id
  • I have run tests with make check
  • I have issued make run and manually verified that everything looks okay
  • Documentation (manuals or wiki) has been updated or is not required

@Minion3665 Minion3665 force-pushed the private/skyler/push-spykuyuzlqrq branch 9 times, most recently from a386958 to 23a244e Compare September 11, 2024 12:27
Betterer is a snapshot test runner which tries to reduce the number of
errors. With, for example, eslint, we need to get to 0 errors for the
test to pass. This is prohibitive for large changes (e.g. turning on a
new eslint option), as you then have to make a lot of changes in the
same pull request. For betterer, you only have to avoid making the test
fail *more*, so it's OK to fix errors or leave things alone.

---

It runs as a part of check, and outputs (but doesn't block) building.

You can also run it manually, in the same way as prettier or eslint

$ make betterer

And get it to update its snapshots, again in the same way as prettier

$ make betterer-write

---

I avoided adding the betterer precommit, as running eslint takes a long
while and this blocked the commit for longer than I considered
acceptable. There's probably a way to make this work with eslint-d and a
custom test, but even so it's likely custom, brittle and non-ideal.

Signed-off-by: Skyler Grey <[email protected]>
Change-Id: I1770a1a8be3f45b45bda0fd2bcd57563add25924
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: To Review
Development

Successfully merging this pull request may close these issues.

2 participants