-
-
Notifications
You must be signed in to change notification settings - Fork 398
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
Running tests with RECORD=true leaves a non-clean working tree #855
Labels
Comments
myitcv
added a commit
to myitcvforks/chroma
that referenced
this issue
Sep 21, 2023
This helps to ensure that running RECORD=true go test ./lexers on a given commit for which the tests pass will not result in any changes in the working tree. Fixes alecthomas#855
myitcv
added a commit
to myitcvforks/chroma
that referenced
this issue
Sep 21, 2023
This helps to ensure that running RECORD=true go test ./lexers on a given commit for which the tests pass will not result in any changes in the working tree. Notes that as a result of this change, the following command results in a clean working tree: RECORD=true go test ./lexers Fixes alecthomas#855
Moved comment to PR. |
alecthomas
pushed a commit
that referenced
this issue
Sep 21, 2023
* test: fix up writing up float scores with trailing newlines This ensures we consistently write a trailing newline when RECORD=true is set. * lexers: update expected files using proper newlines This is the mechanical result of running: RECORD=true go test ./lexers * Assert lexer tests based on equality of byte encodings This helps to ensure that running RECORD=true go test ./lexers on a given commit for which the tests pass will not result in any changes in the working tree. Notes that as a result of this change, the following command results in a clean working tree: RECORD=true go test ./lexers Fixes #855
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is there an existing issue for this?
Describe the bug
Running the lexer tests against def00e9 with
RECORD=true
leaves the git working tree in an non-clean state.To Reproduce
Against commit def00e9:
So whilst the lexer tests pass, updating the expectations files results in changes.
This seems less than ideal for people making contributions to the repo, especially if they are updating expectations in specific files because they could easily include unrelated changes in others, without a clear understanding of why there are differences.
According to my analysis there are two reasons behind this:
I have a PR that includes a number of commits that propose a solution to this, which I will push up for discussion to complement this issue.
The text was updated successfully, but these errors were encountered: