Better unittest coverage #427

Open
jsha opened this Issue Aug 12, 2014 · 6 comments

Projects

None yet

6 participants

@jsha
Member
jsha commented Aug 12, 2014

Right now we have very few automated tests for HTTPS Everywhere. We should add unittest, especially of how rulesets get applied.

@tvroom
tvroom commented Aug 22, 2014

Would like to help at some point, need to familiarize myself with the codebase / testing framework a bit -- but then would love to find ways to contribute in the future

@dineshjoshi

Would like to help too. Any pointers on where can I start?

@UncleDuke

I write stuff like this fairly often - where should I start?

@jsha
Member
jsha commented Aug 23, 2014

Wonderful, thank you all for your help! The current (very small) tests we have are in https-everywhere-tests/. To run them, run ./test.sh. Here are some areas new tests should cover:

  • Ruleset evaluation. Basic stuff like, if we have a simple rule X, does it rewrite URL Y correctly. Also more complicated stuff, like: If we have rulesets X and Y that apply to the same domain, do they interact correctly. Do downgrade rules work correctly, and do exclusions work correctly. Does matching of target hosts with wildcards (e.g. .google.com, www.google., etc) work correctly.
  • SSL Observatory tests. When the extension observes a cert that's not in the whitelist, does it submit that cert. Does the extension exclude certs that are in the whitelist. Does the extension queue requests when there are too many. Does the Observatory code correctly obey the on/off preference. Does it correctly observe the Tor preference.
  • UI tests: Does the UI show the correct list of rules that applied to a given page. Does disabling and enabling rules from the drop down take effect and get stored. Do enabled rules get shown in green, disabled ones in grey.
  • Chromium tests. Right now our only tests are for Firefox. It would be great to have tests for the Chromium extension also. There's an initial script at run-chromium.sh that allows you to run Chromium with the latest built extension. It might make a good beginning for Chromium-based tests.
  • Anything else you can think of!
@semenko
Collaborator
semenko commented Aug 23, 2014

RE Jacob's first point, I've been collecting some common (very basic) ruleset errors we see: #460

@jsha
Member
jsha commented Aug 23, 2014

Right, that's another good area to work on: sanity testing the rulesets. However, I would say the place where we are the furthest behind is in testing the ruleset evaluation code itself, i.e. HTTPSRules.js.

@2d1 2d1 added the enhancement label Oct 9, 2014
@2d1 2d1 added this to the wishlist milestone Oct 9, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment