Skip to content
This repository was archived by the owner on Nov 6, 2023. It is now read-only.
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

Closed

Description

@RReverser

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.

/cc @jsha

Activity

  1. jsha commented on Mar 13, 2016

    @jsha
    Member

    @Hainish, can you work on this one?

  2. Hainish commented on Mar 14, 2016

    @Hainish
    Member

    Yes, I can start this tomorrow.
    On Mar 13, 2016 4:03 PM, "Jacob Hoffman-Andrews" notifications@github.com
    wrote:

    @Hainish https://github.com/Hainish, can you work on this one?

    —
    Reply to this email directly or view it on GitHub
    #4327 (comment)
    .

  3. Hainish commented on Mar 15, 2016

    @Hainish
    Member

    @RReverser fetch-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?

  4. RReverser commented on Mar 15, 2016

    @RReverser
    ContributorAuthor

    Just to be clear, this ticket is for adding it to trivial-validate.py?

    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?

  5. Hainish commented on Mar 15, 2016

    @Hainish
    Member

    @RReverser fetch-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.

  6. RReverser commented on Mar 15, 2016

    @RReverser
    ContributorAuthor

    @Hainish Oh, but this check doesn't really need to fetch remote endpoints, so maybe makes sense to move it?

  7. Hainish commented on Mar 15, 2016

    @Hainish
    Member

    @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.

  8. fuglede commented on Mar 20, 2016

    @fuglede
    Contributor

    For the sake of reference, #3107 suggests adding a https-everywhere-checker test to the CI.

  9. added a commit that references this issue on Mar 22, 2016
    950c212
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions