-
Notifications
You must be signed in to change notification settings - Fork 4
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
Unit tests should normalize whitespace before sorting lines, rather than after #21
Comments
How exactly On the lab computers, This explains why some tests that pass on the lab computers fail on GH actions. I'm not sure why |
Wow – huge thanks to @helloworld12321 for the awesome write-up! We only started with GitHub actions on this lab last year, and I don't remember anyone raising (or being aware of) this issue then. It's possible that it just never came up, or that people ran into the issue and just worked around it in some way. I have no idea why I just checked and the BSD I'm not sure how we'd "normalize whitespace" before sorting, TBH. I suspect this never came up for me because I matched the month and the day using two separate regexes, with |
Yeah, that's totally fair :) I had suggested normalizing before sorting since it seemed like the "intent" of the tests was to ignore whitespace (eg, |
Agreed. The systems differences is definitely super weird. I don't immediately know how to make it consistent across systems, though, since I don't know why our lab |
Maybe we could get rid of the the Then the sort behavior shouldn't matter. If the whitespace matches, the tests will pass; if the whitespace is different, the tests will fail. ¯\_(ツ)_/¯ |
Right now,
process_client_logs.bats
andprocess_logs.bats
each take the actual result, sort it, and diff it with the expected result ignoring whitespace.There's a problem, though—if a line has extra whitespace, it might get sorted differently than the canonical, whitespace-normalized version!
So, to compare two files in a whitespace-insensitive way, we need to normalize whitespace and then sort :)
The text was updated successfully, but these errors were encountered: