Skip to content

Commit 9d6e39a

Browse files
committed
Add automated coverage testing.
Adds a submodule pointing to `coverage' branch of https-everywhere-checker. Adds a script to automatically run the checker in coverage-only mode.
1 parent cf994d1 commit 9d6e39a

File tree

4 files changed

+28
-2
lines changed

4 files changed

+28
-2
lines changed

.gitmodules

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
[submodule "addon-sdk"]
22
path = addon-sdk
33
url = https://github.com/mozilla/addon-sdk.git
4+
[submodule "https-everywhere-checker"]
5+
path = https-everywhere-checker
6+
url = https://github.com/jsha/https-everywhere-checker.git
7+
branch = coverage

.travis.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,13 @@ python:
77
addons:
88
firefox: "35.0"
99
install:
10-
- sudo apt-get -qq install libxml2-dev libxslt-dev python-dev
10+
- sudo apt-get -qq install libxml2-dev libxslt-dev python-dev libcurl4-openssl-dev
1111
- pip install -r requirements.txt
12+
- pip install -r https-everywhere-checker/requirements.txt
1213
before_script:
1314
- sh -e /etc/init.d/xvfb start
1415
env:
1516
- DISPLAY=':99.0'
16-
script: ./test.sh
17+
script:
18+
- ./test.sh
19+
- ./test-ruleset-coverage.sh

https-everywhere-checker

test-ruleset-coverage.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/sh
2+
#
3+
# Test that all rulesets modified after a certain date have sufficient test
4+
# coverage, according to the ruleset checker.
5+
#
6+
cd $(dirname $0)
7+
TMP=`mktemp`
8+
trap 'rm "$TMP"' EXIT
9+
if ! git log --name-only --date=local --since=2015-02-05 --pretty=format: \
10+
src/chrome/content/rules/ | sort -u | \
11+
xargs python2.7 https-everywhere-checker/src/https_everywhere_checker/check_rules.py \
12+
https-everywhere-checker/checker.config.sample ; then
13+
echo "Ruleset test coverage was insufficient. Please add <test url=...> tags " \
14+
"to ruleset with additional HTTP URLs to test rewriting and fetching."
15+
exit 1
16+
else
17+
exit 0
18+
fi

0 commit comments

Comments
 (0)