Comments (6)
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 sort
behaves differently in the lab. We're (slowly – thanks COVID) in the process of upgrading the lab boxes, and potentially switching to Ubuntu, so it'll be interesting to see what, if any effect that has.
I just checked and the BSD sort
on MacOS seems to behave like the Ubuntu, etc., options you tested above:
I'm not sure how we'd "normalize whitespace" before sorting, TBH. diff
is nice because we can just give it several flags and it will ignore most whitespace. sort
doesn't really have that option, so we'd essentially have to use something like sed
to replace runs of spaces/tabs with a single space. We could do that, but I'm not sure we should as it seems that kind of change might end up "covering up" certain kinds of errors? One could argue, for example, that folks should just eliminate the weird two-space-thing between months and single digit days, and that the tests are "right" in that regard. If that's the case, then maybe we should create a new issue to say something in the write-up about there being an expectation that things like Aug 9
(two spaces) are converted to Aug 9
(with just one space).
I suspect this never came up for me because I matched the month and the day using two separate regexes, with \s+
between them.
from log-processing.
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, diff
had the -wbB
flags). But, I agree that changing the tests to be whitespace-sensitive everywhere might be better. The big thing is just to make it consistent across systems.
from log-processing.
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 sort
behaves differently. I poked at some of the local environment variables mentioned in sort
documentation, and none of them seem to be set in the lab. Weirdz.
from log-processing.
How exactly sort
treats whitespace varies from system to system.
On the lab computers, sort
ignores whitespace. But on most other unix systems, sort
is whitespace-sensitive. (The lab computers even differ from other Fedora systems!)
This explains why some tests that pass on the lab computers fail on GH actions.
I'm not sure why sort
is weird on the lab computers—googling suggests that it might be locale-related ¯\_(ツ)_/¯
from log-processing.
from log-processing.
Maybe we could get rid of the the -wb
flags to diff
?
Then the sort behavior shouldn't matter. If the whitespace matches, the tests will pass; if the whitespace is different, the tests will fail. ¯\_(ツ)_/¯
from log-processing.
Related Issues (17)
- Have students create releases for the two parts HOT 2
- Convert to `bats-core`
- Document cloning with `--recurse-submodules`
- Mention `NF` in `awk` for `process_client_logs.sh`
- Reduce the number of points in Canvas for this lab HOT 2
- Update `setup-bats` version in GitHub Actions HOT 1
- Fix the broken country code example in the README
- Add links to student-discovered resources
- Create a `submodule` script for `bats`
- Break the lab write-up into separate pages HOT 1
- Document `diff` output from `bats` tests
- README.MD assemble_report.sh writeup
- failed_login_summary.html does not exist for tests
- Expand user name tests to include _ and - HOT 2
- Set up GitHub Actions HOT 1
- Replace `master` with `main` HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from log-processing.