[WIP] Add make job to refresh integration tests #1728
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a proof of concept. Running
make integ-regen
will run all the integration tests, but instead of checkingflycheck-current-errors
against the expected form passed toflycheck-ert-should-syntax-check
, it replaces that form with the-current-errors
inflycheck-test.el
directly.That way, a subsequent
make integ
will pass all tests. This greatly simplifies the workflow of updating the integration tests expected output: just runmake integ-regen
after a CI failure, check the git diff for anything suspicious, then commit and push.The current PoC is very hackish and probably inefficient, but it's a good starting point for discussion. The two main ingredients are:
make integ-regen
adds a load tosetup-regen.el
so that we can redefine-ert-should-syntax-check
to call-ert-regen-errors
instead of-ert-should-errors
(and skip the length check of errors)-ert-regen-errors
locates the expected errors inflycheck-test.el
(using a ghastly regexp) and replaces that text with-current-errors
turned into a stringFirst: is this sound? And we do want to go that route?
(Note that I have only tested it on Rust tests, so it may well fail on other tests that construct errors a bit differently)