3 ms·
Back when I worked on mod_pagespeed we wrote shell scripts for our end-to-end tests. This was expedient when getting started, but then we just kept using it lo
by jefftk 2y ago
Back when I worked on mod_pagespeed we wrote shell scripts for our end-to-end tests. This was expedient when getting started, but then we just kept using it long past when we should have switched away. At one point I got buy-in for switching to python, but (inexperience) I thought the right way to do it was to build up a parallel set of tests in python and then switch over once everything had been ported. This, of course, didn't work out. If I were doing this now I'd do it incrementally, since there's no reason you can't have a mix of shell and python during the transition.
I count 10k lines of hand-written bash in the system tests:
$ git clone git@github.com:apache/incubator-pagespeed-mod.git
$ git clone git@github.com:apache/incubator-pagespeed-ngx.git
$ find incubator-pagespeed-* | \
grep sh$ | \
grep system_test | \
xargs cat | \
wc -l
10579
- gjvc 2y agolines ending in | do not require \
- michaelcampbell 2y agoI (also?) never new this; thanks. My old finger memory will still probably put them in, alas.
- jefftk 2y agoThanks for the tip! (I'm very conflicted about learning new things that make shell more convenient: I don't need more things pushing me toward using this in-many-ways-horrible-but-I'm-so-fast-with-it tool.)
- gjvc 2y agoyou might (or might not) like this, then https://iam.georgecox.com/2023/02/05/command-dispatch-via-bash-array-notation-oh-my/ https://iam.georgecox.com/2023/02/05/command-dispatch-via-ba...
- greazy 2y agoIn my experience they do. Could it be related to strict bash mode?
- gjvc 2y agodunno. give some evidence.