You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 6, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Nov 6, 2023. It is now read-only.
Add tests against non-match groups being used in replacements #4327
As told on the email, I suggest to add check that ensures that $1..$9 is absent in rewritten URL when going through <test url />s and auto-generated URLs from hosts. This will prevent mistakes such as #4326, #4302, #4301, #4300, #4299, #2980 and similar.
@RReverserfetch-test.sh already indicates an error when run on files containing non-match groups in replacements:
$ ./fetch-test.sh rules/Waffles.fm.xml
ERROR rules/Waffles.fm.xml: No rule or exclusion applies to test URL http://waffles.fm/
INFO Finished comparing http://waffles.fm/ -> http://waffles.fm/. Rulefile: rules/Waffles.fm.xml.
ERROR rules/Waffles.fm.xml: Regex Error invalid group reference at position 13 ^http://www\.waffles\.fm/
INFO Finished in 2.45 seconds. Loaded rulesets: 1, URL pairs: 2.
Just to be clear, this ticket is for adding it to trivial-validate.py?
@RReverserfetch-test.sh is not run by CI because it actually goes and fetches the remote endpoints to check for non-200 responses upon redirect. This would take a long time for every rule. We ordinarily run it on rules that have changed manually.
@jsha and I discussed it. This test probably belongs in https_everywhere_checker and should be written as part of a larger rewrite which eliminates the sqlite db, where the tests source directly from the xml files.
Activity
jsha commentedon Mar 13, 2016
@Hainish, can you work on this one?
Hainish commentedon Mar 14, 2016
Yes, I can start this tomorrow.
On Mar 13, 2016 4:03 PM, "Jacob Hoffman-Andrews" notifications@github.com
wrote:
Hainish commentedon Mar 15, 2016
@RReverser
fetch-test.shalready indicates an error when run on files containing non-match groups in replacements:Just to be clear, this ticket is for adding it to
trivial-validate.py?RReverser commentedon Mar 15, 2016
I don't really know codebase structure of HTTPS Everywhere, sorry.
Just wondering - if this test is already present, how come those errors are not produced / caught by CI?
Hainish commentedon Mar 15, 2016
@RReverser
fetch-test.shis not run by CI because it actually goes and fetches the remote endpoints to check for non-200 responses upon redirect. This would take a long time for every rule. We ordinarily run it on rules that have changed manually.RReverser commentedon Mar 15, 2016
@Hainish Oh, but this check doesn't really need to fetch remote endpoints, so maybe makes sense to move it?
Hainish commentedon Mar 15, 2016
@jsha and I discussed it. This test probably belongs in
https_everywhere_checkerand should be written as part of a larger rewrite which eliminates thesqlitedb, where the tests source directly from thexmlfiles.fuglede commentedon Mar 20, 2016
For the sake of reference, #3107 suggests adding a https-everywhere-checker test to the CI.
Add tests against non-match groups being used in replacements (resolves