Skip to content

Commit 45ec4f9

Browse files
committed
Auto install latest https-e in test script
1 parent 592d3ac commit 45ec4f9

File tree

4 files changed

+22
-8
lines changed

4 files changed

+22
-8
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@ tokenkeys.py*
1111
.idea
1212
*.pyc
1313
from-preloads/
14+
test_profile/

https-everywhere-tests/README.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,12 @@
44
* Latest release of the Firefox Add-On SDK: https://developer.mozilla.org/en-US/Add-ons/SDK/Tutorials/Installation
55

66
## Instructions
7-
1. Create a clean Firefox profile and install the HTTPS Everywhere XPI that you wish to test (TODO: script this).
8-
2. Copy the profile to `/tmp/test_profile` (TODO: make this configurable).
9-
3. Activate the Add-on SDK.
10-
4. cd to your HTTPS Everywhere repository root and run `./test.sh`.
11-
5. To add tests, put them in `./https-everywhere-tests/tests`.
7+
### First time
8+
1. Create a clean Firefox profile and install HTTPS Everywhere.
9+
2. Copy the profile to `./test_profile` (TODO: make this configurable).
10+
11+
### Every time
12+
1. Activate the Add-on SDK.
13+
2. cd to your HTTPS Everywhere repository root and run `./test.sh`.
14+
15+
To add tests, put them in `./https-everywhere-tests/tests`.

https-everywhere-tests/doc/main.md

Whitespace-only changes.

test.sh

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ TEST_ADDON_PATH=./https-everywhere-tests/
88
LATEST_SDK_VERSION=1.16
99

1010
# firefox profile that has HTTPS Everywhere installed
11-
PROFILE_DIRECTORY=/tmp/test_profile
11+
PROFILE_DIRECTORY=./test_profile
12+
HTTPSE_INSTALL_DIRECTORY=./test_profile/extensions/https-everywhere@eff.org
1213

1314
if [ ! -d "$TEST_ADDON_PATH" ]; then
1415
echo "Test addon path does not exist"
@@ -20,6 +21,11 @@ if [ ! -d "$PROFILE_DIRECTORY" ]; then
2021
exit 1
2122
fi
2223

24+
if [ ! -d "$HTTPSE_INSTALL_DIRECTORY" ]; then
25+
echo "Firefox profile does not have HTTPS Everywhere installed"
26+
exit 1
27+
fi
28+
2329
if ! type cfx > /dev/null; then
2430
echo "Please activate the Firefox Addon SDK before running this script."
2531
exit 1
@@ -30,6 +36,9 @@ if ! cfx --version | grep -q "$LATEST_SDK_VERSION"; then
3036
exit 1
3137
fi
3238

33-
cd $TEST_ADDON_PATH
39+
cd src/
40+
rsync -av --exclude-from="../.build_exclusions" . ../$HTTPSE_INSTALL_DIRECTORY
41+
42+
cd ../$TEST_ADDON_PATH
3443
echo "running tests"
35-
cfx test --profiledir=$PROFILE_DIRECTORY --verbose
44+
cfx test --profiledir="../$PROFILE_DIRECTORY" --verbose

0 commit comments

Comments
 (0)